Home Food Seattle Food Events Displaying items by tag: Virtualization
Wednesday, 08 August 2012 20:28

A disk free command for Xen Cloud Platform

XCP and Xenserver store their Virtual Disk Images on storage repository. To see how much space you have on your LVM or lvmoisci storage repositories from the commandline can be quite a chore so I wrote a df command for storage repositories. My dfsr command mimics the output of the Linux df command with the human readable flag set (-h). All values will be printed in Kilobytes, Megabytes, Gigabytes and so on. It shows the size of the repository, how much is used, how much is available, the percent used and the Storage Repository type. 

 Get it from my Virtualization downloads section.

 

 

 

 

 

 

 

Published in Virtualization Blog
Saturday, 12 January 2013 01:03

Access VHD VDIs from the Control Domain

 On occasion you may want to have access to a VM's Virtual Disk Image from the Control Domain (or another VM). An example of this would be access files in a VM disk that due to corruption will no longer boot. An XCP local Storage Repository is created from an LVM Volume Group. Each Virtual Disk Image represents one Logical Volume. However, mounting the Logical Volume directly isn't possible because there's  VHD (Virtual Hard Drive) container inside the Logical Volume. Inside the VHD is the real VM disk's partitions. The hierarchy goes something like this  Control Domain Volume Group -> Control Domain Logical Volume -> VHD Container -> VM disk -> VM disk physical Volume -> VM Disk Volume Group -> VM Disk Logical Volume -> VM Disk filesystem. You can see there's quite a few layers here but mounting the VM's disk filesystem IS possible. Here's how.

Since the Control Domain is really a VM itself (privileged VM) we can create a Virtual Block Device using the VM's Virtual Disk Image. From there we use kpartx to map the partitions to Control Domain device nodes.

 

1. Finding VDI UUID number

[root@testcloud1 ~]# xe vbd-list
uuid ( RO)             : b68a332b-4155-f1c4-b224-18fb465dc8e4
          vm-uuid ( RO): fec94868-0449-3616-39b9-08c3b27dab70
    vm-name-label ( RO): Fedora17
         vdi-uuid ( RO): 199619f0-e483-4618-bbd4-bdc9c524bde1
            empty ( RO): false
           device ( RO): 

 

2. Finding the Control Domain UUID number 

[root@testcloud1 ~]# xe vm-list is-control-domain=true
uuid ( RO)           : 2dfc3f33-4afa-47dd-8af6-21877326f8e4
     name-label ( RW): Control domain on host: testcloud1
    power-state ( RO): running

 

3. Creating a virtual block device for the VDI on our Control Domain. This returns the VBD UUID. 

[root@testcloud1 ~]# xe vbd-create device=autodetect vm-uuid=2dfc3f33-4afa-47dd-8af6-21877326f8e4   vdi-uuid=199619f0-e483-4618-bbd4-bdc9c524bde1
11740055-f8d4-3d84-1f90-fb1f4b646fd6

  

4. Plugging in the Virtual Block Device gives us a /dev/sm/backend/<sr-uuid>/<vdi-uuid> device which fdisk will list. 

[root@testcloud1 ~]# xe vbd-plug uuid=11740055-f8d4-3d84-1f90-fb1f4b646fd6 

 

5. Showing the VBD attached to the control domain AND to the Fedora17 VM 

[root@testcloud1 ~]# xe vbd-list 
uuid ( RO)             : b68a332b-4155-f1c4-b224-18fb465dc8e4
          vm-uuid ( RO): fec94868-0449-3616-39b9-08c3b27dab70
    vm-name-label ( RO): Fedora17
         vdi-uuid ( RO): 199619f0-e483-4618-bbd4-bdc9c524bde1
            empty ( RO): false
           device ( RO): 


