How to rename VDI/Virtual disk on XenServer Linux

Objective

The Virtual Machine creation using template provisioner may spawn unnamed VDI disks. Usually, the VID description states Created by template provisioner at most.
Example:

uuid ( RO)                : 093e128a-2632-43bd-bb45-8f864bc69d6f
          name-label ( RW): 0
    name-description ( RW): Created by template provisioner
             sr-uuid ( RO): 3ef7b35b-5d39-7414-0c91-bbb281b9a521
        virtual-size ( RO): 21474836480
            sharable ( RO): false
           read-only ( RO): false

The objective is to set a proper name and description to VDI disk.

Requirements

Privileged access to XenServer’s command line.

Difficulty

EASY

Instructions

Identify VDI disk’s UUID

In order to set a name and description we first need to identify VDI’s UUID. To do so run vdi-list:

# xe vdi-list

Take a note of the VID’s UUID you wish to set with new name and description to, eg. 093e128a-2632-43bd-bb45-8f864bc69d6f

Rename/Set name

Once we have a proper UUID of the XenServer’s VDI disk we wish to rename, we can use vdi-param-set to set a new name eg. Redhat7:

# xe vdi-param-set uuid=093e128a-2632-43bd-bb45-8f864bc69d6f name-label="Redhat7"

Update Description

Furthermore, we are also able to update VDI’s description:

# xe vdi-param-set uuid=093e128a-2632-43bd-bb45-8f864bc69d6f name-description="Redhat7 testing environment"

Confirm Changes

# xe vdi-list uuid=093e128a-2632-43bd-bb45-8f864bc69d6f
uuid ( RO)                : 093e128a-2632-43bd-bb45-8f864bc69d6f
          name-label ( RW): Redhat7
    name-description ( RW): Redhat7 testing environment
             sr-uuid ( RO): 3ef7b35b-5d39-7414-0c91-bbb281b9a521
        virtual-size ( RO): 21474836480
            sharable ( RO): false
           read-only ( RO): false


Comments and Discussions
Linux Forum