Update end-to-end rendering deployment example

This commit is contained in:
Rick Shahid 2022-10-17 10:49:20 -07:00
Родитель 3e8d0c44e2
Коммит 3522443b7c
12 изменённых файлов: 142 добавлений и 105 удалений

Просмотреть файл

@ -4,7 +4,8 @@ ADMIN_PASSWORD=${adminPassword} /usr/bin/hs-init-admin-pw
if [[ ${machineSize} == Standard_HB* ]]; then
sed -i '/OS.EnableRDMA=/c\OS.EnableRDMA=y' /etc/waagent.conf
systemctl restart waagent
shutdown -r 1
#echo "systemctl restart waagent" | at now +1 minutes
fi
# hscli interface-update --node-name hs1Dsx1.hs1.azure --interface-name ib0 --ip 172.16.0.21/16

Просмотреть файл

@ -827,8 +827,8 @@ resource "azurerm_virtual_machine_extension" "storage" {
)}"
})
depends_on = [
azurerm_linux_virtual_machine.storage_metadata,
azurerm_linux_virtual_machine.storage_data
azurerm_virtual_machine_data_disk_attachment.storage_metadata,
azurerm_virtual_machine_data_disk_attachment.storage_data
]
}

Просмотреть файл

@ -115,7 +115,7 @@ imageTemplates = [
"Blender",
"PBRT",
"Unity",
"Unreal",
"Unreal,PixelStream",
# "Maya",
# "Houdini"
]
@ -153,7 +153,7 @@ imageTemplates = [
machineType = "Farm"
machineSize = "Standard_HB120rs_v2" # https://learn.microsoft.com/azure/virtual-machines/sizes
osDiskSizeGB = 480 # https://learn.microsoft.com/azure/virtual-machines/linux/image-builder-json#osdisksizegb
timeoutMinutes = 360 # https://learn.microsoft.com/azure/virtual-machines/linux/image-builder-json#properties-buildtimeoutinminutes
timeoutMinutes = 420 # https://learn.microsoft.com/azure/virtual-machines/linux/image-builder-json#properties-buildtimeoutinminutes
outputVersion = "1.0.0"
runElevated = false
renderEngines = [
@ -187,7 +187,7 @@ imageTemplates = [
"Blender",
"PBRT",
"Unity",
"Unreal",
"Unreal,PixelStream",
# "Maya",
# "3DSMax",
# "Houdini"

Просмотреть файл

@ -17,9 +17,9 @@ Resize-Partition -DriveLetter $osDriveLetter -Size $partitionSize.SizeMax
Write-Host "Customize (End): Resize OS Disk"
Write-Host "Customize (Start): Git"
$versionInfo = "2.37.3"
$versionInfo = "2.38.0"
$installFile = "Git-$versionInfo-64-bit.exe"
$downloadUrl = "https://github.com/git-for-windows/git/releases/download/v$versionInfo.windows.1/$installFile"
$downloadUrl = "$storageContainerUrl/Git/$versionInfo/$installFile$storageContainerSas"
Invoke-WebRequest -OutFile $installFile -Uri $downloadUrl
Start-Process -FilePath .\$installFile -ArgumentList "/SILENT /NORESTART" -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
$toolPathGit = "C:\Program Files\Git\bin"
@ -28,8 +28,12 @@ Write-Host "Customize (End): Git"
Write-Host "Customize (Start): Visual Studio"
$versionInfo = "2022"
$installFile = "VisualStudioSetup.exe"
$downloadUrl = "https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community&channel=Release&version=VS$versionInfo&includeRecommended=true"
$workloadIds = "--add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended --add Microsoft.VisualStudio.Workload.NativeGame;includeRecommended --add Microsoft.NetCore.Component.Runtime.3.1 --add Component.Unreal"
$downloadUrl = "$storageContainerUrl/VS/$versionInfo/$installFile$storageContainerSas"
$workloadIds = "--add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended"
$workloadIds += " --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended"
$workloadIds += " --add Microsoft.VisualStudio.Workload.NativeGame;includeRecommended"
$workloadIds += " --add Microsoft.NetCore.Component.Runtime.3.1"
$workloadIds += " --add Component.Unreal"
Invoke-WebRequest -OutFile $installFile -Uri $downloadUrl
Start-Process -FilePath .\$installFile -ArgumentList "--quiet --norestart $workloadIds" -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
$toolPathVSIX = "C:\Program Files\Microsoft Visual Studio\$versionInfo\Community\Common7\IDE"
@ -98,6 +102,7 @@ $rendererPaths = ""
$rendererPathBlender = "C:\Program Files\Blender Foundation\Blender3"
$rendererPathPBRT = "C:\Program Files\PBRT3"
$rendererPathUnreal = "C:\Program Files\Epic Games\Unreal5"
$rendererPathUnrealStream = "$rendererPathUnreal\Stream"
$rendererPathUnrealEditor = "$rendererPathUnreal\Engine\Binaries\Win64"
$rendererPathMaya = "C:\Program Files\Autodesk\Maya2023"
$rendererPath3DSMax = "C:\Program Files\Autodesk\3ds Max 2023"
@ -109,7 +114,7 @@ if ($renderEngines -like "*PBRT*") {
$rendererPaths += ";$rendererPathPBRT\Release"
}
if ($renderEngines -like "*Unreal*") {
$rendererPaths += ";$rendererPathUnrealEditor"
$rendererPaths += ";$rendererPathUnreal"
}
if ($renderEngines -like "*Maya*") {
$rendererPaths += ";$rendererPathMaya"
@ -203,35 +208,24 @@ if ($renderEngines -like "*Unreal*") {
$installFile = "dism.exe"
$featureName = "NetFX3"
Start-Process -FilePath $installFile -ArgumentList "/Enable-Feature /FeatureName:$featureName /Online /All /NoRestart" -Wait -Verb RunAs
$versionInfo = "5.0.3"
$installFile = "UnrealEngine-$versionInfo-release.zip"
$downloadUrl = "$storageContainerUrl/Unreal/$versionInfo/$installFile$storageContainerSas"
$installFile = "UnrealEngine-5.1.zip"
$downloadUrl = "$storageContainerUrl/Unreal/$installFile$storageContainerSas"
Invoke-WebRequest -OutFile $installFile -Uri $downloadUrl
Expand-Archive -Path $installFile -DestinationPath "$rendererPathUnreal"
Move-Item -Path "$rendererPathUnreal\Unreal*\*" -Destination "$rendererPathUnreal"
Expand-Archive -Path $installFile
New-Item -ItemType Directory -Path "$rendererPathUnreal" -Force
Move-Item -Path "Unreal*\Unreal*\*" -Destination "$rendererPathUnreal"
$installFile = "$rendererPathUnreal\Setup.bat"
$setupScript = Get-Content -Path $installFile
$setupScript = $setupScript.Replace("/register", "/register /unattended")
$setupScript = $setupScript.Replace("pause", "rem pause")
Set-Content -Path $installFile -Value $setupScript
Start-Process -FilePath "$installFile" -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
Write-Host "Customize (Start): Unreal Pixel Streaming"
$installFile = "setup.bat"
Set-Location -Path "$rendererPathUnreal/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/cmd"
Start-Process -FilePath ./$installFile -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
$installFile = "setup.bat"
Set-Location -Path "$rendererPathUnreal/Samples/PixelStreaming/WebServers/MatchMaker/platform_scripts/cmd"
Start-Process -FilePath ./$installFile -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
Set-Location -Path $binDirectory
Write-Host "Customize (End): Unreal Pixel Streaming"
if ($machineType -eq "Workstation") {
Write-Host "Customize (Start): Unreal Visual Studio Project Files"
Write-Host "Customize (Start): Unreal Project Files"
& "$rendererPathUnreal\GenerateProjectFiles.bat"
[System.Environment]::SetEnvironmentVariable("PATH", "$env:PATH;C:\Program Files\dotnet")
Start-Process -FilePath "$toolPathMSBuild\MSBuild.exe" -ArgumentList "-restore -p:Platform=Win64 -p:Configuration=""Development Editor"" ""$rendererPathUnreal\UE5.sln""" -Wait -RedirectStandardOutput "msbuild-ue5.output.txt" -RedirectStandardError "msbuild-ue5.error.txt"
Write-Host "Customize (End): Unreal Visual Studio Project Files"
Write-Host "Customize (End): Unreal Project Files"
Write-Host "Customize (Start): Unreal Visual Studio Plugin"
$installFile = "UnrealVS.vsix"
Start-Process -FilePath "$toolPathVSIX\VSIXInstaller.exe" -ArgumentList "/quiet /admin ""$rendererPathUnreal\Engine\Extras\UnrealVS\$installFile""" -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
@ -248,6 +242,24 @@ if ($renderEngines -like "*Unreal*") {
Write-Host "Customize (End): Unreal Engine"
}
if ($renderEngines -like "*Unreal,PixelStream*") {
Write-Host "Customize (Start): Unreal Pixel Streaming"
$installFile = "PixelStreamingInfrastructure-UE5.1.zip"
$downloadUrl = "$storageContainerUrl/Unreal/$installFile$storageContainerSas"
Invoke-WebRequest -OutFile $installFile -Uri $downloadUrl
Expand-Archive -Path $installFile
New-Item -ItemType Directory -Path "$rendererPathUnrealStream" -Force
Move-Item -Path "PixelStreaming*\PixelStreaming*\*" -Destination "$rendererPathUnrealStream"
$installFile = "setup.bat"
Set-Location -Path "$rendererPathUnrealStream/SignallingWebServer/platform_scripts/cmd"
Start-Process -FilePath ./$installFile -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
$installFile = "setup.bat"
Set-Location -Path "$rendererPathUnrealStream/MatchMaker/platform_scripts/cmd"
Start-Process -FilePath ./$installFile -Wait -RedirectStandardOutput "$installFile.output.txt" -RedirectStandardError "$installFile.error.txt"
Set-Location -Path $binDirectory
Write-Host "Customize (End): Unreal Pixel Streaming"
}
if ($renderEngines -like "*Maya*") {
Write-Host "Customize (Start): Maya"
$versionInfo = "2023"
@ -314,7 +326,7 @@ if ($machineType -eq "Farm") {
if ($machineType -eq "Workstation") {
Write-Host "Customize (Start): Teradici PCoIP Agent"
$versionInfo = "22.04.0"
$versionInfo = "22.09.0"
$installFile = "pcoip-agent-graphics_$versionInfo.exe"
$downloadUrl = "$storageContainerUrl/Teradici/$versionInfo/$installFile$storageContainerSas"
Invoke-WebRequest -OutFile $installFile -Uri $downloadUrl

Просмотреть файл

@ -39,7 +39,7 @@ if [[ ($machineSize == Standard_NV* && $machineSize == *_v3) ||
downloadUrl="https://go.microsoft.com/fwlink/?linkid=874272"
curl -o $installFile -L $downloadUrl
chmod +x $installFile
./$installFile --silent &> $installFile.txt
./$installFile --silent &> "$installFile.txt"
echo "Customize (End): NVIDIA GPU GRID Driver"
fi
@ -117,6 +117,7 @@ rendererPaths=""
rendererPathBlender="/usr/local/blender3"
rendererPathPBRT="/usr/local/pbrt3"
rendererPathUnreal="/usr/local/unreal5"
rendererPathUnrealStream="$rendererPathUnreal/stream"
rendererPathMaya="/usr/autodesk/maya2023/bin"
rendererPathHoudini="/usr/local/houdini19"
if [[ $renderEngines == *Blender* ]]; then
@ -146,7 +147,7 @@ echo "Customize (End): Deadline Download"
if [ $machineType == "Scheduler" ]; then
echo "Customize (Start): Deadline Repository"
installFile="DeadlineRepository-$schedulerVersion-linux-x64-installer.run"
./$installFile --mode unattended --dbLicenseAcceptance accept --installmongodb true --dbhost localhost --mongodir $schedulerDatabasePath --prefix $schedulerRepositoryPath &> $installFile.txt
./$installFile --mode unattended --dbLicenseAcceptance accept --installmongodb true --dbhost localhost --mongodir $schedulerDatabasePath --prefix $schedulerRepositoryPath &> "$installFile.txt"
installFileLog="/tmp/bitrock_installer.log"
cp $installFileLog $binDirectory/bitrock_installer_server.log
rm -f $installFileLog
@ -166,7 +167,7 @@ else
[ $machineType == "Farm" ] && workerStartup=true || workerStartup=false
installArgs="$installArgs --slavestartup $workerStartup --launcherdaemon true"
fi
./$installFile $installArgs &> $installFile.txt
./$installFile $installArgs &> "$installFile.txt"
cp /tmp/bitrock_installer.log $binDirectory/bitrock_installer_client.log
deadlineCommandName="ChangeRepositorySkipValidation"
$schedulerPath/deadlinecommand -$deadlineCommandName Direct $schedulerRepositoryLocalMount $schedulerRepositoryCertificate "" &> $deadlineCommandName.txt
@ -217,29 +218,43 @@ fi
if [[ $renderEngines == *Unreal* ]]; then
echo "Customize (Start): Unreal Engine"
yum -y install libicu
versionInfo="5.0.3"
installFile="UnrealEngine-$versionInfo-release.tar.gz"
downloadUrl="$storageContainerUrl/Unreal/$versionInfo/$installFile$storageContainerSas"
installFile="UnrealEngine-5.1.zip"
downloadUrl="$storageContainerUrl/Unreal/$installFile$storageContainerSas"
curl -o $installFile -L $downloadUrl
unzip $installFile
cd Unreal*
mkdir -p $rendererPathUnreal
tar -xzf $installFile -C $rendererPathUnreal
mv $rendererPathUnreal/Unreal*/* $rendererPathUnreal
mv * $rendererPathUnreal
$rendererPathUnreal/Setup.sh
# $rendererPathUnreal/GenerateProjectFiles.sh
# make -C $rendererPathUnreal
# echo "Customize (Start): Unreal Pixel Streaming"
# cd $rendererPathUnreal/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash
# chmod +x *.sh
# ./setup.sh
# cd $rendererPathUnreal/Samples/PixelStreaming/WebServers/MatchMaker/platform_scripts/bash
# chmod +x *.sh
# ./setup.sh
# cd $binDirectory
# echo "Customize (End): Unreal Pixel Streaming"
cd $binDirectory
if [ $machineType == "Workstation" ]; then
echo "Customize (Start): Unreal Project Files"
$rendererPathUnreal/GenerateProjectFiles.sh
make -C $rendererPathUnreal
echo "Customize (End): Unreal Project Files"
fi
echo "Customize (End): Unreal Engine"
fi
if [[ $renderEngines == *Unreal,PixelStream* ]]; then
echo "Customize (Start): Unreal Pixel Streaming"
installFile="PixelStreamingInfrastructure-UE5.1.zip"
downloadUrl="$storageContainerUrl/Unreal/$installFile$storageContainerSas"
curl -o $installFile -L $downloadUrl
unzip $installFile
cd PixelStreaming*
mkdir -p $rendererPathUnrealStream
mv * $rendererPathUnrealStream
cd $rendererPathUnrealStream/SignallingWebServer/platform_scripts/bash
chmod +x *.sh
./setup.sh
cd $rendererPathUnrealStream/MatchMaker/platform_scripts/bash
chmod +x *.sh
./setup.sh
cd $binDirectory
echo "Customize (End): Unreal Pixel Streaming"
fi
if [[ $renderEngines == *Maya* ]]; then
echo "Customize (Start): Maya"
yum -y install libGL
@ -312,14 +327,14 @@ if [ $machineType == "Workstation" ]; then
echo "Customize (End): Workstation Desktop"
echo "Customize (Start): Teradici PCoIP Agent"
versionInfo="22.04.0"
installFile="teradici-pcoip-agent_rpm.sh"
versionInfo="22.09.0"
installFile="pcoip-agent-offline-centos7.9_$versionInfo-1.el7.x86_64.tar.gz"
downloadUrl="$storageContainerUrl/Teradici/$versionInfo/$installFile$storageContainerSas"
curl -o $installFile -L $downloadUrl
chmod +x $installFile
./$installFile &> $installFile.txt
tar -xzf $installFile
installfile="install-pcoip-agent.sh"
./$installFile pcopi-agent-graphics &> "$installFile.txt"
yum -y install usb-vhci
yum -y install pcoip-agent-graphics
echo "Customize (End): Teradici PCoIP Agent"
# echo "Customize (Start): Cinebench"

Просмотреть файл

@ -214,8 +214,9 @@ if [ ${cycleCloud.enabled} == true ]; then
make altinstall
cd ..
installFile="scaleLib.tar.gz"
downloadUrl="https://github.com/Azure/cyclecloud-scalelib/archive/refs/tags/0.2.7.tar.gz"
versionInfo="0.2.11"
installFile="cyclecloud-scalelib-$versionInfo.tar.gz"
downloadUrl="https://github.com/Azure/cyclecloud-scalelib/archive/refs/tags/$versionInfo.tar.gz"
curl -o $installFile -L $downloadUrl
tar -xzf $installFile
pip3 install ./tools/cyclecloud_api*.whl

Просмотреть файл

@ -33,9 +33,9 @@ virtualMachineScaleSets = [
fileName = "initialize.sh"
parameters = {
fileSystemMounts = [
"scheduler.artist.studio:/DeadlineRepository /mnt/scheduler nfs defaults 0 0",
"azrender1.blob.core.windows.net:/azrender1/show /mnt/show/write nfs sec=sys,vers=3,proto=tcp,nolock 0 0",
"cache.artist.studio:/mnt/show /mnt/show/read nfs hard,proto=tcp,mountproto=tcp,retry=30,nolock 0 0"
# "scheduler.artist.studio:/DeadlineRepository /mnt/scheduler nfs defaults 0 0",
# "azrender1.blob.core.windows.net:/azrender1/show /mnt/show/write nfs sec=sys,vers=3,proto=tcp,nolock 0 0",
# "cache.artist.studio:/mnt/show /mnt/show/read nfs hard,proto=tcp,mountproto=tcp,retry=30,nolock 0 0"
]
fileSystemPermissions = [
"chmod 777 /mnt/show/write"
@ -83,9 +83,9 @@ virtualMachineScaleSets = [
fileName = "initialize.ps1"
parameters = {
fileSystemMounts = [
"mount -o anon \\\\scheduler.artist.studio\\DeadlineRepository S:",
"mount -o anon nolock \\\\azrender1.blob.core.windows.net\\azrender1\\show W:",
"mount -o anon nolock \\\\cache.artist.studio\\mnt\\show R:"
# "mount -o anon \\\\scheduler.artist.studio\\DeadlineRepository S:",
# "mount -o anon nolock \\\\azrender1.blob.core.windows.net\\azrender1\\show W:",
# "mount -o anon nolock \\\\cache.artist.studio\\mnt\\show R:"
]
fileSystemPermissions = [
"icacls W: /grant Everyone:F"

Просмотреть файл

@ -10,18 +10,20 @@ for ($i = 0; $i -lt 12; $i++) {
Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -AsJob -User System -Force
}
$mountFile = "C:\Windows\Temp\mounts.bat"
New-Item -ItemType File -Path $mountFile
%{ for fsMount in fileSystemMounts }
Add-Content -Path $mountFile -Value "${fsMount}"
%{ endfor }
%{ if length(fileSystemMounts) > 0 }
$mountFile = "C:\Windows\Temp\mounts.bat"
New-Item -ItemType File -Path $mountFile
%{ for fsMount in fileSystemMounts }
Add-Content -Path $mountFile -Value "${fsMount}"
%{ endfor }
$taskName = "AAA Storage Mounts"
$taskAction = New-ScheduledTaskAction -Execute $mountFile
$taskTrigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -AsJob -User System -Force
$taskName = "AAA Storage Mounts"
$taskAction = New-ScheduledTaskAction -Execute $mountFile
$taskTrigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -AsJob -User System -Force
Start-Process -FilePath $mountFile -Wait -RedirectStandardOutput "$mountFile.output.txt" -RedirectStandardError "$mountFile.error.txt"
%{ for fsPermission in fileSystemPermissions }
${fsPermission}
%{ endfor }
Start-Process -FilePath $mountFile -Wait -RedirectStandardOutput "$mountFile.output.txt" -RedirectStandardError "$mountFile.error.txt"
%{ for fsPermission in fileSystemPermissions }
${fsPermission}
%{ endfor }
%{ endif }

Просмотреть файл

@ -23,12 +23,14 @@ echo "[Install]" >> $timerPath
echo "WantedBy=timers.target" >> $timerPath
systemctl --now enable terminate.timer
%{ for fsMount in fileSystemMounts }
fsMountPoint=$(cut -d ' ' -f 2 <<< "${fsMount}")
mkdir -p $fsMountPoint
echo "${fsMount}" >> /etc/fstab
%{ endfor }
mount -a
%{ for fsPermission in fileSystemPermissions }
${fsPermission}
%{ endfor }
%{ if length(fileSystemMounts) > 0 }
%{ for fsMount in fileSystemMounts }
fsMountPoint=$(cut -d ' ' -f 2 <<< "${fsMount}")
mkdir -p $fsMountPoint
echo "${fsMount}" >> /etc/fstab
%{ endfor }
mount -a
%{ for fsPermission in fileSystemPermissions }
${fsPermission}
%{ endfor }
%{ endif }

Просмотреть файл

@ -26,8 +26,8 @@ virtualMachines = [
fileName = "initialize.sh"
parameters = {
fileSystemMounts = [
"scheduler.artist.studio:/DeadlineRepository /mnt/scheduler nfs defaults 0 0",
"azrender1.blob.core.windows.net:/azrender1/show /mnt/show nfs sec=sys,vers=3,proto=tcp,nolock 0 0"
# "scheduler.artist.studio:/DeadlineRepository /mnt/scheduler nfs defaults 0 0",
# "azrender1.blob.core.windows.net:/azrender1/show /mnt/show nfs sec=sys,vers=3,proto=tcp,nolock 0 0"
]
teradiciLicenseKey = ""
}
@ -57,8 +57,8 @@ virtualMachines = [
fileName = "initialize.ps1"
parameters = {
fileSystemMounts = [
"mount -o anon \\\\scheduler.artist.studio\\DeadlineRepository S:",
"mount -o anon nolock \\\\azrender1.blob.core.windows.net\\azrender1\\show W:"
# "mount -o anon \\\\scheduler.artist.studio\\DeadlineRepository S:",
# "mount -o anon nolock \\\\azrender1.blob.core.windows.net\\azrender1\\show W:"
]
teradiciLicenseKey = ""
}

Просмотреть файл

@ -5,15 +5,17 @@ $ErrorActionPreference = "Stop"
Start-Process -FilePath "PowerShell.exe" -ArgumentList "-ExecutionPolicy Unrestricted -File ""$agentFile"" -RegistrationCode ${teradiciLicenseKey}" -Wait -RedirectStandardOutput "$agentFile.output.txt" -RedirectStandardError "$agentFile.error.txt"
%{ endif }
$mountFile = "C:\Windows\Temp\mounts.bat"
New-Item -ItemType File -Path $mountFile
%{ for fsMount in fileSystemMounts }
Add-Content -Path $mountFile -Value "${fsMount}"
%{ endfor }
%{ if length(fileSystemMounts) > 0 }
$mountFile = "C:\Windows\Temp\mounts.bat"
New-Item -ItemType File -Path $mountFile
%{ for fsMount in fileSystemMounts }
Add-Content -Path $mountFile -Value "${fsMount}"
%{ endfor }
$taskName = "AAA Storage Mounts"
$taskAction = New-ScheduledTaskAction -Execute $mountFile
$taskTrigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -AsJob -User System -Force
$taskName = "AAA Storage Mounts"
$taskAction = New-ScheduledTaskAction -Execute $mountFile
$taskTrigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -AsJob -User System -Force
Start-Process -FilePath $mountFile -Wait -RedirectStandardOutput "$mountFile.output.txt" -RedirectStandardError "$mountFile.error.txt"
Start-Process -FilePath $mountFile -Wait -RedirectStandardOutput "$mountFile.output.txt" -RedirectStandardError "$mountFile.error.txt"
%{ endif }

Просмотреть файл

@ -6,9 +6,11 @@ source /etc/profile.d/aaa.sh # https://github.com/Azure/WALinuxAgent/issues/1561
pcoip-register-host --registration-code=${teradiciLicenseKey}
%{ endif }
%{ for fsMount in fileSystemMounts }
fsMountPoint=$(cut -d ' ' -f 2 <<< "${fsMount}")
mkdir -p $fsMountPoint
echo "${fsMount}" >> /etc/fstab
%{ endfor }
mount -a
%{ if length(fileSystemMounts) > 0 }
%{ for fsMount in fileSystemMounts }
fsMountPoint=$(cut -d ' ' -f 2 <<< "${fsMount}")
mkdir -p $fsMountPoint
echo "${fsMount}" >> /etc/fstab
%{ endfor }
mount -a
%{ endif }