Skip to content

Commit 3c60bd0

Browse files
committed
fix comments and remove NuGet package
1 parent d3d5dd0 commit 3c60bd0

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

Management-Utilities/ec2-user-data-iscsi-create-and-mount/linux_userData.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LUN_NAME=${VOLUME_NAME}_$(($RANDOM%($max-$min+1)+$min))
2323
# defaults
2424
# The script will create a log file in the ec2-user home directory
2525
LOG_FILE=/home/ec2-user/install.log
26-
TIMEOUT=2
26+
TIMEOUT=5
2727

2828
LUN_SIZE=$(bc -l <<< "0.90*$VOLUME_SIZE" )
2929

@@ -241,6 +241,7 @@ fi
241241

242242
addUndoCommand "curl -m $TIMEOUT -X DELETE -u \"$ONTAP_USER\":\"$FSXN_PASSWORD\" -k \"https://$FSXN_ADMIN_IP/api/protocols/san/lun-maps?lun.name=/vol/${VOLUME_NAME}/${LUN_NAME}&igroup.name=${groupName}&svm.name=${SVM_NAME}\""
243243

244+
# The serial hex in needed for creating readable name for the block device.
244245
getLunSerialNumberResult=$(curl -m $TIMEOUT -X GET -u "$ONTAP_USER":"$FSXN_PASSWORD" -k "https://$FSXN_ADMIN_IP/api/storage/luns?fields=serial_number")
245246
serialNumber=$(echo "${getLunSerialNumberResult}" | jq -r '.records[] | select(.name == "'/vol/$VOLUME_NAME/$LUN_NAME'" ) | .serial_number')
246247
serialHex=$(echo -n "${serialNumber}" | xxd -p)
@@ -249,7 +250,6 @@ if [ -z "$serialHex" ]; then
249250
./uninstall.sh
250251
fi
251252

252-
# The serial hex in needed for creating readable name for the block device.
253253
logMessage "Get the iscsi interface addresses for the svm ${SVM_NAME}"
254254
getInterfacesResult=$(curl -m $TIMEOUT -X GET -u "$ONTAP_USER":"$FSXN_PASSWORD" -k "https://$FSXN_ADMIN_IP/api/network/ip/interfaces?svm.name=$SVM_NAME&fields=ip")
255255
iscsi1IP=$(echo "$getInterfacesResult" | jq -r '.records[] | select(.name == "iscsi_1") | .ip.address')

Management-Utilities/ec2-user-data-iscsi-create-and-mount/windows_userData.ps1

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,12 @@ if(!(Get-Item $path -ErrorAction SilentlyContinue)) {
4242
New-ItemProperty -Path $path -Name $itemName -Value 0 -PropertyType dword
4343
}
4444

45-
$runStep = Get-ItemProperty -Path $path -Name $itemName -ErrorAction SilentlyContinue | Select-Object -ExpandProperty $itemName
4645
Write-Output "Write-Host ""Uninstall FSxn configuration""" >> $uninstallFile
4746
Write-Output "# FSXn uninstall:" >> $uninstallFile
4847

49-
if($runStep -eq 0) {
50-
if (Get-Module | Where-Object {$_.Name -ne 'NuGet'}) {
51-
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
52-
@("Uninstall-PackageProvider -Name NuGet -Force") + (Get-Content $uninstallFile) | Set-Content $uninstallFile
53-
}
54-
Set-ItemProperty -Path $path -Name $itemName -Value 1
55-
}
56-
5748
$runStep = Get-ItemProperty -Path $path -Name $itemName -ErrorAction SilentlyContinue | Select-Object -ExpandProperty $itemName
5849

59-
if($runStep -eq 1) {
50+
if($runStep -eq 0) {
6051

6152
### Install MPIO ####
6253
Write-Output "Installing Multipath-IO windows feature" >> $currentLogPath
@@ -72,7 +63,7 @@ if($runStep -eq 1) {
7263
else {
7364
# restart the instance after installing MPIO
7465
Install-WindowsFeature -name Multipath-IO -Restart
75-
@("Uninstall-PackageProvider -Name Multipath-IO -Force") + (Get-Content $uninstallFile) | Set-Content $uninstallFile
66+
@("Uninstall-WindowsFeature -Name Multipath-IO -Remove -Confirm:$false") + (Get-Content $uninstallFile) | Set-Content $uninstallFile
7667
}
7768

7869
$vol_number = get-random -Minimum 1 -Maximum 10000
@@ -352,7 +343,7 @@ if($runStep -eq 1) {
352343
Write-Host "Failed create new partition, due to: $_" -ForegroundColor Red -ErrorAction stop
353344
break
354345
}
355-
Set-ItemProperty -Path $path -Name $itemName -Value 2
346+
Set-ItemProperty -Path $path -Name $itemName -Value 1
356347
Write-Output "Done creating new FSx disk, drive letter: $drive_letter" >> $currentLogPath
357348
Write-Host "Done creating new FSx disk, drive letter: $drive_letter" -ForegroundColor Green
358349
}

0 commit comments

Comments
 (0)