uuid ( RO)             : 11740055-f8d4-3d84-1f90-fb1f4b646fd6
          vm-uuid ( RO): 2dfc3f33-4afa-47dd-8af6-21877326f8e4
    vm-name-label ( RO): Control domain on host: testcloud1
         vdi-uuid ( RO): 199619f0-e483-4618-bbd4-bdc9c524bde1
            empty ( RO): false
           device ( RO): sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1


6. Showing the Device Node using ls and fdisk

[root@testcloud1 ~]# ls -l /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1
brw------- 1 root root 253, 0 Jan 12 00:52 /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1

 

[root@testcloud1 ~]# fdisk -l $(ls /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1)

Disk /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                                                                                     Device Boot      Start         End      Blocks   Id  System
/dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bd  *           1         980     7863296   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bd            980        1045      524288   82  Linux swap / Solaris
[root@testcloud1 ~]# kpartx -a $(ls /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1)
[root@testcloud1 ~]# ls /dev/mapper/
199619f0-e483-4618-bbd4-bdc9c524bde1p1
199619f0-e483-4618-bbd4-bdc9c524bde1p2
control
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-MGT
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--199619f0--e483--4618--bbd4--bdc9c524bde1
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--6c663b1b--d9c4--45bd--9071--3f6b4668d164

 

7. Use kpartx to create /dev/mapper entries for each partition.

[root@testcloud1 ~]# kpartx -a $(ls /dev/sm/backend/ec2eb4df-040c-2a75-1c9f-69b953ac9e8d/199619f0-e483-4618-bbd4-bdc9c524bde1)

 

8. kpartx creates /dev/mapper nodes

[root@testcloud1 ~]# ls /dev/mapper/
199619f0-e483-4618-bbd4-bdc9c524bde1p1
199619f0-e483-4618-bbd4-bdc9c524bde1p2
control
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-MGT
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--199619f0--e483--4618--bbd4--bdc9c524bde1
VG_XenStorage--ec2eb4df--040c--2a75--1c9f--69b953ac9e8d-VHD--6c663b1b--d9c4--45bd--9071--3f6b4668d164

 

9. Mount the partitions

[root@testcloud1 ~]# mount /dev/mapper/199619f0-e483-4618-bbd4-bdc9c524bde1p1 /media/Fedora17-rootfs/

 

[root@testcloud1 ~]# ls /media/Fedora17-rootfs/
bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

 

Notes: Be careful with mounting VDI's from VMs on the Control Domain. Best practice is to make sure that the VDI is not accessible from the Control Domain AND the VM at the same time. Mounting to two locations at once is a great way of corrupting your disk by having two different Operating Systems writing to the disk at the same time.

Published in XCP Howtos
Thursday, 01 November 2012 07:33

Add a CD to a VM

Prerequisites

  • XCP/Xenserver

Adding a CD to a running VM is not a difficult task if you know which commands to use. By adding I mean we're going to insert a virtual CD disk into a virtual machine using our little virtual hands. ;-)

 

1. Get the name of your Virtual Machine

In this case the name is CentOS6 and the UUID is cefb9f88-0424-6701-5ba1-070490c69203.

[ root@cloud2 ~/bin ] xe vm-list
     uuid ( RO)           : cefb9f88-0424-6701-5ba1-070490c69203
          name-label ( RW): CentOS6
         power-state ( RO): running

 

2. Get the name of the CD disk

In this case our disk is named CentOS-6.3-x86_64-LiveCD.iso.

[ root@cloud2 ~/bin ] xe cd-list
    uuid ( RO)          : 0549c68a-e38d-4cd8-9974-ba0b9167ff5a
        name-label ( RW): CentOS-6.3-x86_64-LiveCD.iso

 

3. Identify a free Virtual Block Device number

Use the VM UUID that we retrieved in step 1.

[ root@cloud2 ~/bin ] xe vm-param-get uuid=cefb9f88-0424-6701-5ba1-070490c69203 \
param-name=allowed-VBD-devices 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15

 

