Wednesday, January 14, 2009

Poor Man's Failover on ESXi servers

HA can't do without VI license, but manual failover you can.
If you are running production, you still might want to get support for ESXi.

What you would need:
1. 2 ESXi servers running identical CPUs and have Shared Storage (FC or iSCSI).
2. Virtual Infrastructure Client(VIC)(Free included w/ Free ESXi).
3. Remote CLI installed on any other server or your desktop. Although, all the steps could be performed by VIC as well.


Steps to do the manual failover:
For documentation, I would use "testVM" as my VM guest running RHEL and 2 ESXi servers are serverA and serverB.
1. Install testVM on serverA. You would use VIC for this.
2. register the machine with other host, in this case, serverB. I prefer using remote CLI. Following command is needed:
C:\Program Files\VMware\VMware VI Remote CLI\bin>vmware-cmd.pl --server serverA --username administrator -s register "[SharedStorage] testVM/testVM.vmx" ha-datacenter Resources
Enter password:
register() =1
Here ha-datacenter is the datacenter name and Resources is the resource pool. You can specify your own resource pool name if desired.

Other way of accomplishing the same thing is by going to configuration of serverB from VIC. Go to storage, click on shared storage disk, right click and browse. Then browse to testVM, and right click on .vmx file and click "Add to Inventory".

2. using VIC shutdown testVM on serverA, poweron testVM serverB and choose always keep on the serverB when testVM is powering up.

3. now you can go back and forth easily between two hosts using VIC or remote CLI.
For remote CLI:

C:\Program Files\VMware\VMware VI Remote CLI\bin>vmware-cmd.pl --server serverA --u
sername administrator "[SharedStorage] testVM/testVM.vmx" stop
Enter password:
stop() = 1
C:\Program Files\VMware\VMware VI Remote CLI\bin>vmware-cmd.pl --server serverB --u
sername administrator "[SharedStorage] testVM/testVM.vmx" start
Enter password:
start() = 1

No comments: