Monthly Archives: May 2011

Starting and stopping XenServer with the xe command

XenCenter shut down server

XenCenter shut down server


I run XenCenter for managing my XenServer in a virtual Windows7 system hosted on the XenServer itself.

This gives a bit of a catch 22 when it comes to shutting the system down.

As it turns out it does not work.

So what are my options?
From the top of my head I can think of a couple..

* hook up a monitor and keyboard to the server.
– Not interested.

* shut down using xsconsole via ssh.
– No, since I use a mac and you need to press f8 to verify the shut down command.

There is however a wonderful command called xe which you can use to manage just about all aspects of your XenServer.
So I shut down my management vm (the one with XenCenter) and get busy using xe:
[root@localhost ~]# xe host-disable
[root@localhost ~]# xe host-shutdown

Done! Give it a moment and the system powers off.

If you try to run host-shutdown without disable first you will be told to think again:
[root@localhost ~]# xe host-shutdown
This operation cannot be performed because the host is not disabled. Please disable the host and then try again.

The next time I am to user the server I power up and log in via ssh and run another couple of xe commands:
[root@localhost ~]# xe host-enable
[root@localhost ~]# xe vm-start vm=Windows\ 7\ \(64-bit\)\ \(1\)

Back in business!

Share

Installing XenServer on my T3

I finally got around to installing XenServer 5.6.fp1 on my Asus T3. (Barebone specs here)
On top of the barebone is 8GB of RAM, two Western Digital Caviar Black 2TB drives for local VM storage and an AMD Phenom II X4 945.

XenCenter

XenCenter

I installed it on a 16GB usb memory stick. It does not need to be that big, but I got it for a good price. Do a quick google for the tip on how to install to a smaller drive.

The install itself is not too much to speak about, except I chose to not use any local storage. (I installed it using Parallels on my Mac without any other drives than the usb stick..)

To have the system boot from my USB stick I looked to this guide http://community.spiceworks.com/how_to/show/1168#4 to rebuild the initrd and tell the kernel to be ok with having the root partition on USB. (I forgot to save the console output, hence just a link..)

After that it is as simple as booting up and enjoying!

At this point I did not get any network running. After double checking that both the internal nic and the Intel Pro 1000 was supported I realized that I let the virtual machine boot and setup networking.
So after editing /etc/sysconfig/network-scripts/ifcfg-eth0 to have the right mac address and in /etc/sysconfig/network-scripts/ifcfg-xenbr0 changing onboot=no to yes it was up properly.

Time to add some storage!
First I ran fdisk on the drives and deleted the existing partitions and created one new on each drive of type fd wich is a Linux RAID partition.

Create the volume, I use a raid 0 for extra speed and space.
[root@localhost ~]# mdadm --create /dev/md0 --level=0 --raid-devices=2
/dev/sdb1 /dev/sdc1

And have a look to see the result is satisfactory
[root@localhost ~]# mdadm --detail /dev/md0

To add the volume as a local Storage Repository in Xen first get the host uuid, for example by running
[root@localhost ~]# xe host-list

Create the SR
[root@localhost ~]# xe sr-create content-type=user device-
config:device=/dev/md0 host-uuid=8dd7f499-3148-4bec-a37a-b614177bbf47 name-
label="Local Storage" shared=false type=lvm
11439a54-40ad-1ccd-6c04-c88671f49bfc

The return is the uuid of the SR, verify with
[root@localhost ~]# xe sr-list

Profit!

XenCenter Storage

XenCenter Storage

Share