Sunday, January 27, 2013

Managing a VMware vCenter Server running on a Virtual Machine!!

Just wanted to share a couple of pointers which came up during a vSphere design review process for a customer. This is in reference with VMware vCenter Physical vs. Virtual. I have written about this topic before in one of my posts (VMware vCenter Server - Physical vs. Virtual).

During my discussions there were arguments around tracking of the vCenter Virtual machine in a big environment and getting on to it for troubleshooting in case the vCenter Server service or the VM is down can be a little time consuming.

Therefore, some of the organizations prefer a physical vCenter to have more control and a single point to look at and troubleshoot in case of issues. I would say this has more to do with comfort and mindset of the admin, that the application managing the virtual environment itself is not virtual and isolated from the virtual infrastructure.

I would not say that these points are not valid, since no one would like to search for there vCenter VM in case of vCenter downtimes. If you have not planned the initial placement of the vCenter VM, then you might end up logging on to each ESXi server directly via vSphere Client and search for your vCenter VM. This can be a cumbersome and time consuming process. This might actually affect services such as VMware view or vCloud Director for a longer duration in case of vCenter Downtimes, given that you do not use vCenter Heartbeat in your infrastructure.

There are a couple of things which every vSphere Design with a Virtual vCenter should consider:-

a) Separate Management Cluster - In slightly bigger setups where you might end up having multiple clusters of ESXi servers and multiple different management virtual machines, such as storage management appliances, vCloud director or SRM machines, you should have a separate management cluster of 2 to 3 ESXi servers (size them as per your requirement). Here is where you place for vCenter Server as well. Isolated from your production environment and also easy to track and troubleshoot in case of vCenter server   fails due to any issues.

b) DRS rules for vCenter VM - You may or may not have the liberty of creating a separate management cluster. However, it is absolutely recommended to use DRS rules to control the placement of your vCenter Virtual Machine. 

You should use the DRS rule of "Virtual Machine to Hosts" in order to place the vCenter VM on the FIRST host of the FIRST Cluster in your vCenter. This is possible with the DRS rules and this will ensure that your vCenter server is always running on the same ESXi server and only in case of that ESXi server failing, the VM powers onto the next host in the cluster using vSphere HA. This method will ensure that you have only one ESXi server to look at in case your vCenter Server is acting up and you can trace the VM easily.

This is how you can achieve this:-

1- Right click on the first cluster of your vCenter Server (Assuming vCenter VM is a part of this cluster).
2- Click on Edit Settings.
3- Under DRS > Click Rules > Add.
4- Click the DRS Groups Manager tab.
5- Click Add under Host DRS Groups to create a new Host DRS Group containing the first host of the cluster.
6- Click Add under Virtual Machine DRS Groups to create a Virtual Machine DRS Group for the vCenter VM
7- Click the Rule tab, from the Type drop-down menu, click Virtual Machines to Hosts.
9- Select the Virtual Machine DRS Group which you created in the previous steps and the Host Groups which you created and you are done.

After saving this setting the vCenrer VM will automatically migrate to the host which you selected using vMotion and would stay there, making it easy and simple for you to locate in case of vCenter downtime.

Just for a recap here are the settings:-

DRS Groups Manager
Specification
Virtual Machine Group Name
 <vCenter VM Name>
Virtual Machine Group Member
<vCenter VM>
Host DRS Group Name
<First ESXi Hostname in Cluster>
Host DRS Group Member
<First ESXi Host in Cluster>
Rules
Specification
Name
 <vCenter VM Name> on <ESXi Hostname>
Type
 Virtual Machines to Hosts
Cluster VM Group
<Virtual Machine Group Name>
Rule
Should run on hosts in group
Cluster Host Group
<Host DRS Group Name>



Last but not the least you need to ensure that you keep the Virtual Machine Restart Policy for vCenter Server in case of an HA event, as the highest priority so that the vCenter VM is up as soon as possible.

Note:- Another important factor which I would like to put across at this time is a best practice which I read about in the following book  - "VMware vSphere 5.0 Clustering Technical Deepdive" by Duncan Epping and Frank Denneman. (An awesome and a must read).

Duncan and Frank in there book mentioned a valid point:-

"Although HA is configured by vCenter and exchanges virtual machine state information with HA, vCenter is not involved when HA responds to failure. It is comforting to know that in case of a host failure containing the virtualized vCenter Server, HA takes care of the failure and restarts the vCenter Server on another host, including all other configured virtual machines from that failed host.

There is a corner case scenario with regards to vCenter failure: if the ESXi hosts are so called “stateless hosts” and Distributed vSwitches are used for the management network, virtual machine restarts will not be attempted until vCenter is restarted. For stateless environments, vCenter and Auto Deploy availability is key as the ESXi hosts literally depend on them."

Hence, it is important you ensure that vCenter comes back up on high priority in case of an HA event. This will get the management network going in case of a Distributed vSwitch and Auto Deploy to work... However with vSphere 5.1, you do have an option to boot the ESXi server with a backup copy of ESXi which you can save on the local drive if available on the server.

Hopefully the above illustrations would be good enough for you to go ahead and Virtualize your vCenter and also have control over the application.


7 comments:

  1. Interesting, informative and thought provoking article. With regards to the time spent looking for the vcenter VM , I came across this very helpful article , using PowerCli to locate and power on the vcenter Vm. Handy in emergencies :)

    http://practical-admin.com/blog/?p=923

    ReplyDelete
  2. Thanks @Cragdoo.. The script is definitely useful. However, in situations where in the vCenter has other faults other than a power off state, having an address for the vCenter is a good option.

    Also, though I write articles about scripting, in my opinion scripts create dependencies on the person who created it or edited it... PowerCli nevertheless is a GREAT tool...

    rgds
    Sunny

    ReplyDelete
  3. Great article! - Vmware Student

    ReplyDelete
  4. Its really interesting article and always to keep in mind in production environment for the best practices.

    Thanks
    Bharath

    ReplyDelete
  5. Sunny,

    What are your views in case vCenter Heartbeat is being used ?

    Thanks,
    Rachit.

    ReplyDelete
  6. @vmgeek0 - I like your ALIAS :-)

    vCenter Heartbeat is precisely the solution one needs to look at if you are looking at 99.999% of availability of your vCenter Server.. You have a choice to use it on a Virtual Machine or Physical Server... But I would suggest it should be Virtual... Virtualization is the the way to Go..

    ReplyDelete