Using SSH, logon your XenServer (it’s a UNIX like behind) :

[root@xenserver-wou ~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

Create a new file system for ISO images

You already have a volume group :

[root@xenserver-wou ~]# vgdisplay
  --- Volume group ---
  VG Name               VG_XenStorage-78bc399e-df75-f2be-99cb-129b64158519
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               923.50 GB
  PE Size               4.00 MB
  Total PE              236416
  Alloc PE / Size       1 / 4.00 MB
  Free  PE / Size       236415 / 923.50 GB
  VG UUID               CMd31y-1Oyk-R2aA-kKem-dWis-0SJ7-KuhkVW

Create a new logical volume :

[root@xenserver-wou ~]# lvcreate -n l_ISO_images -L 100G VG_XenStorage-78bc399e-df75-f2be-99cb-129b64158519
  Logical volume "l_ISO_images" created

Create a filesystem (only ext2 & ext3 supported by XenServer) :

[root@xenserver-wou ~]# mkfs.ext3 /dev/VG_XenStorage-78bc399e-df75-f2be-99cb-129b64158519/l_ISO_images
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
13107200 inodes, 26214400 blocks
1310720 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 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, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Now, mount this filesystem :

  • create a mount point :
[root@xenserver-wou ~]# mkdir -p /var/xen/ISO_images
  • Mount this filesystem :
[root@xenserver-wou ~]# mount /dev/VG_XenStorage-78bc399e-df75-f2be-99cb-129b64158519/l_ISO_images /var/xen/ISO_images
  • This filesystem is there :
[root@xenserver-wou ~]# df -hT /var/xen/ISO_images
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/VG_XenStorage--78bc399e--df75--f2be--99cb--129b64158519-l_ISO_images
              ext3     99G  188M   94G   1% /var/xen/ISO_images

Keep this filesystem mounted on reboot :

  • Uncomment following lines in “/etc/rc.sysinit” script file :
    449         if [ -x /sbin/lvm.static ]; then
    450                 action $"Setting up Logical Volume Management:" /sbin/lvm.static vgchange -a y --ignorelockingfailure
    451         fi
  • Add entry in “/etc/fstab” :
[root@xenserver-wou ~]# grep ISO /etc/fstab
# for ISO images :
/dev/VG_XenStorage-78bc399e-df75-f2be-99cb-129b64158519/l_ISO_images    /var/xen/ISO_images     ext3    defaults        1       1

Create a new storage repository :

[root@xenserver-wou ~]# xe-mount-iso-sr /var/xen/ISO_images -o bind

Yes, we got it :

[root@xenserver-wou ~]# xe sr-list name-label="Remote ISO Library on: /var/xen/ISO_images"
uuid ( RO)                : f6bc8393-2952-4287-bcf9-3d32eb898999
          name-label ( RW): Remote ISO Library on: /var/xen/ISO_images
    name-description ( RW):
                host ( RO): xenserver-wou
                type ( RO): iso
        content-type ( RO): iso

Copy ISO images to this new SR

Using Bitvise sftp, we can copy ISO image to this filesystem. For example,  we copied some images :

[root@xenserver-wou ~]# ls -l /var/xen/ISO_images
total 8832464
-rw-r--r-- 1 root root 4329570304 Jan 14 11:57 CentOS-7-x86_64-DVD-1511.iso
drwx------ 2 root root      16384 May  8 10:54 lost+found
-rw-r--r-- 1 root root 4043309056 Apr 14 23:27 rhel-server-7.2-x86_64-dvd.iso
-rw-r--r-- 1 root root  662700032 Oct 27  2015 ubuntu-15.10-server-amd64.iso

Each time, we would like to create another virtual machine, we could use those images :

xennewSR

 

 

 

 

 

 

 

 

 

 

 

 

 

www.pdf24.org    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


*