PowerCLI

 View Only
  • 1.  how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 10:40 AM

    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. 



  • 2.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 10:57 AM

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



  • 3.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 11:22 AM

     am using 12.4 version of powerCLI and vsphere version is 8.0 



  • 4.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 11:31 AM

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



  • 5.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 11:33 AM

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



  • 6.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 11:49 AM

    rp123_0-1671709690475.png

     



  • 7.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 11:50 AM

    attached screenshot of the error. 



  • 8.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 11:57 AM

    What does the following return?

    Get-VM -Name 3-VM


  • 9.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 12:06 PM

    3-VM PoweredOff 24 8.000



  • 10.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 12:11 PM

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



  • 11.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 12:14 PM

    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?



  • 12.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 12:29 PM

    Yes, that should work.

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



  • 13.  RE: how to move-VM a VM which is in power off state

    Posted Dec 22, 2022 12:46 PM

     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.