Empty Systems

Introduction to Empty Systems
-------------------------

Cloudmin uses the term "empty system" to refer to one that is created without any operating system initially installed on its virtual disk. Empty systems are always connected to a CD image or physical CD-ROM drive, from which any operating system can be installed. Once the install is complete, the formerly empty system can be managed like any other Cloudmin virtual machine.

The open-source Xen, KVM and Citrix Xen virtualization types all support the creation of systems that are initially empty. In the case of Xen, full hardware virtualization (HVM) is used, which has a performance overhead as compared to para-virtualization. However, HVM allows any operating system to be run inside the virtual system, such as OpenBSD, Windows or other Linux distributions.

Cloudmin will not be able to fully manage non-Linux virtual systems though, as it cannot access files inside their filesystems. This prevents Cloudmin from editing network interfaces unless the system is up and running Webmin, and from fully managing virtual disks.

Creating CD Images
----------------

Before creating an empty system, you should add the CD image that you plan to install it from to Cloudmin's system images list. This can be done as follows :

1. Login as `root` and go to *Cloudmin Settings* -> *Import System Image*.
2. Select the correct virtualization type, and choose *An existing disk image file on one of your systems*, then click *Continue*.
3. In the *Image file format* field, select *CD or DVD ISO*.
4. In the *Image source* field, enter the path or URL to the `.iso` file for the CD image.
5. Enter a short name for the image in the *Unique ID for image* field, like `xen-debian5-cd`.
6. Enter a longer description in the *Description for image* field.
7. Change *Compress image file* to *No*.
8. Click the *Create* button.

Depending on where the image file has to be fetched from and whether it is initially compressed or not, the creation process may take from seconds to minutes. Once it is complete, you should see it appear on the *New System Images* page.

Setting up DHCP
-------------------------

When Cloudmin creates an empty virtual system, the IP address that it selects for that system cannot actually be inserted into the appropriate configuration files until after the OS install is complete. Because the OS install is done manually, it is possible that the virtual system might be assigned a different IP address to what Cloudmin expects it to have, which will cause the status to be falsely shown as "Ping failed". This prevents the system from being fully managed by Cloudmin.

The best solution to this issue is to setup a DHCP server on your Cloudmin master system, which will then be automatically configured for each new virtual system so that systems can obtain the correct IP address. The steps to do this are :

1. Login to Cloudmin at `root` , and go to *Webmin* -> *Servers* -> *DHCP Server*
2. If the DHCP server is not installed yet, you may be prompted to have Webmin install it on that page. If this prompt doesn't appear, you will need to install it manually using whatever package or method is appropriate for your operating system.
3. If the *Start Server* button appears at the bottom of the page, click it to start DHCPd.
4. On the left menu, go to *System* -> *Bootup and Shutdown*, check the box next to the `dhcpd` or `dhcp-server` action, and click the *Start on Boot* button.
5. Go to *Cloudmin* -> *Cloudmin Settings* -> *Cloudmin Configuration* -> *DHCP settings* and change *Add DHCPd host for virtual systems?* to *Yes*.

Once this is done, Cloudmin will add a DHCP `host` entry for each new virtual system it creates. However, this will only be actually used if your master system and Xen or HVM hosts are on the same subnet. If not, you will need to setup the appropriate firewall rules or router configurations to forward DHCP packets from other networks to your Cloudmin master.

Creating Empty Systems
--------------------

The process of creating a new empty virtual system is mostly similar to that for creating a full system. The steps to follow are :

1. Open the *Create System* category on the left menu, and click on *Create Xen instance* (or whatever virtualization type you want to use).
2. Select the *Create empty system* tab.
3. Enter a short name in the *Internet hostname* field, like `gentoobox`.
4. Enter a longer description in the *System description* field, like `Gentoo Linux install`.
5. In the *Installation CD image* field, either select a CD image that you added to Cloudmin as documented above, or enter the path to an ISO format CD or DVD file on the host system.
6. If you entered a CD image page, make sure the correct host is selected in the *Xen hosting system* field.
7. In the *Resource limit options* section, enter the size of the system's empty virtual disk in the *Disk space allocated to instance* field.
8. If the virtual system is not Linux and you are using KVM virtualization, change **Use VirtIO disk driver?** to **No** in the advanced options section.
9. Click the *Create System* button.

Creation should take less time than in would for a Cloudmin system created from an image. At the end of the process, you will have a virtual system whose status is *Ping failed*, which indicates that Cloudmin could not contact it on the assigned IP address. This is expected, as the system will be waiting for you to complete the OS install process as follows :

1. Open the *System State* menu category, and click on *Graphical Console*.
2. You should now see the initial installation screen of the operation system whose CD image you selected. Begin the install process, just as you would on a real system.
3. When you reach the disk partitioning step, make sure that the virtual drive is given only a single partition which contains the root filesystem. Having multiple partitions may make it impossible for Cloudmin to expand the disk later.
4. When prompted for the system's IP address and hostname, if they do not get correctly assigned by DHCP, make sure you enter the same IP and hostname that Cloudmin selected when the empty system was created.
5. Complete the rest of the install process as normal. Keep a note of the `root` password that you select.
6. Go to *System State* -> *Change Boot Method* , and set the boot device to *Hard disk* only.
7. Click on *Edit System*, and in the *Authentication options* section change the *SSH login mode* to *Using password* and enter the password you chose during the install process.
7. Shut down the virtual system, then start it up again.
8. Make sure that Cloudmin now shows the system's status as *SSH*.

If the new system is not contactable by Cloudmin after rebooting, use the *Graphical Console* page to ensure that it has fully booted from the hard disk, and has the correct IP address.

Managing Empty Systems
---------------------

Once an empty system has been fully installed, it can be managed by Cloudmin like any other virtual machine. However, Xen instances created this way will always use HVM virtualization, as will any clones created from them. If you create an image of an initially empty Xen instance and then create a new virtual system from that image, it will also use HVM.

Open source Xen systems that were initially created empty will use virtual disks that are in whole-disk format, rather than single-partition format. This generally has no impact on the user, but if the disk has more than one partition it may be impossible to expand its size if both partitions are mounted.