PowerCLI

 View Only
  • 1.  Move-VM leaves old datastore linked with VM

    Posted Sep 07, 2011 07:50 AM

    Hi,

    I did svMotion with Move-VM to several hundred VMs, the data folders did move to the new

    datastore, but to my surprise, the old datastore is still linked with the VM,

    e.g Get-Datastore -VM "MyVM" is listing two datastores for the VM, the old one and the new one.

    the actual files exist only in the new datastore, so it's more like a cosmetic problem,

    but I wonder what have I done wrong and how do I fix it?

    Thanks,

    BalckBeret



  • 2.  RE: Move-VM leaves old datastore linked with VM

    Posted Sep 07, 2011 08:40 AM

    Could you perhaps show us the code you used for the svMotion ?

    What is left on the "old" datastore ? Is there still a folder with the name of the VM ? Any files in there ?

    Could it be that you configured your swap files to a specific datastore and not to the VM folder ?



  • 3.  RE: Move-VM leaves old datastore linked with VM

    Posted Sep 07, 2011 09:08 AM

    Hi LucD,

    1. The relevant line is: $vm | Move-VM -Datastore $destination_ds_name -ErrorAction Stop

    2. Basically, as far as I can see, nothing is left on the old DS

    3. The swap files are located in the VM folder

    Thanks



  • 4.  RE: Move-VM leaves old datastore linked with VM

    Posted Sep 07, 2011 10:18 AM

    Ok, does the vSphere Client also show the "old" datastore for these VMs ?

    If not, try a Disconnect-VIServer/Connect-VIServer, followed by a Get-VM.

    Do you then still see the old datastore ?

    You can also check one of the .vmx files (download it to a local disk) and check if there are entries with the old datastore in there.



  • 5.  RE: Move-VM leaves old datastore linked with VM

    Posted Sep 07, 2011 11:25 AM

    1. Yes, it's listing both the old and new datastore

    2. I did Disconnect-VIServer/Connect-VIServer + Get-VM,

    and the DatastoreIdList attribute is listing to datastores:

    DatastoreIdList         : {Datastore-datastore-39, Datastore-datastore-1861}

    3. I can't see anything related to datastore sttings in the vmx file..

    BTW, if I'm doing svMotion via vsphere client it works flawlessly.



  • 6.  RE: Move-VM leaves old datastore linked with VM

    Posted Apr 11, 2013 04:31 AM

    I'm having the same issue.

    Anyone managed to resolve it?



  • 7.  RE: Move-VM leaves old datastore linked with VM

    Posted Apr 11, 2013 08:16 AM

    Do you also see the difference in behaviour when you do the svMotion via the vSOhere Client or via the PowerCLI Move-VM cmdlet ?



  • 8.  RE: Move-VM leaves old datastore linked with VM

    Posted Jul 12, 2024 01:02 PM
    Edited by LucD Jul 12, 2024 05:05 PM

    Nevermind.