User Tools

Site Tools


user:kkrauss1:portfolio:vmcreate

Virtual Machine Creation

Following your set up of a VM Server, log into the VM server as root using ssh and the root password you created at set-up.

Preparation

VM Server check

Once you have access to the VM Server:

  • Check the number of running virtual machines using the 'xm list' command.
  • If there are more than 4 virtual machines running, use a different VM Server. (the number of VM's allowed will change depending on the resources of the server. The server I already created has 756 megs of ram, 256 is needed by the server and 128 for each vm, so 4 is max.)

VM Resource management

Now go to a separate web-browser window to choose your virtual machine hostname.

  • Look at the chart located under “VM Server User Lists” on the HPC Fundamentals Notes page.
    • Claim an open VM by editing the table.
      • Enter the name of the VM server you are using in the second column of the table for the appropriate virtual machine.
      • Enter your name in the last column of the appropriate virtual machine.
      • Note the MAC addresses of the virtual machine you've claimed on the chart (You will use it shortly.)
      • For my setup I am using virtual server 5 and claimed virtual machines 19-22

Creation

Returning to the terminal window, which is logged into the VM Serrver you're going to use.

  • While inserting the hostname and MAC address noted from the chart on HPC Fundamentals Notes page.
    • Use the command 'xen-create-image –hostname=vm## –mac=##:##:##:##:##:## –role=udev'
      • For example, vm19's command would be 'xen-create-image –hostname=vm19 –mac=00:16:3E:2E:C0:13 –role=udev'
        • The number in the hostname is in decimal.
        • The number in the MAC address is in Hexidecimal.
    • If you have no errors in /etc/xen/xend-config.sxp or /etc/xen-tools/xen-tools.conf it should proceed.
      • If you get any errors due to typo's make sure when you fix them that you add –force to save yourself some problems. If no typos are made and you still have errors then there is actually an issue with your server setup.
    • If everything goes according to plan you have actually create some files, images to be more exact. You have a 2 gigabyte image that has a fresh copy of squeeze on it, and a swap partition image of 128 megs.

Booting your Virtual Machine

If your Virtual Machine was created successfully you can now 'boot' it. When you are ready to boot your virtual machine use the following command:

root@vmserver##:~# xm create -c /xen/conf/vm##.cfg
  • Where ## is the number of the virtual machine you created in the creation section.
  • the -c connects to the console, in the future you wont do that too often, but for initial setup or any issues you will wish to connect.
    • To boot the vm without connecting to the console use the following command:
root@vmserver##:~# xm create /xen/conf/vm##.cfg
  • When the virtual machine has finished booting you can detach from the virtual machine, returning to the VMServer prompt, using the <Ctrl>+<]> command.

Accessing Your Virtual Machine

You can now access your virtual machine from lab46 using SSH without having to connect to the VM server first.

Managing your virtual machine can be done utilizing the XM tool on the VMServer you created the virtual machine on.

  • The command 'xm help' will show you a list of actions you can take.

Resources

  • Thanks to Brian Ewaynk and Matt Haas, without them this would have taken me much longer.
user/kkrauss1/portfolio/vmcreate.txt · Last modified: 2012/03/15 12:28 by kkrauss1