4. Add the CD to the VM. Use the VM UUID from step 1, the CD name from step 2 and the VBD device number from step 3.

[ root@cloud2 ~/bin ] xe vm-cd-add uuid=cefb9f88-0424-6701-5ba1-070490c69203 \
device=5 cd-name=CentOS-6.3-x86_64-LiveCD.iso

 

5. Verify using xe vm-cd-list

 By using xe vm-cd-list we can list the CD's currently plugged into our VM.

 

[ root@cloud2 ~/bin ] xe vm-cd-list uuid=cefb9f88-0424-6701-5ba1-070490c69203 
CD 0 VBD:
uuid ( RO)             : 40f6b5c9-14fd-4379-d82c-d0ff34472a04
    vm-name-label ( RO): 955300270
            empty ( RO): false
       userdevice ( RW): 5


CD 0 VDI:
uuid ( RO)             : 0549c68a-e38d-4cd8-9974-ba0b9167ff5a
       name-label ( RW): CentOS-6.3-x86_64-LiveCD.iso
    sr-name-label ( RO): NFS ISO
     virtual-size ( RO): 725614592

 

6. Unplugging the CD disk

When done with the CD you can unplug it even easier. We specify the VM UUID and tell it to eject the CD which it does. 

 

 [ root@cloud2 ~/bin ] xe vm-cd-eject uuid=cefb9f88-0424-6701-5ba1-070490c69203

 

Published in XCP Howtos
Monday, 05 November 2012 10:26

Add a hard disk to a VM

Installing from an XCP/Xenserver template usually gives you one Virtual Disk to install the operating system on. Depending on your needs this disk may not be large enough. Following is a tutorial on how to add an additional disk to a virtual machine.

Terminology: 

 

Virtual Machine - A virtual machine is a computer that's virtualized and running on a hypervisor. In our case the hypervisor is Xen Cloud Platform/Xenserver. The Virtual Machine can be running any operating system.

Virtual Disk Image - Think of a Virtual Disk Image as a hard drive.

Storage Repository - A "box" storing Virtual Disk Images. Think of this as an external box storing virtual hard drives. The virtual hard drives are the Virtual Disk Images mentioned above.

Virtual Block Device - A Virtual Block Device connects a Virtual Disk Image to a Virtual Machine. In traditional computer terms you could think of it as the cable. 

The process for adding a hard drive to a real computer

  1. Insert the disk in the hard drive box
  2. Connect the cable to the hard drive box
  3. Insert the cable into the Computer

The process of adding a new Virtual Disk for a Virtual Machine is 

  1. Create a new Virtual Disk Image
  2. Create a new Virtual Block Device for it
  3. Connect the Virtual Block Device to the Virtual Machine

 

1. Get available free space

You will need to know how much free space is available on your Storage Repository.

[ root@cloud2 ~ ] xe sr-list
uuid ( RO)                : 36bf480a-5df9-4453-50f0-2bac4a86cb42
              name-label ( RW): localsr-cloud1
    name-description ( RW): 
                         host ( RO): cloud1.acs.edcc.edu
                        type ( RO): lvm
           content-type ( RO): user

Now that we have the Storage Repository's UUID number (36bf480a-5df9-4453-50f0-2bac4a86cb42) we can use xe sr-list again to give us the physical size and how much space is being utilized.

[ root@cloud2 ~ ] xe sr-list uuid=36bf480a-5df9-4453-50f0-2bac4a86cb42 \
params=physical-utilisation,physical-size
physical-utilisation ( RO) : 214752559104 physical-size ( RO): 991600574464

Quick math (991600574464 - 214752559104 = 776848015360) shows us that we have about 776 MB free.

2. Create the Virtual Disk Image

Now that we know the available space on the storage repository we can make a new Virtual Disk Image using xe vdi-create.

