First we need to check free local disk space on XenServer:
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.0G 1.9G 1.9G 51% /
none 373M 4.0K 373M 1% /dev/shm
/opt/xensource/packages/iso/XenCenter.iso
52M 52M 0 100% /var/xen/xc-install
#
You can clearly see there is not much disk space left on /dev/sda1.
Now you need to create a new Logical Volume (LV) that will have enough space for our ISO images.
First check the available physical disk space:
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 VG_XenStorage-8eaf2053-79bc-3284-1b70-13a714db05eb lvm2 a- 457.75G 199.96G
#
Then check the Volume Group(s) (VG):
# vgs
VG #PV #LV #SN Attr VSize VFree
VG_XenStorage-8eaf2053-79bc-3284-1b70-13a714db05eb 1 7 0 wz--n- 457.75G 199.96G
#
Then create the new LV in the available VG (I have only one):
# lvcreate -L 10G -n isoImages VG_XenStorage-8eaf2053-79bc-3284-1b70-13a714db05eb
Now you have to make a filesystem on this new LV. I've made mine ext3.
# mkfs.ext3 /dev/VG_XenStorage-8eaf2053-79bc-3284-1b70-13a714db05eb/isoImages
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1310720 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
#
Now you need to create a mount point:
# mkdir /mnt/isoImages
You need to make the LV in the VG known to the kernel:
# vgchange -a y
Create the repository:
# xe sr-create name-label=ISOimages type=iso device-config:location=/mnt/isoImages/ device-config:legacy_mode=true content-type=iso
You should see your new repository listed in XenServer:
# xe sr-list
uuid ( RO) : 3f492136-d7ba-360e-8a83-c324be44a676
name-label ( RW): ISOimages
name-description ( RW):
host ( RO): XenBelut
type ( RO): iso
content-type ( RO): iso
#
Now you can mount the new FS:
# mount /dev/VG_XenStorage-8eaf2053-79bc-3284-1b70-13a714db05eb/isoImages /mnt/isoImages/