This page is part of my webdevster.com tutorial, see index to OpenQRM and XEN LVM based HVM VM.
[2.6] Step 6. Xen Troubleshooting and Optional Useful CLI Commands
Here are some troubleshooting examples, and some very useful CLI commands. Even though we use OpenQRM to manage the Xen Host, it’s a good idea to know these commands.
If you need to install nic drivers on new vm:
Copy the nic drivers to cdrom, than insert cdrom into Xen host cdrom drive, than run the following command on Xen VM:
prompt>mount -t iso9660 /dev/hdc /media/cdrom0 prompt>/media/cdrom0/dpkg -i firmware-bnx2_0.27_all.debAfter install Unmount
prompt>umount /media/cdrom0 prompt>reboot
If VM eth0 doesn’t come up.
Their are two solutions, the first is fixing the root of the problem, Use a permanent mac address found in /etc/xen/vmx01cms01.cfg, to permanently keep the same ethX. The second, is being caused by the VM thinking there is a new NIC installed.
First Solution:
prompt>/etc/udev/rules.d/70-persistent-net.rulesSecond Solution:
prompt>ifconfig -aMake a note of the eth device number, i.e. eth3
prompt>nano /etc/network/interfaceschange:
eth0
to
eth3
You shouldn’t get this problem if you didn’t change the permanent MAC address.
If you want to mount VM’s LV.
You can view the VM’s LV partitions on Xen host with:
prompt>fdisk -l -u /dev/vol/vmx01cms01
Disk /dev/vol/vmx01cms01: 16.1 GB, 16106127360 bytes 255 heads, 63 sectors/track, 1958 cylinders, total 31457280 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x0008ae25 Device Boot Start End Blocks Id System /dev/vol/vmx01cms01p1 * 63 23438834 11719386 83 Linux /dev/vol/vmx01cms01p2 23438835 31455269 4008217+ 82 Linux swap / Solaris
Since the VM’s LV is a whole disk containing partitions, you can’t simply mount it. You first need to create maps to the individual partitions.
prompt>apt-get install kpartx prompt>kpartx -av /dev/vol/vmx01cms01 prompt>mount -t ext3 /dev/mapper/vol-vmx01cms01p1 /mnt prompt>ls /mntMake sure to umount it, when your done:
prompt>umount /mntRemove device mapping
prompt>kpartx -dv /dev/vol/vmx01cms01
If you want to use XM console.
XM Console works in Paravirtualization with little fuss, but with HVM (full virtualization), XM Console is rather cumbersome to setup, therefore you can ssh or vnc into initial installation of the HVM VM. If you are brave to install xm console for hvm, visit, zhigang.org Xen FAQ.
Useful XEN and VM CLI commands and tips.
Here are some useful CLI commands, which OpenQRM will mostly facilitate for us with the WebUI.
Some common xen commands:
Start:
prompt>xm create /etc/xen/vmx01cms01.cfgShutdown:
prompt>xm shutdown vmx01cms01Or Destroy (Unplug the VM from outlet)
prompt>xm destroy vmx01cms01View running VMs, in real mode:
prompt>xm topList running VMs:
prompt>xm list
If you want to delete VM and the LVs
If you want to delete all VM and LV, and start from scratch
For reference only. Might not work for LVs inside an LV.
Unplug the VM
prompt>xm destroy vmx01cms01Unmount LV (probably not mounted anyway’s, for reference only)
prompt>umount /dev/mapper/vol-vmx01cms01Deactivate it
prompt>lvchange -a n /dev/mapper/vol-vmx01cms01Delete LV
prompt>lvremove /dev/mapper/vol-vmx01cms01 prompt>lvdisplayNothing to display.
Now simply delete the vmx01cms01.cfg, VM file.
prompt>rm /etc/xen/vmx01cms01.cfgYou now have no VM and no LV.
Don’t forget to change the fstab, in case you mounted any of these LVs.
prompt>nano /etc/fstabDon’t forget to empty out your ssh known host, if your using the same LV configs again.
prompt>cat /dev/null > /root/.ssh/known_hosts
If you want to resize LV (Shrinking)
For reference only. Might not work for LVs inside an LV.
Unmount (just in case it’s mounted) so we can shrink
prompt>umount /dev/mapper/vol-vmx01cms01 prompt>e2fsck -f /dev/mapper/vol-vmx01cms01Resize VG
prompt>resize2fs /dev/mapper/vol-vmx01cms01 1000MResize LV
prompt>lvresize -L 1G /dev/vol/vmx01cms01Show Results
prompt>lvdisplayRemount - Optional
prompt>mount /dev/mapper/vol-vmx01cms01
Some Useful CLI commands and GUI, for LV
LVM Managing - CLI
prompt>vgdisplay prompt>pvdisplay prompt>lvdisplayLVM Managing - GUI
prompt>apt-get install system-config-lvm


















" OpenQRM and XEN LVM based HVM VM. "
I loved this example of how to OpenQRM and XEN servers. It is a truly a complete installation guide. Incredible artcile.
" OpenQRM and XEN LVM based HVM VM. "
Thanks for the effort you took in writing this article. It really helped me with my first OpenQRM setup!
Loved it!
" OpenQRM and XEN LVM based HVM VM. "
Hi,
A really cool how to about Openqrm, especially when it is pretty hard to find a similar article related Openqrm on the Internet.
We are testing this product at the moment. Just want to know if you have the experience of integrating Openqrm with a iSCSI storage application, like Openfiler or similar applications.
Thanks for this excellent contribution.
" OpenQRM and XEN LVM based HVM VM. "
Thanks a ton for This post! Very Informative. Got Exactly what i was looking for. keep it up.
" OpenQRM and XEN LVM based HVM VM. "
@Colin
Thanks for your kind words, and great sentence structure; you must be an English major.
You asked about, “Openqrm with a iSCSI storage application, like Openfiler”, well it’s like netapp filer (cha-ching) and openQRM, but you and the whole world already new that. OpenQRM targets iSCSI model apps, after all it’s a cloud right, and you need a lot of space. I am by no means an expert on Openfiler, netapp, or other iSCSI storage apps. But I hope soon I’ll own some, because that means I’m doing pretty good, ay.
I can tell you, openQRM is pluggable into almost every environment. So you can merry along with any virtual environment backed by almost any storage app, and openQRM will plug right in and manage it. And if you rather use their proprietary applications to manage, you can also do that as well without interference. Well I hope this all made sense, because it made no sense to me, JK.
Also here is good read on iSCSI.
" OpenQRM and XEN LVM based HVM VM. "
I don’t see “Vol” on this Step “Verify Logical Volume Storage on XEN Host (x01-lc1-cloud1-lvm)”
Error during selecting volume group ! Please check the Event-Log
" OpenQRM and XEN LVM based HVM VM. "
Thank you for this great howto, this made it so much easier to setup a POC for a project I was hoping to do. I have run into one annoying glitch. OpenQRM rewrites the vm config files in /etc/xen. So any xen config file options that I enter, like usbdevice=’tablet’, just gets erased. I was told to enter them in the xen_generate_vm_config function in /usr/share/openqrm/plugins/xen/bin/openqrm-xen, but I have tried, and this does not work. This seems like such a small thing, but until I can add options to the xen config file when the vm is generated, this program just misses the mark. Have any of you solved this. Your suggestions would be appreciated.