VMware Cloud Community
hpfeiler
Contributor
Contributor

vShpere API - Move_VM

Hi all


I'm on vSphere 5.0 and would like to move a Virtual Machine from a normal datastore to a Storage DRS Cluster via API.
This procedure is working fine via the vSphere Client, but I was not able to perform the same via API.
I'm using the "move_vm" operation. When I take a look into the documentation for vSphere 5.0 (http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fright-pane.htm... -> move_vm) I do not see any information related to datastore clusters.
When I now take a look into the 5.1 documentation (http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fright-pane.html -> move_vm) the Storage DRS Cluster is mentioned and there are examples available.
Could anyone tell me if the vSphere 5.0 API supports the move of a VM from a normal datastore to a Storage DRS cluster?
Many thanks in advance!
Helmut
Tags (3)
0 Kudos
5 Replies
LucD
Leadership
Leadership

Are you referring to the Move-VM cmdlet ?

If yes, there you can use a datastorecluster on the Datastore parameter.

If not, to which method from the SDK are you actually referring ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
hpfeiler
Contributor
Contributor

Hi

Sorry for the delayed answer!

I'm using the PowerCLI and I'm using the following command:

-> move-vm -VM VM_Name -Datastore DRS_Cluster_Name   (the name of the storage DRS cluster is DRS_Cluster in my case)

When I use this command, I get the following error message.

VM_PowerCLI.jpg

When I use "move-vm -VM VM_Name -Datastore Datastore_Name" instead (so a normal datastore and not the storage cluster) the move-vm action is working fine. The VM is then moved from one datastore to another.

I'm on vSphere 5.0.0.

Can anyone tell me what is wrong in my command and how I can move the VM from a normal datastore to a storage DRS cluster?

Many thanks

Helmut

0 Kudos
LucD
Leadership
Leadership

It looks like your PowerCLI version might be a bit old.

The ability to use datastoreclusters has been added recently.

Check your PowerCLI version with

Get-PowerCLIVersion


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
hpfeiler
Contributor
Contributor

I have installed

VMware vSphere PowerCLI 5.0 build 435427

VMware AutoDeploy PowerCLI 5.0 build 575

VMware ImageBuilder PowerCLI 5.0 build 575

VMware License PowerCLI 5.0 build 395016

VMware vSphere PowerCLI 5.0 build 435427

Is it possible to just install a newer version of PowerCLI?

Can I install also PowerCLI 5.1.x or do I have to install the latest 5.0.x PowerCLI version?

Many thanks

Helmut

0 Kudos
LucD
Leadership
Leadership

vSphere 5.0 Update 1 is supported by PowerCLI 5.1, see the Release Notes.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos