Xen VBD Virtual Block Devices features

Acronyms:

  • VBD, Virtual Block Devices
  • SR, Storage Repositoy
  • VDI, Virtual Disk Image
  • VM , Virtual Machine

 

VBD Virtual Block Devices feaures:

  • Single VBD represent the interface between a VDI attached in a SR and a VM
  • VBD are object connectors
  • VBD maps SR -> VDI VS VM
  • VBD can be fine-tunned
  • VBD can be managed using console commands

Xen PBD Physical Block Devices features

Acronyms:

  • PBD, Physical Block Devices
  • SR, Storage Repository

 

PBD Physical Block Devices features

  • Single PBD represent an interface between a physical server and an attached SR
  • PDB are connector objects
  • PDB maps SR vs Physical Hosts
  • PDB store the device configuration
  • PDB can be managed by console commands

 

Xen VDI Virtual Disk Images features

Acronyms:

  • VDI, Virtual Disk Images
  • SR, Storage Repository

 

VDI Virtual Disk Images features

  • VDI are the fundamental units of virtualized storage in the Xen Server
  • VDI are persistent objects located in storage repostories
  • VDI exists independently of Xen Server hosts
  • VDI can be managed by console commands

 

Xen SR Storage Repositories features

Acronyms

  • SR, Storage Repository
  • VDI, Virtual Disk Images
  • PBD, Physical Block Devices
  • VBD, Virtual Block Devices
  • IDE, Integrated Drive Electronics
  • SATA, Serial Advanced Technology Attachment
  • SCSI, Small Computer System Interface
  • SAS, Serial Attached SCSI
  • iSCSI, Internet Small Computer System Interfaz
  • NFS, Network File System

 

Storage Repository (SR) features

  • Single SR is a persistent storage target to save the VDI Virtual Disk Images
  • Built-in support for IDE, SATA, SCSI and SAS devices locally connected
  • Built-in support for iSCSI, NFS, SAS and Fibre Channel remotely connected
  • Sparse provisioning
  • VDI snapshots
  • Fast clonning
  • Multiple SR (different types) can be used in the same Xen host domain
  • Single SR can be shared by multiple hosts via a network resource pool 
  • Single SR can be dedicated to a single host
  • Multiple Hosts in the same resource pool must have a shared SR
  • Single or multiple SR can be managed using console commands

 

Create a new VM from Other install media in a Xen host domain using an ISO operating system installation

Create a new VM from the "Other install media" template.

Returns the new uuid of the VM

shell> xe vm-install new-name-label=LDAP-01 sr-uuid=279d2fee-06a3-69d7-6229-1479d50065e9 template-name-label="Other install media"

12aef3fb-5b69-f340-a773-5c9deab3fd43

Display the new VM available

shell> xe vm-list

uuid ( RO)           : 12aef3fb-5b69-f340-a773-5c9deab3fd43
name-label ( RW): LDAP-01
power-state ( RO): halted
 

Graphical overview of storage repositories and related objects

Add and attack a new root disk to the virtual machine in the storage record

shell> xe vm-disk-add disk-size=5GiB device=0 sr-uuid=279d2fee-06a3-69d7-6229-1479d50065e9 uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43

Get the UUID of the root disk of the new VM

shell> xe vbd-list vm-uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43 userdevice=0 params=uuid –minimal

234a7fa9-5c5c-9ea3-3372-4d95c260e262

Using the UUID returned, set the root disk to not be bootable

shell> xe vbd-param-set uuid=234a7fa9-5c5c-9ea3-3372-4d95c260e262 bootable=false

Get the name of the physical CD drive on the XenServer host

shell> xe cd-list
uuid ( RO)          : 33fddaa8-7832-4068-bf00-3fd3d3aa3bd1
name-label ( RW): debian-cd1-x32.iso

Add a virtual CD-ROM to the new VM using the XenServer host CD drive name-label parameter as the cd-name parameter

shell> xe vm-cd-add cd-name="debian-cd1-x32.iso" device=3 uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43

Get the UUID of the VBD corresponding to the new virtual CD drive

shell> xe vbd-list vm-uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43 type=CD params=uuid –minimal

ca1d045b-3660-e51a-d39d-e078d60681e4

Make the VBD of the virtual CD bootable

shell> xe vbd-param-set uuid=ca1d045b-3660-e51a-d39d-e078d60681e4 bootable=true

Set the install repository of the VM to be the CD drive

shell> xe vm-param-set uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43 other-config:install-repository=cdrom

Get network bridge information

shell> xe network-list bridge=xenbr0 params=uuid –minimal

f0ab0558-7b62-e606-8c68-19e138946baa

shell> xe network-list bridge=xenbr1 params=uuid –minimal

e03fdbb9-8f4f-eb6e-67a6-e727e9218523

shell> xe network-list bridge=xenbr2 params=uuid –minimal

32b044a8-be9b-1725-1c0a-45f4079adbe1

Add a new network interface into the new virtual machine

shell> xe vif-create vm-uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43 network-uuid=f0ab0558-7b62-e606-8c68-19e138946baa device=0

6ff94379-6e81-7fc4-04fb-f60a31338603

shell> xe vif-create vm-uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43 network-uuid=e03fdbb9-8f4f-eb6e-67a6-e727e9218523 device=1

398540cb-983f-a534-2c09-4421b78d5835

shell> xe vif-create vm-uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43 network-uuid=32b044a8-be9b-1725-1c0a-45f4079adbe1 device=2
35949dc2-eead-cde7-9c86-1b94e93bbfc5

Start the VM; it boots straight into the Debian installer

shell> xe vm-start uuid=12aef3fb-5b69-f340-a773-5c9deab3fd43

