{"revision": {"id": "f1dffe80-2f95-11f1-bea3-e86a64d24d78", "node_id": "f1df5bd8-2f95-11f1-9651-e86a64d24d78", "user_id": "edc3f576-2f95-11f1-900f-e86a64d24d78", "author": "foxhop", "data": "KVM guest management\r\n=======================\r\n\r\n.. contents:: \r\n\r\n\r\nThis document talks about a guest named *mbison*. Change this name to better suit your purpose. \r\n\r\n\r\n\r\n\r\n\r\nKVM virsh cheat sheet!\r\n============================\r\n\r\nThis is a list of commands to use in the virsh cli.\r\n\r\nTo start the virsh cli run the following cmd:\r\n\r\n .. code-block:: bash\r\n  \r\n  $ virsh\r\n\r\nor:\r\n\r\n .. code-block:: bash\r\n\r\n  virsh --connect qemu:///system\r\n\r\nList all guests\r\n----------------\r\n \r\nList all guests:: \r\n \r\n virsh # list --all\r\n\r\n\r\n\r\nStart a guest\r\n------------------\r\n\r\nStart a guest::  \r\n\r\n virsh # start mbison\r\n\r\nFlag a guest for autostart on host reboot\r\n--------------------------------------------\r\n\r\nFlag a guest for autostart on host reboot::  \r\n\r\n virsh # autostart mbison\r\n\r\nEdit a guests configuration file\r\n-----------------------------------\r\n\r\nEdit a guests configuration file::  \r\n\r\n virsh # edit mbison\r\n\r\nShutdown a guest\r\n---------------------\r\nShutdown a guest gracefully::\r\n \r\n virsh # shutdown mbison\r\n\r\nThis doesn't always work.  \r\n\r\nBe sure the guests XML file has the following entry:\r\n\r\n .. code-block:: xml\r\n\r\n  <feature>\r\n\r\n     <acpi/>\r\n\r\n  </feature>\r\n\r\nAlso make sure the apci is installed on the guest operating system.\r\n\r\nOn debian / ubuntu run:\r\n \r\n .. code-block:: bash\r\n\r\n  $ sudo apt-get install acpid\r\n\r\n\r\nPull the power on a guest\r\n----------------------------\r\n\r\nPull the power on a guest::  \r\n\r\n virsh # destroy mbison\r\n\r\nQuit virsh cli\r\n-----------------\r\n\r\nQuit virsh cli::  \r\n\r\n virsh # quit\r\n\r\n\r\n\r\nInstall packages \r\n---------------------------------------------- \r\n\r\nRedhat or Fedora \r\n  yum install kvm \r\n  yum install virt-manager libvirt libvirt-python python-virtinst \r\n  chkconfig libvirtd on \r\n  service libvirtd start\r\n\r\nNote\r\n------\r\nTypically the guests harddrive is not attached, you must add it in the configuration.\r\n\r\nTypically the guests memory is set to 100mbs, you might want to change that in the configuration.\r\n\r\nOnce booted and ssh'd into the VM, cat /etc/network/interfaces to verify that the DNS settings are correct.\r\n\r\nDebian/ubuntu guest don't have acpid installed by default. (Could change the vmbuilder string)\r\n", "source_format": "rst", "revision_number": 2, "created": 1288115400000}}