File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
demos-sdk2/VMFS-VMDK Snapshot Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,6 @@ $VMESXiHost = Get-VMhost -VM $TargetSQLServerVM
106106
107107
108108
109-
110- # Get discrete hosts connected to the ESXi cluster
111- $Hosts = Get-Cluster $ClusterName | Get-VMHost | where-object { ($_.ConnectionState -eq ' Connected' ) }
112-
113-
114-
115109# Connect to the target array, authenticate. Remember disclaimer at the top!
116110$FlashArray = Connect-Pfa2Array - Endpoint $TargetArrayName - Credential ($Credential ) - IgnoreCertificateError
117111
@@ -158,7 +152,7 @@ Get-VMHostStorage -RescanAllHba -RescanVmfs -VMHost $VMESXiHost
158152
159153
160154# Connect to EsxCli
161- $esxcli = Get-EsxCli - VMHost $Hosts [ 0 ]
155+ $esxcli = Get-EsxCli - VMHost $VMESXiHost
162156
163157
164158
@@ -186,7 +180,7 @@ while ($clonedDatastore -eq $null) {
186180 Start-Sleep - Seconds 5
187181 $clonedDatastore = (Get-Datastore | Where-Object { $_.name -match ' snap' -and $_.name -match $SourceDatastoreName })
188182}
189- # $clonedDatastore
183+ $clonedDatastore
190184
191185
192186
@@ -268,7 +262,7 @@ Foreach ($SourceVMDKPath in $SourceVMDKPaths) {
268262
269263
270264# Guest hard disk removed, now remove the stale datastore - this can take a min or two
271- Remove-Datastore - Datastore $clonedDatastore - VMHost $Hosts [ 0 ] - Confirm:$false
265+ Remove-Datastore - Datastore $clonedDatastore - VMHost $VMESXiHost - Confirm:$false
272266
273267
274268
@@ -284,3 +278,4 @@ Remove-Pfa2Volume -Array $FlashArray -Name $NewClonedVolumeName
284278
285279# Clean up
286280Remove-PSSession $TargetVMSession
281+
You can’t perform that action at this time.
0 commit comments