VMware Cloud Community
rp123
Contributor
Contributor

how to move-VM a VM which is in power off state

I want to migrate a VM which is poweroff state to another datastore. i tried using move-vm, but it is giving error sating , "operation is not valid due to the cirrent state of the object". can someone provide solution how do i move VM between datastore when VM is in poweroff state. 

Reply
0 Kudos
12 Replies
LucD
Leadership
Leadership

Can you provide some more details?
Which PowerShell version, which PowerCLI version, which vSphere version?


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

Reply
0 Kudos
rp123
Contributor
Contributor

@LucD am using 12.4 version of powerCLI and vsphere version is 8.0 

Reply
0 Kudos
LucD
Leadership
Leadership

And are you using PSv5.* or PSv7.*?


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

Reply
0 Kudos
LucD
Leadership
Leadership

And can you show the actual command you used, and the full error message you are getting?
A screenshot is fine


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

Reply
0 Kudos
rp123
Contributor
Contributor

rp123_0-1671709690475.png

 

Reply
0 Kudos
rp123
Contributor
Contributor

attached screenshot of the error. 

Reply
0 Kudos
LucD
Leadership
Leadership

What does the following return?

Get-VM -Name 3-VM


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

Reply
0 Kudos
rp123
Contributor
Contributor

3-VM PoweredOff 24 8.000

Reply
0 Kudos
LucD
Leadership
Leadership

Did you already stop/start your PS/PowerCLI session in between?


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

Reply
0 Kudos
rp123
Contributor
Contributor

No i just tried move-VM command it failed with attached screenshot error. just to check, do we allow move-VM in poweroff state to different datastore?

Reply
0 Kudos
LucD
Leadership
Leadership

Yes, that should work.

Can you try stopping/starting your PS/PowerCLI session?
Sometimes there are some glitches in the PS session.


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

rp123
Contributor
Contributor

@LucD thanks it worked. i closed session and retried in new session. it worked am able to migrate a poweroff VM. thanks alot for your inputs. 

Reply
0 Kudos