Automation

 View Only
  • 1.  Remove-vm leaving orphans

    Posted Nov 24, 2010 09:39 AM

    Hi,

    I am sure there is a simple answer to this but I can't find it anywhere.

    When I try to remove a VM I get an orphaned entry in the inventory. The command I'm using is

    get-vm "www" | Remove-VM -Confirm:$false -deletefromdisk:$True

    Is there a simple way to remove the VM from the inventory and delete the data from the disks at the same time?

    Cheers,

    Fastpud



  • 2.  RE: Remove-vm leaving orphans
    Best Answer

    Posted Nov 24, 2010 09:46 AM

    The command you are using is correct.

    Are you connected to an ESX(i) server or to a vCenter ?

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 3.  RE: Remove-vm leaving orphans

    Posted Nov 24, 2010 09:49 AM

    Hi LucD,

    I am connecting to the ESXi 4.1 host. Would it be better to connect the vCenter Server?

    Cheers,

    Shay



  • 4.  RE: Remove-vm leaving orphans

    Posted Nov 24, 2010 09:51 AM

    Yes, when you remove the guest while connected to an ESX(i) server, the vCenter isn't aware that the guest is removed.

    Hence the orphaned entry in the vCenter.

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 5.  RE: Remove-vm leaving orphans

    Posted Nov 24, 2010 09:55 AM

    Hi LucD,

    That solved it, Thanks for you help.

    Cheers,

    Fastpud