5.20.1.1 New-NTNXImage | Nutanix Community
Skip to main content
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.

Be the first to reply!

Reply