[ root@cloud2 ~ ] xe vdi-create sr-uuid=bd1ac90d-7c23-dc07-dfa3-edc9f1cd73c4 \
name-label=DATADISK type=user virtual-size=100GiB
ee9c5daa-392c-4a0d-a5c1-4ebb7caabd73

This command outputs the VDI's UUID. You can get information about any VDI using the xe vdi-list command.

[ root@cloud2 ~ ] xe vdi-list uuid=ee9c5daa-392c-4a0d-a5c1-4ebb7caabd73 
uuid ( RO)                : ee9c5daa-392c-4a0d-a5c1-4ebb7caabd73
          name-label ( RW): DATADISK
 name-description ( RW): 
                  sr-uuid ( RO): bd1ac90d-7c23-dc07-dfa3-edc9f1cd73c4
            virtual-size ( RO): 107374182400
               sharable ( RO): false
             read-only ( RO): false

The result of xe vm-list shows that the virtual size of the VDI is about 100 GB and it's name-label is DATADISK. To add this new disk to a VM I'll need to get the VM's UUID number by using xe vm-list.

[ root@cloud2 ~ ] xe vm-list name-label=CentOS6
     uuid ( RO)           : cefb9f88-0424-6701-5ba1-070490c69203
     name-label ( RW): CentOS6
      power-state ( RO): running

 

3. Get the available Virtual Block Device numbers

We will also need to know which Virtual Block Device numbers are available. We can use the xe vm-param-get command for this.

[ root@cloud2 ~ ] xe vm-param-get uuid=cefb9f88-0424-6701-5ba1-070490c69203 \ 
param-name=allowed-VBD-devices
7; 8; 9; 10; 11; 12; 13; 14; 15

In summary:

  1. VDI UUID is ee9c5daa-392c-4a0d-a5c1-4ebb7caabd73
  2. VM UUID is cefb9f88-0424-6701-5ba1-070490c69203
  3. Available VBD numbers are 7, 8, 9, 10, 11, 12, 13, 14 and 15

 

4. Create the Virtual Block Device

Create the Virtual Block Device (VBD) using the xe vbd-create command and the VM UUID, VDI UUID and the first available VBD number.

[ root@cloud2 ~ ] xe vbd-create device=7 vm-uuid=cefb9f88-0424-6701-5ba1-070490c69203 \ 
vdi-uuid=ee9c5daa-392c-4a0d-a5c1-4ebb7caabd73 bootable=false mode=RW type=Disk
333ab620-3ee1-0420-d31a-217e4ef1df45

I created Virtual Block Device 7 (device=7). Using device=0 would have given me a /dev/dev/xvda which I already have. The xe-param-get command showed my first available Virtual Block Device number was 7. Notice that we associated the Virtual Disk Image (VDI) to the Virtual Machine (VM) by using a Virtual Block Device (VBD).

5. Plug in the disk to the VM

The VM won't see the disk yet as it hasn't been "plugged in". We can do this by either rebooting the VM or using the xe vbd-plug command. Let's plug the VBD into the running VM.

[ root@cloud2 ~ ]  xe vbd-plug uuid=333ab620-3ee1-0420-d31a-217e4ef1df45

6. Verify that it worked

Log into the VM via ssh or xenconsole and see if the disk appeared by catting /proc/partitions.

[root@Centos6 ~]# cat /proc/partitions
major minor  #blocks  name

 202        0    8388608 xvda
 202        1     102400 xvda1
 202        2    8285184 xvda2
 253        0    7733248 dm-0
 253        1     524288 dm-1
 202       16  104857600 xvdb

Published in XCP Howtos
Tuesday, 26 March 2013 10:19

Apply hotfixes to XCP 1.6

Xenserver hotfixes are released as patches that need to be applied with patch-pool-apply. Although technically this could work with XCP as long as you got the correct Xenserver patch it's better to apply patches the "new" way using Yum and the default xcp repository.

