How to change the Storage Repository label for Xen XCP-ng

A short note on How to change the Storage Repository label for Xen XCP-ng.

While creating a new storage repository I had done a quick copy / paste without noticing that the pasted double quotes surrounding the volume label were not accepted and converted to the ? mark character.

This is what I pasted:

xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-3600508b400dc45c8k47fe45763a27qq8-part1 host-uuid=19458bfa-48e3-42d1-b345-266j6fdq4ed6f name-label=”Local Storage 2” shared=false type=lvm

but this is what appeared and I hit enter before realising the change (look for the ? marks towards the end in the name-label parameter):

xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-3600508b400dc45c8k47fe45763a27qq8-part1 host-uuid=19458bfa-48e3-42d1-b345-266j6fdq4ed6f name-label=?Local Storage 2? shared=false type=lvm

and what I ended up with was

uuid ( RO) : ff2c5f2e-9v8c-45j4-bxc0-50a338qe63ac
name-label ( RW): ?Local <--- this is wrong / ugly
name-description ( RW):
host ( RO): my-svr-name
type ( RO): lvm
content-type ( RO): user

To correct it, and add a longer description I used:

xe sr-param-set uuid=ff2c5f2e-9v8c-45j4-bxc0-50a338qe63ac name-label="Local Storage 2"

…and…..

xe sr-param-set uuid=ff2c5f2e-9v8c-45j4-bxc0-50a338qe63ac name-description="RAID Drives 4,5,6,7"

Which results in a final check as

uuid ( RO) : ff2c5f2e-9v8c-45j4-bxc0-50a338qe63ac
name-label ( RW): Local Storage 2
name-description ( RW): RAID Drives 4,5,6,7
host ( RO): my-svr-name
type ( RO): lvm
content-type ( RO): user

In case you are wondering, all the uuid’s have been changed to protect the innocent and no face masks were harmed in the making of this post…. (if you are reading this in a few years, then the face mask reference may be obscure. 2020 the year that never was.)

Leave a Reply

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