Scripts

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

Automate Acropolis conversion

SOLVED Go to solution
Wayfarer

Automate Acropolis conversion

Hello,

We are in the process of a large scale migration of VMWare VMs to Acropolis. I have found several scripts to automate the creation of VMs in Acropolis, but all of them rely on the 'New-NTNXObject' cmdlet in Powershell for the purpose of making a VmDiskSpecCreationDTO object.

However even with the latest version of 'NutanixCmdletsPSSnapin' I do not see a New-NTNXObject cmdlet (Powershell returns an error, also is not in the Powershell cmdlet reference).

For example from This Script in the Nutanix github repo a VMDisk is cloned from NFS file (what we want to do) with this block of code:

 

diskCloneSpec = New-NTNXObject -Name VMDiskSpecCloneDTO
				$diskCloneSpec.imagePath = $formattedPath
$vmDisk = New-NTNXObject -Name VMDiskDTO
				$vmDisk.vmDiskClone = $diskCloneSpec
				
				Write-Host "Adding Disk: $formattedPath to VM: $($l_acropVM.vmName)..."
				Add-NTNXVMDisk -Vmid $l_acropVM.vmid -Disks $vmDisk

The Acropolis Powershell Reference for VMDisk also implies that cloning from a NFS file is possible via Powershell..

 ...If the disk image is cloned from an existing vmdisk or NFS file...

Is it possible for me to create a VMDisk on an Acropolis VM cloning from a NFS file via Powershell? It seems like this should be possible but an essential part is unavailable to me.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator Moderator
Moderator

Re: Automate Acropolis conversion

initial word from engineering is that that command is making its way out in the 4.6 PS plugin, which will be out shortly with the release of 4.6.

 

In the interim, you CAN post directly to the mgmt REST api with invoke-restmethod and a JSON, which will help work around the issue for now

 

Either way, flick us a support ticket so we can track it.

Jon Kohler | Principal Architect, Nutanix | Nutanix NPX #003, VCDX #116 | @JonKohler
Please Kudos if useful!
4 REPLIES
Moderator Moderator
Moderator

Re: Automate Acropolis conversion

I pinged the engineering team for the PoSh plugin, will get you an answer post-haste.

 

Also, don't be afraid to open a support ticket, so we can get some formal tracking of the friction you are having with this. Helps us make the product better.

Jon Kohler | Principal Architect, Nutanix | Nutanix NPX #003, VCDX #116 | @JonKohler
Please Kudos if useful!
Moderator Moderator
Moderator

Re: Automate Acropolis conversion

initial word from engineering is that that command is making its way out in the 4.6 PS plugin, which will be out shortly with the release of 4.6.

 

In the interim, you CAN post directly to the mgmt REST api with invoke-restmethod and a JSON, which will help work around the issue for now

 

Either way, flick us a support ticket so we can track it.

Jon Kohler | Principal Architect, Nutanix | Nutanix NPX #003, VCDX #116 | @JonKohler
Please Kudos if useful!
Wayfarer

Re: Automate Acropolis conversion

Thank you for checking into this!

Wayfarer

Re: Automate Acropolis conversion

Hi

 

How did you end up doing it? i'm trying to write my own powershell script but i cannot figure out how to convert from ADSF in powershell.

Every time I try using the code you provided i get the error "At least one of hte image path of VM Disk UUID are required".

 

Thanks

 

ALex