воскресенье, 4 августа 2013 г.

Создание ISO библиотеки в XCP 1.6

How to create a local ISO Storage Repository on Citrix XenServer

In order to create virtual machines based on ISO disks, you need a local ISO Storage Repository on Citrix XenServer. There are several options of ISO Storage repositories in Xen Server based on the location of the repository. You should check the location based on the available space and your space requirements. We recommend to pass:
df -h
before choosing the location. Please be aware that sometimes LVM and the Local Storage do not appear in df -h as they do not have a fstab entry. However, you can see it inside XenServer.
Inside the main partition
(this is least disearable option as the available space is very small, however it is the easiest to be done)
1. Create the directory “/var/opt/xen/iso_library/”
mkdir -p /var/opt/xen/iso_library
2. Create the ISO storage repository with the following command
xe sr-create name-label ="ISO Repository" type=iso device-config:location=/var/opt/xen/iso_library/ device-config:legacy_mode=true content-type=iso
3. Transfer your ISO image in /var/opt/xen/iso_library/ with wget or FTP.
4. Login in Citrix XenCenter and you will now see the new repository. Press Rescan to refresh the images inside.
Inside the Local Storage
If you want to create an local ISO repository inside the Local Storage on Citrix you can use:
xe sr-create name-label=ISO type=iso device-config:location=LOCATION device-config:legacy_mode=true content-type=iso
where LOCATION can be your Local Storage. You can find it out with:
df -h
Inside the LVM
1. Check the free space inside LVM
pvscan
It will output something like this:
PV /dev/sda3 VG VG_XenStorage-10307bc6-dc3b-6b46-b01a-b9efa6f39ae6 lvm2 [1.99 TB / 1.94 TB free]
Total: 1 [1.99 TB] / in use: 1 [1.99 TB] / in no VG: 0 [0 ]

2. Create LVM Space for ISO Repository
lvcreate -L 50G -n ISO VG_XenStorage-10307bc6-dc3b-6b46-b01a-b9efa6f39ae6
(replace the VVG… with your date from pvscan)
and make it active
vgchange -a y
3. Format the new space:
mkfs.ext3 /dev/VG_XenStorage-10307bc6-dc3b-6b46-b01a-b9efa6f39ae6/ISO
4. Mount the ISO Repository
mkdir /mnt/iso_import
and edit /etc/rc.local to put auto mount on boot (do not add it into /etc/fstab!). Add the following text at the end of the file.
[...]
# Mount ISO
vgchange -a y
mount /dev/VG_XenStorage-10307bc6-dc3b-6b46-b01a-b9efa6f39ae6/ISO /mnt/iso_import/

5. Create the following softlink
rmdir /var/opt/xen/iso_import
ln -s /mnt/iso_import /var/opt/xen

6. Create the the repository
xe sr-create name-label=ISO type=iso device-config:location=/mnt/iso_import/ device-config:legacy_mode=true content-type=iso
7. Reboot to be sure that all works fine
8. Transfer your ISO image in /var/opt/xen/iso_library/ with wget or FTP.
9. Login in Citrix XenCenter and you will now see the new repository. Press Rescan to refresh the images inside.

оригинал: http://kb.softescu.ro/server-administration/linux-server-administration/how-to-create-a-local-iso-storage-repository-on-citrix-xenserver/