Smoothwall Firewall project

Showing posts with label redhat Xen. Show all posts
Showing posts with label redhat Xen. Show all posts

Monday, 5 December 2011

How to add another hard disk to your Xen virtual machine




If like me you have many Xen virtual machines that have been running for a while, you will likely come across the problem of having to increase the disk space, as the services or jobs the virtual machine offers over time changes.

Now you could increase the size of the existing disk, but I always feel that offers a level of risk, which with adding a new disk and using LVM or a new mount goes away.

Ok, so firstly we need to create a new virtual disk on the physical harddisk with the following command:

dd if=/dev/zero of=vm01-disk2.img bs=1G count=50

This will give us 50GB of new space. You can of course change the size to what ever you require, if your physical disk space will allow it.

Then we need to edit the Xen virtual machine configuration file and add in the new disk.

On my virtual machine host this is in /etc/xen/vm01

The line that needs to be altered is obviously the disk line, like so

disk = [ "tap:aio:/opt/xendisks/vm01.img,xvda,w",\
"tap:aio:/opt/xendisks/vm01-disk2.img,xvdb,w" ]


NB Notice the slash which allows the configuration line to expand over two lines in the configuration file.

Once you have done this, you can use the virsh and xm commands to restart the virtual machine , so that the new disk is available inside the virtual machine.

Once your VM has re-booted, you will notice another disk, which you can then either add to your LVM configuration, or just format and mount in a new directory. Here is my new mount as an example.

/dev/xvdb 50G 19G 29G 39% /opt/tomcat

Friday, 20 November 2009

If you want real virtual speed with your Jumpbox appliances use Xen not ESXi

As you will have seen on my blog recently we had a situation that meant I had to move one of our Jumpbox virtual appliances from a failed Xen server to a new ESXi server. Now these servers are exactly the same specification, HP DL380 G5 with 32GB RAM and 2 x Dual Core Intel Xeon CPU's , so not exactly supercomputers, but more than enougth to do what we want with them.

Well here is the thing, Jumpbox say that VMware are one of their main supported platforms and , Tier 1 partners I think they call it, and open source Xen is Tier 3. So how come then the virtual appliance runs significantly faster on Redhat Enterprise than it does on Vmware ESXi? When I say significantly, I'm not joking. The virtual appliance is the moinmoin wiki. On the ESXi platform trying to edit a post is painfully slow, 30 seconds to open the editor. On Xen it is 1-2 seconds at most, so I don't need a stop watch to see something is wrong.

I have gone through the settings for the Vmware server, something I don't have to do with Xen, and given it garanteed resources and CPU power, no difference. I could, if I fancied wasting a small part of my life, investigate the Advanced settings for the ESXi server, but again why would I when with Xen it just flys?

I don't know the answer thats for sure, and especially when you know that the Jumpbox appliance is running with the QEMU hardware emulator on Xen, as it's not para-virtualized! Emulators as I'm sure you know are not supposed to be that fast.

I think I'm going to chat to Jumpbox about this, as it really does seem odd. The only thing that may have affected the performacne is the fact that I had to migrate the appliance to ESX format from Server format, but surely once this process is completed the virtual image should be good to go.