Now you can open a console to the new VM and deploy the installation

 

 Nice one

Adding an ISO storage repository on a Xen host domain

Lets create a new storage repository to save a couple of operating system installation disks in the Xen host domain

Create the mount point about ISO storage repository

shell>  mkdir /backup/ISO/

shell> ln -s /backup/ISO ISO

Create the ISO storage repository

shell> xe sr-create name-label=ISO type=iso device-config:location=/ISO device-config:legacy_mode=true content-type=iso
57bcb21a-8179-cf66-9c55-2b601bb89ae9

shell> xe sr-list

uuid ( RO)                : 57bcb21a-8179-cf66-9c55-2b601bb89ae9
name-label ( RW): ISO
name-description ( RW):
host ( RO): thor
type ( RO): iso
content-type ( RO): iso
 

Make an ISO from a cdrom to publish into the ISO storage repository

shell> dd if=/dev/scd0 of=/ISO/debian-cd1-x32.iso
1327704+0 records in
1327704+0 records out
679784448 bytes (680 MB) copied, 160.843 seconds, 4.2 MB/s
 

Check if the new ISO image are available in the ISO storage repository and get visibility from Xen Domain Host using XenCenter

From Xen console

shell> xe cd-list
uuid ( RO)          : 33fddaa8-7832-4068-bf00-3fd3d3aa3bd1
    name-label ( RW): debian-cd1-x32.iso
 

Ready

Xen basic VM import (vm-import, vm-destroy)

Im going to erase a complete VM from Xen using de vm-destroy xe command

Get the uuid of the VM

shell> xe vm-list

uuid ( RO)           : 21c6f196-69f4-748d-58e2-e4d1023c257b
     name-label ( RW): Debian-Desktop-1.0
    power-state ( RO): halted
 

Destroy it

shell> xe vm-destroy uuid=21c6f196-69f4-748d-58e2-e4d1023c257b

If you want check it, check the available VM on your Host domain with xe vm-list

Now, import the exported VM saved offline

shell> du -h Desktop_21c6f196-69f4-748d-58e2-e4d1023c257b.xva
1.3G    Desktop_21c6f196-69f4-748d-58e2-e4d1023c257b.xva
 

Import it

shell> du -h Desktop_21c6f196-69f4-748d-58e2-e4d1023c257b.xva
1.3G    Desktop_21c6f196-69f4-748d-58e2-e4d1023c257b.xva

shell> xe help vm-import

shell> xe help vm-import
command name            : vm-import
        reqd params     : filename
        optional params : preserve, sr-uuid, force
        description     : Import a VM. If the option preserve=true is given then as many settings as possible are restored, including VIF MAC addresses. The default is to regenerate VIF MAC addresses. The VDIs will be imported into the Pool’s default SR unless an override is provided. If the force option is given then any disk data checksum failures will be ignored.

shell> xe sr-list
uuid ( RO)                : 279d2fee-06a3-69d7-6229-1479d50065e9
          name-label ( RW): Local LVM SR
    name-description ( RW):
                host ( RO): thor
                type ( RO): lvm
        content-type ( RO): user

shell> xe vm-import filename=/backup/Desktop_21c6f196-69f4-748d-58e2-e4d1023c257b.xva preserve=true sr-uuid=279d2fee-06a3-69d7-6229-1479d50065e9

Output: 21c6f196-69f4-748d-58e2-e4d1023c257b

Check the imported VM in the SR "Local LVM SR"

shell> xe vm-list

uuid ( RO)           : 21c6f196-69f4-748d-58e2-e4d1023c257b
     name-label ( RW): Debian-Desktop-1.0
    power-state ( RO): halted
 

 

run “xrdb -merge ~/.Xresources” to upload X default database properties; for example Xterm console

File: ~/.Xresources

! X database properties
! run "xrdb -merge ~/.Xresources" to upload and override X default database properties
! font properties check "xfontsel"
XTerm*font: -dec-terminal-medium-r-normal–14-140-75-75-c-80-iso8859-1
! Background color
XTerm*background:       black
! Text color
XTerm*foreground:       gray
! Cursor color
XTerm*cursorColor:      red
! Cursor blink
XTerm*cursorBlink:      true
! Startup as login shell
XTerm*loginShell:       true
! Number of saved lines for scroll
XTerm*saveLines:        1000
! internalBorder betweeen characters and the windows border
XTerm*internalBorder:   10
! geometry
XTerm.vt100.geometry:   90×90
! scrollbar
XTerm*scrollBar:        true
XTerm*scrollTtyOutput:  false

Xen basic VM Export (vm-export)

First all, list all the VM that are running/saved in your XEN domain.

shell> xe vm-list

shell> xe vm-list params=all

Take the uuid about your virtual machines

uuid ( RO)           : 910cbd07-3dde-974d-5595-3021103ad656
     name-label ( RW): File-Server-1.0
    power-state ( RO): running
 

Next one, suspend/power off the uuid=910cbd07-3dde-974d-5595-3021103ad656 virtual machine no others virtual machine state are valid. 

shell> xe vm-suspend uuid=910cbd07-3dde-974d-5595-3021103ad656

shell> xe vm-shutdown uuid=910cbd07-3dde-974d-5595-3021103ad656

Note that you need PV drivers to run the previous commands. Install the Xen tools over your virtual machines.

Finally, backup/export the virtual machine to another device outside of principal domain storage repository

shell> xe vm-export filename=/backup/File_910cbd07-3dde-974d-5595-3021103ad656.xva  uuid=910cbd07-3dde-974d-5595-3021103ad656

Dont forget start up the suspend/power off virtual machines

shell> xe vm-start uuid=910cbd07-3dde-974d-5595-3021103ad656

WordPress Themes