VMware Cloud Community
InflxxEC
Contributor
Contributor

Remove VM from ESXi via vMA

I have a VM that I can not delete or remove from inventory in my ESXi environment. I have never used vMA and am trying to do it under the guidance of numerous google searches. But I cant seem to find the right solution.

I have logged into my vMA appliance but can't really figure out what to do from here.

Anyone feel like giving me some help on this?

Thanks.

0 Kudos
7 Replies
lamw
Community Manager
Community Manager

Is there a specific error you're receiving when trying to delete the VM? afaik, there are not utilities by default found in vMA to delete a VM on an ESX(i) host?

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware VCP3,4

VMware VCAP4-DCA

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
InflxxEC
Contributor
Contributor

It says "In Progress" for a minute then get an error stating Another task is already in progress. I will attach the error.

Thanks.

0 Kudos
InflxxEC
Contributor
Contributor

So i deleted the files in the datastore and tried to Remove from Inventory and get this attached message.

0 Kudos
lamw
Community Manager
Community Manager

I think you're confusing vMA with the vSphere Client which is a graphical windows client to manage your ESX(i) or vCenter system. vMA is a VMware virtual appliance.

Any who, did you delete the files manually using the datastore browser before unregistering the VM? To properly delete a VM, you need to shut it down, then right click and click deleted from disk. If you manually delete files or go out of order, you may hit an issue in which you may need to manually clean it up. You always have the option of just clicking, remove from inventory and this will unregister the VM from the host. Then you can manually clean up but again it's not recommended that you manually perform this work.

Also, if another task is in progress ..but running the same task, it won't help other than throw the message Smiley Happy

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware VCP3,4

VMware VCAP4-DCA

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
InflxxEC
Contributor
Contributor

This is ESXi so yes I have been using the VI client but have run into those errors. From my searches I have found that there are CLI commands that can unregister/remove a VM. So since I am using ESXi and there is no Service Console I am guessing I need to use vMA to run these commands which I have never used and cant really figure out. So that is where I am looking for help.

Unless you know of an easier or better way to do this. I tried to do the delete from disk and remove from inventory through the client first and got those errors. Then i even restarted the vCenter service and tried and still no luck. Then i went into the datastore and manually deleted the files and still get same issues.

So i am guessing my only option is to do it via CLI?

0 Kudos
lamw
Community Manager
Community Manager

Yes, you can use the vCLI to register and unregister ... but not delete.

The issue probably could have been mitigated by not attempting to many changes. By deleting, you will automatically get it removed from the inventory.

As of right now, when you login to the vSphere Client, do you see the VM in the inventory? Is it grayed out or just gone? If so, it's not being registered to the host. You now just need to do some clean up in the datastore which you can use the datastore browser.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware VCP3,4

VMware VCAP4-DCA

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
InflxxEC
Contributor
Contributor

I figured it out. I just had to restart the management agents on the ESXi console.

0 Kudos