Any minor software updates to Xen Cloud Platform will be released into the XCP Yum repository at downloads.xen.org.  XCP 1.6 comes with a ready made Yum repository file at /etc/yum.repos.d/xcp.repo although by default the repository is disabled.

To apply updates use the yum update command you have to enable the repo and tell rpm not  to gpg check the packages. Hopefully the latter behavior will change in the future.

yum --enablerepo xcp --nogpgcheck update

If you'd like to enable the repo and turn gpg checking off by default so future updates are easier then change the enabled=0 line to enabled=1. Also add a line to the /etc/yum.repos.d/xcp.repo file to turn gpgchecking off for this ONE repository.

 

[xcp]
name=XCP 1.6 Updates
baseurl=http://downloads.xen.org/XCP/repo/xcp-1.6.10/
enabled=1
gpgcheck=0

I don't know if I recommend enabling by default as I like to do my updates manually. I really have issues with turning gpg checking off but currently the packages are distributed without a gpg signature so if you have it turned on the update will fail. Our only choice is to turn it off.

Published in XCP Howtos
Saturday, 14 January 2012 01:34

Automated install of CentOS 6 VM (32 bit)

Note: Updated for XCP 1.5b/1.6

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was written in the spirit of my CentOS 6 virtual machine (32 bit) installation on Xen howto which was based on the CentOS 5 version of the same. In those tutorials I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

I've recently migrated a lot of my XEN systems to Xen Cloud Platform and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.

It uses the very same CentOS 6 kickstart file from my site as the Xen tutorial. It also uses the very same CentOS 6 repositories on the Internet so in a lot aspects it IS the same tutorial crafted for XCP but will be a bit shorter.

 More after the jump.

Published in XCP Howtos
Thursday, 17 November 2011 09:55

Automated install of CentOS 6 VM (64 bit)

Note: updated for XCP 1.5b/1.6

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was written in the spirit of my CentOS 6 virtual machine (64 bit) installation on Xen howto which was based on the CentOS 5 version of the same. In those tutorials I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

I've recently migrated a lot of my XEN systems to Xen Cloud Platform and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.

It uses the very same CentOS 6 kickstart file from my site as the Xen tutorial. It also uses the very same CentOS 6 repositories on the Internet so in a lot aspects it IS the same tutorial crafted for XCP but will be a bit shorter.

 

Published in XCP Howtos
Thursday, 14 August 2014 23:48

Automated install of CentOS 7 VM (64 bit)

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was written in the spirit of my CentOS 6 virtual machine (64 bit) installation on Xen howto. In that tutorial I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

I now use Xenserver and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.

This tutorial is for CentOS version 7. 

 

Published in XCP Howtos

Note: This is not totally automated yet. I need to fix several things.

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution
 

Introduction

In this tutorial I create a disk, download a kernel, preseed file and install Debian Wheezy using the preseed file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a Ubuntu mirror locally then downloading my files and editing them.

 

 Note: This tutorial is designed so you can copy and paste the text inside the boxes. I don't actually type any of this in and neither should you.

 

1. Getting the network info

This line gets the Network UUID for xenbr0. If you're using a different bridge you will want to insert it here. Get a list of XCP networks with xe network-list. This network is connected to the outside interface. This tutorial requires there to be a DHCP server on this network answering requests and providing network access to the Internet.

NETUUID=$(xe network-list bridge=xenbr0 --minimal)

2. Creating the VM and setting parameters

Here we create a new template from the Debian Squeeze template. Then we create the VM from the new Debian template, create a network interface and add it to our network from step one. Additional settings are for configuring the install repository and specifying thepreseed file from my site. The last setting turns off VNC so we can watch the install via a text console (very important in my environment).  Even if you can't see all the text below just highlight and paste. The text is there even if it's not visible.

 

