preload
Nov 28

You can add more space to Xen storage repository. In this example I use local lvm storage repository.

Find the  one you want to resize:

[root@xen ~]# xe vdi-list name-label=Pool\ Metadata\ Backup sr-name-label=Local\ storage
uuid ( RO)                : c73d9724-a284-4caa-9da9-167a8b8b9389
name-label ( RW): Pool Metadata Backup
name-description ( RW):
sr-uuid ( RO): 243a9532-0a89-d406-d813-855a0350ebeb
virtual-size ( RO): 262144000
sharable ( RO): false
read-only ( RO): false

Resize the VDI:

[root@xen ~]# xe vdi-resize uuid=c73d9724-a284-4caa-9da9-167a8b8b9389 disk-size=524288000

See that the size has changed:

[root@xen ~]# xe vdi-list name-label=Pool\ Metadata\ Backup sr-name-label=Local\ storage
uuid ( RO)                : c73d9724-a284-4caa-9da9-167a8b8b9389
name-label ( RW): Pool Metadata Backup
name-description ( RW):
sr-uuid ( RO): 243a9532-0a89-d406-d813-855a0350ebeb
virtual-size ( RO): 524288000
sharable ( RO): false
read-only ( RO): false

Mount it:

[root@xen ~]# xe-backup-metadata -d -u 243a9532-0a89-d406-d813-855a0350ebeb
Using SR: Local storage
Mounted backup VDI on: /var/run/pool-backup-c73d9724-a284-4caa-9da9-167a8b8b9389
Press ^D to exit shell and safely detach it.

Verify it:

[root@xen ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             3.8G  2.2G  1.5G  61% /
none                  376M     0  376M   0% /dev/shm
/dev/xvda             243M  6.8M  223M   3% /var/run/pool-backup-c73d9724-a284-4caa-9da9-167a8b8b9389

Resize it:

[root@xen ~]# resize2fs /dev/xvda
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/xvda is mounted on /var/run/pool-backup-c73d9724-a284-4caa-9da9-167a8b8b9389; on-line resizing required
Performing an on-line resize of /dev/xvda to 512000 (1k) blocks.
The filesystem on /dev/xvda is now 512000 blocks long.

And you are done:

[root@xen ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             3.8G  2.2G  1.5G  61% /
none                  376M     0  376M   0% /dev/shm
/dev/xvda             485M  7.1M  453M   2% /var/run/pool-backup-c73d9724-a284-4caa-9da9-167a8b8b9389

6 Responses to “Resize Xenserver storage metadata backup partition”

  1. Bruce Says:

    Hi.

    How can mount /var/run/pool-backup-xxxxxxxxx? since i don’t have that by default
    and how would i add filesystem /dev/xvda since by default also the xenserver root doesn’t have that. I would like to mount another file system to xenserver root to store my backup files?

    Hope you may help me with this…Thanks!

  2. mceith Says:

    Do you mean that you want to add physical disk to xenserver host and use it as backup storage?

    You should be able to do so as you would with normal linuxbox. The disk should show as /dev/sdX and you would have to make ext3 filesystem to it etc.

    My post was about resizing metadata backup partition on NFS SR. The default 250M is not enough because we also backup individual VM metadata.

  3. Bruce Says:

    Thanks mceith for the reply.

    Actually i have already did the attachment of new device storage to xenserver root and i saw it fine.

    But, aside from that I want to create partition that belongs to the LVM that a xenserver root can access so that my backup data will be stored to that dedicated partition? i dont know if that is possible.

    I suspect two issues:
    Either create local storage from LVM in the same disk added if possible the xenserver host can acess that storage and increase the size of root partition in the xenserver root?

    Thanks the help.

  4. mceith Says:

    If you have it as Local storage repository and you want to use it as VBD from “dom0” here how its done:


    [root@xen ~]# xe sr-list name-label=Local\ storage params=uuid --minimal
    243a9532-0a89-d406-d813-855a0350ebeb
    [root@xen ~]# xe vdi-create name-label=backup_disk sr-uuid=243a9532-0a89-d406-d813-855a0350ebeb virtual-size=1024000000 type=system
    2094b26b-b5c9-4a54-862d-b3a33ab94663
    [root@xen ~]# xe vm-list name-label=Control\ domain\ on\ host:\ xen.domain params=uuid --minimal
    ca80e24c-3167-459c-9c9d-d2737226bf0c
    [root@xen ~]# xe vbd-create vm-uuid=ca80e24c-3167-459c-9c9d-d2737226bf0c vdi-uuid=2094b26b-b5c9-4a54-862d-b3a33ab94663 device=1
    0420571b-4b66-62c2-f31f-782f0cdbe740
    [root@xen ~]# xe vbd-plug uuid=0420571b-4b66-62c2-f31f-782f0cdbe740
    [root@xen ~]# xe vbd-list uuid=0420571b-4b66-62c2-f31f-782f0cdbe740 params=device --minimal
    xvdb
    [root@xen ~]# fdisk -l /dev/xvdb

    Disk /dev/xvdb: 1025 MB, 1025507328 bytes
    255 heads, 63 sectors/track, 124 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/xvdb doesn't contain a valid partition table
    [root@xen ~]#

    /dev/xvdb is now VBD on xenhost or “dom0”. You can unplug it an plug it to VM guest with same method.

  5. Bruce Says:

    You’re such an awesome guy with the best how-to and knowledge. I can’t tell you the many ways how you’ve tremendously helped me in overcoming this particular setup. It works really fine in my Xen box. Now, i have my new partition in Xen-Host used to store my backup files.

    If you dont mind sir, what national are you? You have been working with Xen for more than a couple of years already?

    Thanks again for your help! Good job sir. 😀

  6. mceith Says:

    Nice that my howto did actually help someone 🙂 I am from Finland and have used Citrix XenServer since version 4. Recently though i have been looking into Solaris zones and containers. ZFS just is so superior 🙂

Leave a Reply

You must be logged in to post a comment.