Question New-NTNXImage

  • 22 September 2021
  • 0 replies

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://$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 and the cloning of a disk took no more than 10 seconds. After upgrading to 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!