Skip to content

Commit de14308

Browse files
committed
really add install-vmfleet
1 parent c274353 commit de14308

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<#
2+
DISKSPD - VM Fleet
3+
4+
Copyright(c) Microsoft Corporation
5+
All rights reserved.
6+
7+
MIT License
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy
10+
of this software and associated documentation files (the "Software"), to deal
11+
in the Software without restriction, including without limitation the rights
12+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
copies of the Software, and to permit persons to whom the Software is
14+
furnished to do so, subject to the following conditions:
15+
16+
The above copyright notice and this permission notice shall be included in all
17+
copies or substantial portions of the Software.
18+
19+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25+
SOFTWARE.
26+
#>
27+
28+
param(
29+
$source = $(throw "Must specify the source directory for the vmfleet scripts")
30+
)
31+
32+
$col = get-clustersharedvolume |? Name -match '(collect)'
33+
if ($col -eq $null) {
34+
write-error "The collect CSV is not present"
35+
return
36+
}
37+
38+
$fqsrc = gi $source
39+
if ($fqsrc -eq $null) {
40+
write-error "The source directory for the vmfleet scripts is not accessible"
41+
}
42+
43+
# update the csv mounts to their normalized names and install scripts and directory structure
44+
# remove internet-download blocks on ps1 scripting, if present
45+
& $fqsrc\update-csv.ps1 -renamecsvmounts
46+
$control = 'C:\ClusterStorage\collect\control'
47+
48+
cp -r $fqsrc $control
49+
dir $control\*.ps1 |% { Unblock-File $_ }
50+
51+
mkdir $control\result
52+
mkdir $control\flag
53+
mkdir $control\tools
54+
55+
56+
# put the control directory onto the path
57+
if (-not ([System.Environment]::GetEnvironmentVariable("path") -split ';' |? { $_ -eq $control })) {
58+
$newpath = [System.Environment]::GetEnvironmentVariable("path") + ";$control"
59+
[System.Environment]::SetEnvironmentVariable("path",
60+
$newpath,
61+
[System.EnvironmentVariableTarget]::Process)
62+
[System.Environment]::SetEnvironmentVariable("path",
63+
$newpath,
64+
[System.EnvironmentVariableTarget]::User)
65+
}
66+
67+
# disable the csv balancer so that motion is under fleet control
68+
(get-cluster).CsvBalancer = 0
69+
70+
# finally set fleet pause and touch the base run file so that we ensure
71+
# the fleet will start with it.
72+
set-pause
73+
(gi $control\run.ps1).IsReadOnly = $false
74+
(gi $control\run.ps1).LastWriteTime = (Get-Date)

0 commit comments

Comments
 (0)