VMware Cloud Community
benq201110141
Contributor
Contributor
Jump to solution

how to remove a vm from inventory in vcentre when the host is down

Hi Guys,

we had an outage today where one of our physical ESX Host died (we have 2 hosts in the VM cluster).  HA/DRS unfortunately is not working as there's insufficient resources to automatically migrate the vms on the failed host across to the remaining host (another seperate issue that i wont address here)

when the hsot went down, the vms were left running, but were in a disconnected state (see attached).  i've read that you can reassign vms to the other host by "browse to the datastore and right click on the vmx file and click  Add to inventory and select the host." (ref: http://communities.vmware.com/thread/173314)

however when i did browse to the datastore, the option to "Add to inventory" was also greyed out.  i suspect (please confirm) that it wwas because the Vm in question was still in the 'running' state.  problematic, because in this disconnected/running state, i couldnt shut it down from vcentre gui (or from console, as host was dead)

can someone tell me how -if at all possible- i can migrate the vm to another host, whilst in the above described situation?

if not possible, for future situations where the host is lost, would i then best set the vm's to shut down? (would this enable me to reallocate the vms then?)

cheers

0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

The VM's will remain in the host's inventory and disapear from the vCenter inventory once you remove the host. What you will then do - at least that's what I would probably do - to be able to power on the VMs again is to register the VM's to other hosts on the vCenter Server (right click the VM's .vmx file and select "Add to Inventory") Then - after fixing the host and before re-adding it to vCenter Server - connect to this host directly and remove the already "moved" VM's from its inventory.

What you may need to do after registering VM's to the other hosts is to check VM based backup applications (if used), because the VM's will receive new IDs.

André

View solution in original post

0 Kudos
11 Replies
Mouhamad
Expert
Expert
Jump to solution

You need to disconnect the host from the cluster so the VMs will disappear. Then you can add VMs to the inventory from the Datastore. 

VCP-DCV, VCP-DT, VCAP-DCD, VSP, VTSP
0 Kudos
benq201110141
Contributor
Contributor
Jump to solution

Hi Mouhamah,

yes tried that.  i was able to disconnect the host, but that didnt change the vm state - they were still "disconnected".  i was sure the host was disconnected, because i coudl then go 'right-click' on the host, and the option to 'Connect' was there.  (but given host was down, it obviousy wouldnt connect)

also you can see it in the screen shot that the host has 'disconnected' next to it

comments?

[edit: if it helps we're running (dont laugh) ESX 3.5 and vcentre 2.5)

0 Kudos
SG1234
Enthusiast
Enthusiast
Jump to solution

how about just removing the host ?

Mouhamad
Expert
Expert
Jump to solution

Sorry you also need to remove after the disconnection.

VCP-DCV, VCP-DT, VCAP-DCD, VSP, VTSP
benq201110141
Contributor
Contributor
Jump to solution

thanks guys.  if i remove the host, does that mean i'll need to recreate all the settings assigned to that host when it comes time to readd it? e.g. recreate network adapters, vswitches, storage adapters, dns info...etc. etc.

if so, i presume you'd only want to do this in a disaster scenario, ie the host not being recoverable for a day+ ....as its a hell of a lot of work to recreate.  is there another way?  looking for a quick way to move these 'suspended/disconnected...offline!' vms whilst the server is being restored

cheers

0 Kudos
slackowski
Contributor
Contributor
Jump to solution

You can use Host Profiles. You will be able to create a profile from a Host that you want the configuration from and attach it to the new host.

Removing the host from inventory would preserve all the settings that are already on it. IE, network, DNS, NTP IP.

Hope this helps.

------ Please add score if you found it usefull-------

0 Kudos
benq201110141
Contributor
Contributor
Jump to solution

just to clarfiy, where you say "Removing the host from inventory would preserve all the settings that are already on it", is that dependant on using host profiles? or independant all together.  so even if i dont go and configure a host profile, by removing the host from inventory, i will not lose all those settings network, DNS, NTP, IP etc. ?

so consequently, by "removing from inventory", I assume you imply option 2 (as opt 1 is not available given the host was not manageable):

(excerpt from the vcentre Help Topics: Removing Hosts-)

"

1) Removing a Host from a Cluster

     A host can be removed from a cluster only if all the virtual machines on it are powered off and the host is placed into maintenance mode.

2) Removing a Host from VirtualCenter

     Removing a managed host from VirtualCenter does not remove the virtual machines from the managed host or datastore. It removes only VirtualCenter's access to the managed host and virtual machines on that managed host.  The managed host and its associated virtual machines are removed from the inventory

"

thus, when the host server is available, i just re-add the host with the same name and it should recreate with the same settings as before?  is this because the host settings are all saved on the host itself, rather than vcentre? or have i got it wrong?  just to clarfiy, where are the host settings kept?

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Assuming you are using standard vSwitches (not vDS), all settings are configured per host. You can even remove a host with powered on VM's from a cluster without affecting the VM's.

What I would recommend though, is that you remove the VM's which you are going to add to other hosts from the recreated host's inventory to avoid possible issues when you re-connect the host to vCenter Server.

André

0 Kudos
benq201110141
Contributor
Contributor
Jump to solution

yes standard vswitches.  great! thanks for the confirmation (and reassurance)

regarding your recommendation, and i apologies for all these bit-part questions as i've not done this in practise before, but when i remove a host from inventory, I assume that the host (and it's associated vms) are no longer visible in vcentre.  so how do i then go about "removing the vms from the recreated host before re-connecting to vcentre" ?

ie if i understand you correctly, once i remove the host(host1) from vcentre, do the vms 'become available' to reassign to the remaining online host(host2)  server?

when we are ready to re-connect the host1, i need to ensure that before doing so i  disconnect/disassociate the vms on host2 that were originally assigned to host1.

- then, re-connect host1.  then reassign vms back to host1

correct?

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

The VM's will remain in the host's inventory and disapear from the vCenter inventory once you remove the host. What you will then do - at least that's what I would probably do - to be able to power on the VMs again is to register the VM's to other hosts on the vCenter Server (right click the VM's .vmx file and select "Add to Inventory") Then - after fixing the host and before re-adding it to vCenter Server - connect to this host directly and remove the already "moved" VM's from its inventory.

What you may need to do after registering VM's to the other hosts is to check VM based backup applications (if used), because the VM's will receive new IDs.

André

0 Kudos
benq201110141
Contributor
Contributor
Jump to solution

Perfect!

thank you very much

0 Kudos