We had a fortunate opportunity to participate in the Cloud Technology Conference held at VPM Thane on November 12, 2011. I would like to thank Mr. Abhijeet Kale, In-Charge of IT department at B.N. Bandodkar College of Science, VPM, to have given us the opportunity to interact with students.
Our participation was in conjunction with Red Hat India. and the speaker from Red Hat India was Ms. Monika Gugnani, Senior Technical Consultant.
Let me go into the details of our presentation straight away.
The first idea is that Cloud implementation depends on the ability to use virtualization. We are now able to purchase inexpensive computer hardware that is capable of virtualization. Combined with free software like Fedora Linux, it is possible to get started with the demo.
On the DVD install of Fedora, we have the package group called Virtualization, that may be selected during installation itself. Of course, this package group may be added any time after installation as well. This gives us the ability to run the Virtual Machine Manager that looks like so (click for full size):
Logical Volume Management
We also have the ability to use a flexible hard disk storage mechanism called Logical Volume Management. For those new to this concept, it may be easy to understand it as a storage manager that does not depend on hard disk partitions for every activity. We are able to allocate storage, resize it to reduce or increase size and more importantly, use one volume as a template for others (snapshot). A snapshot volume allows us to store incremental changes from our template volume.
This means that I can make one volume for the virtual machine with all desired software and settings, and then use this as a common base for all my virtual machines. If I make any changes when the virtual machines are running, then the snapshot will store those changes. But first, we will concentrate on getting an operating system installation done.
In Fedora, the LVM management window looks like so (click for full size):
Of course, the actual volumes and their sizes will be as per your requirement. This is the current state of my machine’s LVM.
While creating a new volume, the window looks like so:
Creating a new virtual machine
We need to provide the virtual machine with standard resources that are required by a computer to function:
- Memory (RAM)
- Storage (Hard disk)
- Network interface
- Input devices
Our virtual machine environment will be simulated using resources available in the host machine (my laptop). Using a technique called Ethernet Bridging, it will be possible to set up the virtual machine to be fully accessible on the network without any special handling from the laptop. However, the environment generated by default is to put virtual machines in a private network with access to the outside world provided by network address translation (NAT). The steps to create a new virtual machine are show below:
These steps are the options that I chose. You are allowed a number of choices (for example, to use a simple file for use as a hard disk). In our training centre, it is common to have installation conducted using files from a server, instead of using an installer DVD. During the install, the window may look like so:
After installation (with a normal user called student created as part of install steps), the desktop may look like so:
We are going to use this virtual machine’s disk image as a template for our later virtual machines. It will be useful to customize this virtual machine to have all of the common requirements for all virtual machines. For example, we will use a machine (called instructor.example.com or instructor here) to act as a remote control for our virtual machines. The remote control is made possible by way of enabling SSH keys to be copied to the template machine from the remote control machine. This will allow the administrator on remote control machine to authenticate himself/herself to the other virtual machines by using SSH key instead of the usual password. The steps for doing this may look like so:
Snapshot Logical volume for a new virtual machine
Before going ahead, it would be a good idea to shut down the newly installed virtual machine (using normal shut down command/option). Creating a snapshot would be a good idea when we know there aren’t any changes occurring during the process.
We can revisit the Logical Volume Management utility and now select the volume that was used for installing our template virtual machine. Next, we use the option to create a snapshot from it. The screen may look like so:
Notice that the snapshot size is a fraction (1 GB) of the template virtual machine’s disk volume (5 GB). This is because only the portions that will be modified in the new virtual machine will need to be stored separately. All original files will still come from the template virtual machine’s disk image.
Creating New Virtual Machines with Snapshot Volumes
The wizard steps are identical to those shown above, except for the part where we will tell the wizard that we want to start a machine with a disk containing an installed operating system. This method saves us the time of installing the operating system on every virtual machine. The steps will look like so:
This last step involves providing the new virtual machine with a know Network Interface Card (NIC) MAC address. On the network, actual data transfer occurs between devices using the MAC address.
The special address – 52:54:00:22:22:22 – has been configured in DHCP service provided by instructor virtual machine to assign a particular IP address (192.168.120.240) when requested by the device having this NIC MAC address. Also, the DNS service provided by instructor virtual machine has a name of mysql.example.com for this IP address.
The configuration in template virtual machine disk image does not have any host name saved within it. Therefore, on starting up, it will request an IP address within its LAN (a virtual network implemented by our virtualization software), tell the DHCP server of its NIC MAC address (52:54:00:22:22:22). The DHCP server will recognize the NIC MAC address and give the virtual machine a particular IP address (192.168.120.240). Additionally, the DHCP server will look in DNS for the IP address and provide the virtual machine the host name present in DNS (mysql.example.com). You will need some System Administration knowledge to set up functional DNS and DHCP servers.
Therefore, our new virtual machine will take on a new identity on starting up. On login, it may look like so:
We can run arbitrary commands on our new virtual machine from our remote control like so:
This is convenient, since we can make our newly operational virtual machine to download and install a set of scripts that might make it useful for a particular purpose (in this case, to function as a MySQL Database Server).
On reaching a point where our virtual machine is no longer required, we can shut it down, delete it from Virtual Machine Manager and then delete the snapshot volume that was created for it. We will not be deleting the template volume since we can make new virtual machines very conveniently using it. These steps are in keeping with the definition of Cloud Technology, wherein computer resources are efficiently used on demand.
That concluded the demo for virtualization. It used only an inexpensive laptop with Fedora operating system. The virtual machines were set up using Red Hat Enterprise Linux, but any operating system would work just the same.
Do email us if you have any questions.