Question

5.20.1.1 New-NTNXImage

  • 22 September 2021
  • 0 replies
  • 24 views

Userlevel 1
Badge +1
Connect-NTNXCluster -Server prismserver -UserName (Get-StoredCredential -Target NTNX).UserName -Password (Get-StoredCredential -Target NTNX).Password -ForcedConnection | Format-Table -Property name,version | Out-Null
$imagecreatespec = New-NTNXObject -Name ImageImportSpecDTO
$containerID = (Get-NTNXContainer -SearchString "StorageContainer").Id
$imagecreatespec.containerId = $containerID.Substring($containerID.IndexOf(":")+2)
$diskId = (Get-NTNXVMDisk -Vmid (Get-ntnxvm -SearchString $VMName).vmId -BusType scsi).vmDiskUuid
$imagecreatespec.url = "nfs://127.0.0.1/StorageContainer/.acropolis/vmdisk/$diskId"

$date = (Get-Date -Format yyyyMMdd)
New-NTNXImage -Name "$OperatingSystem-$date-$ImageType" -Annotation $ImageAnnotation -ImageType DISK_IMAGE -ImageImportSpec $imagecreatespec

I have been using the above script while I was on AOS 5.15.1.1 and the cloning of a disk took no more than 10 seconds. After upgrading to 5.20.1.1 this process now takes 10mins. Any reason this would have changed between versions? Did the specDTO’s change? Thanks.


0 replies

Be the first to reply!

Reply