Archive

Archive for the ‘Xenserver’ Category

Adding a local storage repository for ISO images

October 6, 2011 Leave a comment

Adding a local storage repository for ISO images
If you want to upload an ISO image to the server and make it available for use with the installation of a VPS you can do so by creating a local ISO storage repository.
In XenServer 5 this has already been set up for you. You will find an ISO storage repository configured for the /iso_import/images directory. Simply copy your ISO images to that directory and rescan the repository with this command:

xe sr-scan uuid=`xe sr-list | /usr/bin/perl -e \
'while (<STDIN>) { if (/^uuid.* ([^ ]*)$/) { $uuid = $1; } \
if (/name-label \( RW\): ISOs/) { last; } } print "$uuid";'`

Your ISO images should now be available to you in the XenCenter client.
For XenServer 4 you start by creating a directory where you would like to copy your ISO images to (we’ll assume /var/opt/xen/iso_import for this example):

mkdir -p /var/opt/xen/iso_import

Now copy your ISO images to the /var/opt/xen/iso_import directory.
Now create a repository with this command (in this example we’ll name it “ISOs”):

xe sr-create name-label=ISOs type=iso \
device-config:location=/var/opt/xen/iso_import device-config:legacy_mode=true 
content-type=iso

Lastly you need to attach the ISO library with this command:

xe-mount-iso-sr /var/opt/xen/iso_import

Your ISO images should now appear in XenCenter.

Categories: Xenserver

How to add an additional hard drive to Xenserver

September 9, 2011 Leave a comment

1. Login the server as root. list all available physical disk with command “fdisk -l”

Here is my output:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 523 4194304 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 523 1045 4194304 83 Linux
/dev/sda3 1045 19457 147899713 8e Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

2. The new drive i need to add to the host is /dev/sdb in my case.
Let’s get the UUID of your xenserver by using this command “xe host-list”
You should see something like this:

uuid ( RO) : 4fd93ca2-2f60-4387-9fb0-b8abc34b7526
name-label ( RW): xenserver-lgsgdjzo
name-description ( RW): Default install of XenServer

3. Create a new XenServer storage repository by using the  one of the following options(Make sure you use your own uuid instead of my):
Option1:create a normal LVHD storage repository. This is by the way the default storage repository type. (The following code should be typed in one line in your terminal)

xe sr-create host-uuid=4fd93ca2-2f60-4387-9fb0-b8abc34b7526
content-type=user type=lvm device-config:device=/dev/sdb 
shared=false name-label="Local storage 2"

Option2:Create a LVHD storage repository with thin provisioning support.(The following code should be typed in one line in your terminal)

xe sr-create host-uuid=4fd93ca2-2f60-4387-9fb0-b8abc34b7526
content-type=user type=lvm device-config:device=/dev/sdbshared=false
name-label="Local storage 2" sm-config:allocation=thin

Option3: Create a EXT storage repository with thin provisioning support and direct access to the vhd files.(The following code should be typed in one line in your terminal)

xe sr-create host-uuid=4fd93ca2-2f60-4387-9fb0-b8abc34b7526
content-type=user type=ext device-config:device=/dev/sdbshared=false
name-label="Local storage 2"

Done !

Categories: Xenserver Tags: ,