Question

Creating an Image (from URL) using Powershell


Badge +1
Hi Everyone,

I am migrating VMs to AHV from XenServer.

The process involves
  • Copy XenServer VM Disks to Nutanix Datashare on XenServer
  • Create DISK_IMAGE from the disks copied on Nutanix DataShare
The manual process is to create an image in Nutanix using URL
nfs://Nutanix Host IP/SR Name/SR UUID/DISK UUID.vhd

I am looking to automate this step using Powershell and Nutanix Cmdlets 'New-NTNXImage'

Please help me on how can I create a image (source: URL) using powershell

So far I have this,

code:
$URL = "nfs://172.21.92.26/Xen_to_AHV_Migration/f63571ed-3fbf-80ba-f851-31767ad753fc/357527a6-e441-46e9-a680-f05f1af831aa.vhd"

New-NTNXImage -Name "xenahvwintst - disk 1" -Annotation "Copied VM xenahvwintst - disk 1" -ImageType DISK_IMAGE -ImageImportSpec $URL


I am not sure on how to include the URL into the command to create NTNXImage

1 reply

Badge +1
The problem is described in detail in the post link given below:
Please see the post:
https://next.nutanix.com/scripts-32/creating-an-image-in-nutanix-using-powershell-error-occurred-while-creating-disk-image-31552

Reply