• How To

    OpenQRM and XEN LVM based HVM VM.

    Posted on November 21st, 2010

    Written by CJ

    Tags

    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.deb

    After 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.rules

    Second Solution:

    prompt>ifconfig -a

    Make a note of the eth device number, i.e. eth3

    prompt>nano /etc/network/interfaces

    change:

    eth0

    to

    eth3
    prompt>/etc/init.d/networking restart

    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 /mnt

    Make sure to umount it, when your done:

    prompt>umount /mnt

    Remove 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.cfg

    Shutdown:

    prompt>xm shutdown vmx01cms01

    Or Destroy (Unplug the VM from outlet)

    prompt>xm destroy vmx01cms01

    View running VMs, in real mode:

    prompt>xm top

    List 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 vmx01cms01

    Unmount LV (probably not mounted anyway’s, for reference only)

    prompt>umount /dev/mapper/vol-vmx01cms01

    Deactivate it

    prompt>lvchange -a n /dev/mapper/vol-vmx01cms01

    Delete LV

    prompt>lvremove /dev/mapper/vol-vmx01cms01 prompt>lvdisplay

    Nothing to display.

    Now simply delete the vmx01cms01.cfg, VM file.

    prompt>rm /etc/xen/vmx01cms01.cfg

    You 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/fstab

    Don’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-vmx01cms01

    Resize VG

    prompt>resize2fs /dev/mapper/vol-vmx01cms01 1000M

    Resize LV

    prompt>lvresize -L 1G /dev/vol/vmx01cms01

    Show Results

    prompt>lvdisplay

    Remount - Optional

    prompt>mount /dev/mapper/vol-vmx01cms01

     

    Some Useful CLI commands and GUI, for LV

    LVM Managing - CLI

    prompt>vgdisplay prompt>pvdisplay prompt>lvdisplay

    LVM Managing - GUI

    prompt>apt-get install system-config-lvm

     

    Pages: 1 2 3 4 5 6 7 8 9 10 11

    This entry was posted on Sunday, November 21st, 2010 at 6:51 pm and is filed under How To. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.
  • 7 Comments

    Take a look at some of the responses we've had to this article.

    1. " OpenQRM and XEN LVM based HVM VM. "

      Joe
      Posted on November 30th

      I loved this example of how to OpenQRM and XEN servers. It is a truly a complete installation guide. Incredible artcile.

    2. " OpenQRM and XEN LVM based HVM VM. "

      Gert
      Posted on January 21st

      Thanks for the effort you took in writing this article. It really helped me with my first OpenQRM setup!
      Loved it!

    3. " OpenQRM and XEN LVM based HVM VM. "

      Colin
      Posted on January 28th

      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.

    4. " OpenQRM and XEN LVM based HVM VM. "

      Posted on February 3rd

      Thanks a ton for This post! Very Informative. Got Exactly what i was looking for. keep it up.

    5. " OpenQRM and XEN LVM based HVM VM. "

      CJ
      Posted on February 11th

      @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.

    6. " OpenQRM and XEN LVM based HVM VM. "

      Mr Bow
      Posted on August 3rd

      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

    7. " OpenQRM and XEN LVM based HVM VM. "

      rjbutler
      Posted on August 9th

      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.

  • Post a Comment

    Let us know what you thought.

  • Name:

    Email:

    Website:

    Message: