blob: f2656a09e5d8ed48708a7ba4a3349f5c29659b1b [file] [log] [blame]
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<!-- Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<section id="best-practices-vm">
<title>Best Practices for Virtual Machines</title>
<para>For VMs to work as expected and provide excellent service, follow these guidelines.</para>
<section id="best-practices-vm-monitoring">
<title>Monitor VMs for Max Capacity</title>
<para>The &PRODUCT; 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 &PRODUCT; 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 &PRODUCT; UI to disable allocation of more VMs to the
cluster.</para>
</section>
<section id="best-practices-vm-tools">
<title>Install Required Tools and Drivers</title>
<para>Be sure the following are installed on each VM:</para>
<itemizedlist>
<listitem><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.</para></listitem>
<listitem><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.</para></listitem>
</itemizedlist>
<para>To be sure that Xen tools or VMware Tools is installed, use one of the following techniques:</para>
<itemizedlist>
<listitem><para>Create each VM from a template that already has the tools installed; or,</para></listitem>
<listitem><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,</para></listitem>
<listitem><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 &PRODUCT; using the updateVirtualMachine API.
After installing the tools and updating the virtual machine, stop
and start the VM.</para></listitem>
</itemizedlist>
</section>
</section>