<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>10.2. Best Practices for Virtual Machines</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Admin_Guide-4.2.0-en-US-1-" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.2.0');
              
              addID('Apache_CloudStack.4.2.0.books');
	      addID('Apache_CloudStack.4.2.0.Admin_Guide');
              </script><link rel="home" href="index.html" title="CloudStack Administrator's Guide" /><link rel="up" href="virtual-machines.html" title="Chapter 10. Working With Virtual Machines" /><link rel="prev" href="about-working-with-vms.html" title="10.1. About Working with Virtual Machines" /><link rel="next" href="vm-lifecycle.html" title="10.3. VM Lifecycle" /></head><body class="toc_embeded "><div id="tocdiv" class="toc"><iframe id="tocframe" class="toc" src="../../../../toc.html">This is an iframe, to view it upgrade your browser or enable iframe display.</iframe></div><p id="title"><a class="left" href="http://cloudstack.apache.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://cloudstack.apache.org/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="about-working-with-vms.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="vm-lifecycle.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" id="best-practices-vm" lang="en-US"><div class="titlepage"><div><div><h2 class="title">10.2. Best Practices for Virtual Machines</h2></div></div></div><div class="para">
		For VMs to work as expected and provide excellent service, follow these guidelines.
	</div><div class="section" id="best-practices-vm-monitoring"><div class="titlepage"><div><div><h3 class="title">10.2.1. Monitor VMs for Max Capacity</h3></div></div></div><div class="para">
			The CloudStack administrator should monitor the total number of VM instances in each cluster, and disable allocation to the cluster if the total is approaching the maximum that the hypervisor can handle. Be sure to leave a safety margin to allow for the possibility of one or more hosts failing, which would increase the VM load on the other hosts as the VMs are automatically redeployed. Consult the documentation for your chosen hypervisor to find the maximum permitted number of VMs per host, then use CloudStack global configuration settings to set this as the default limit. Monitor the VM activity in each cluster at all times. Keep the total number of VMs below a safe level that allows for the occasional host failure. For example, if there are N hosts in the cluster, and you want to allow for one host in the cluster to be down at any given time, the total number of VM instances you can permit in the cluster is at most (N-1) * (per-host-limit). Once a cluster reaches this number of VMs, use the CloudStack UI to disable allocation of more VMs to the cluster.
		</div></div><div class="section" id="best-practices-vm-tools"><div class="titlepage"><div><div><h3 class="title">10.2.2. Install Required Tools and Drivers</h3></div></div></div><div class="para">
			Be sure the following are installed on each VM:
		</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
					For XenServer, install PV drivers and Xen tools on each VM. This will enable live migration and clean guest shutdown. Xen tools are required in order for dynamic CPU and RAM scaling to work.
				</div></li><li class="listitem"><div class="para">
					For vSphere, install VMware Tools on each VM. This will enable console view to work properly. VMware Tools are required in order for dynamic CPU and RAM scaling to work.
				</div></li></ul></div><div class="para">
			To be sure that Xen tools or VMware Tools is installed, use one of the following techniques:
		</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
					Create each VM from a template that already has the tools installed; or,
				</div></li><li class="listitem"><div class="para">
					When registering a new template, the administrator or user can indicate whether tools are installed on the template. This can be done through the UI or using the updateTemplate API; or,
				</div></li><li class="listitem"><div class="para">
					If a user deploys a virtual machine with a template that does not have Xen tools or VMware Tools, and later installs the tools on the VM, then the user can inform CloudStack using the updateVirtualMachine API. After installing the tools and updating the virtual machine, stop and start the VM.
				</div></li></ul></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="about-working-with-vms.html"><strong>Prev</strong>10.1. About Working with Virtual Machines</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="vm-lifecycle.html"><strong>Next</strong>10.3. VM Lifecycle</a></li></ul></body></html>