TMPLUUID=$(xe template-list | grep -B1 'name-label.*Debian.*Squeeze.*64-bit' | awk -F: '/uuid/{print $2}'| tr -d " ")
VMUUID=$(xe vm-install new-name-label="Debian Wheezy" template=${TMPLUUID}) 
xe vif-create vm-uuid=${VMUUID} network-uuid=${NETUUID} mac=random device=0
xe vm-param-set uuid=${VMUUID} other-config-install-repository=http://ftp.us.debian.org/debian/
xe vm-param-set uuid=${VMUUID} other-config:debian-release=wheezy
xe vm-param-set uuid=${VMUUID} other-config:install-methods=http,cdrom,ftp,nfs
xe vm-param-set uuid=${VMUUID} PV-args="netcfg/get_hostname=Wheezy debian-installer/locale=en_US console-keymaps-at/keymap=us console-setup/layoutcode=us console-setup/ask_detect=false interface=eth0 netcfg/disable_dhcp=false preseed/url=http://grantmcwilliams.com/files/preseed-debian-wheezy.cfg console=hvc0"
xe vm-param-set uuid=${VMUUID} other-config:disable_pv_vnc=1

3. Starting the VM and watching the install

The VM installs without any interaction from the user at this point. It is however, nice to watch it using xenconsole. Once it's done installing it will shutdown.

If you're using XCP 1.0/1.1

xe vm-start uuid=$VMUUID
DOMID=$(xe vm-list uuid=${VMUUID} params=dom-id --minimal)
/usr/lib/xen/bin/xenconsole ${DOMID}

If you're using XCP 1.5b/1.6

xe vm-start uuid=$VMUUID ; xe console uuid=$VMUUID

4. Starting the VM and configuring settings

We need to boot the VM up again and using xenconsole log in to reset the finish configuration.

If you're using XCP 1.0/1.1

xe vm-start uuid=$VMUUID
DOMID=$(xe vm-list uuid=${VMUUID} params=dom-id --minimal)
/usr/lib/xen/bin/xenconsole ${DOMID}

If you're using XCP 1.5b/1.6

xe vm-start uuid=$VMUUID
xe console uuid=$VMUUID

Now that your Debian Wheezy VM is running you can login. The password was automatically set by the preseed file.

  • Username: debian
  • Password: password

Reset the ubuntu users password.  If you want to keep the IP assignment dynamic note the ip address.

5. Shutting down the VM and re-enabling VNC

If you're going to use XVP or some other method of connecting to the VMs direct VNC connection you'll need to enable it.

xe vm-shutdown uuid=$VMUUID
xe vm-param-remove uuid=${VMUUID} other-config:disable_pv_vnc
xe vm-start uuid=$VMUUID

7. Export our VM for safe keeping

Before you start modifying the base Debian Wheezy image you should back it up.

xe vm-export uuid=$VMUUID filename=DebianWheezy-base.xva

Be aware that you may not have enough space on the Control Domain's disk to export it. A good solution (and shorter than explaining how to add disks to the control domain) is to mount an nfs volume and export it there.

mount nfsserver:/share /media/share
xe vm-export uuid=$VMUUID filename=/media/share/DebianWheezy-base.xva

This would mount the NFS share on nfsserver to /media/share. The exported disk would be saved on the NFS share.

 

Published in XCP Howtos
Monday, 10 December 2012 06:51

Automated install of Fedora 17 VM (32 bit)

Note: updated for XCP 1.5b/1.6

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was written in the spirit of my CentOS 6 virtual machine (64 bit) installation on Xen howto which was based on the CentOS 5 version of the same. In those tutorials I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

I've recently migrated a lot of my XEN systems to Xen Cloud Platform and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.

It uses the very same CentOS 6 kickstart file from my site as the Xen tutorial. It also uses the very same CentOS 6 repositories on the Internet so in a lot aspects it IS the same tutorial crafted for XCP but will be a bit shorter.

 

Published in XCP Howtos
Page 1 of 7
Home Food Seattle Food Events Displaying items by tag: Virtualization