Backlog #3871

UUID for disk attach

Added by Jimmy Goffaux about 4 years ago. Updated about 2 years ago.

Status:PendingStart date:07/09/2015
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Drivers - Monitor
Target version:Release 5.6

Description

Hello,

Is it possible to force the UUID when creating a disk and trace information in the UUID Sunstone? An example or disks are reversed :(

Basic :

root@techdayhost-1124:~# fdisk -l

Disk /dev/vda: 7 GiB
[......]

Add first disk by Sunstone :
Attach Disk => Volatile Disk => Type : FS, Format : ext4, Target :vdb

root@techdayhost-1124:~# fdisk -l

Disk /dev/vda: 7 GiB
[.....]

Disk /dev/vdb: 10 GiB,
[.....]

Add on 2nd disk on Sunstone :
Attach Disk => Volatile Disk => Type : FS, Format : ext4, Target :vdc, Size 15G

root@techdayhost-1124:~# fdisk -l

Disk /dev/vda: 7 GiB
[.....]

Disk /dev/vdb: 10 GiB,
[.....]
Disk /dev/vdc: 15 GiB,
[.....]
root@techdayhost-1124:~# blkid
/dev/vda1: UUID="c476e966-7e42-4987-8163-fc09943e0589" TYPE="ext4" PARTUUID="77fe1b99-01" 
/dev/sr0: UUID="2015-07-08-15-03-31-00" LABEL="CONTEXT" TYPE="iso9660" 
/dev/vdb: UUID="10a27673-4c64-471f-8ae4-b9a905f45000" TYPE="ext4" 
/dev/vdc: UUID="d3dcfeba-3d2c-4ece-a9d5-aef7484ca8da" TYPE="ext4

On XML virsh :

disk type='network' device='disk'>
[.. Ceph configuration rbd ..]
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
[..]
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
[..]
      <target dev='vdc' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>

Now Detach disk vdb on Sunstone

root@techdayhost-1124:~# fdisk -l

Disk /dev/vda: 7 GiB
[.....]

Disk /dev/vdc: 15 GiB,
[.....]
root@techdayhost-1124:~# blkid
/dev/vda1: UUID="c476e966-7e42-4987-8163-fc09943e0589" TYPE="ext4" PARTUUID="77fe1b99-01" 
/dev/sr0: UUID="2015-07-08-15-03-31-00" LABEL="CONTEXT" TYPE="iso9660" 
/dev/vdc: UUID="d3dcfeba-3d2c-4ece-a9d5-aef7484ca8da" TYPE="ext4" 

XML virsh :

    <disk type='network' device='disk'>
[.. Ceph configuration rbd ..]
        <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
[..]
      <target dev='vdc' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>

Now add new disk VDE :
Attach Disk => Volatile Disk => Type : FS, Format : ext4, Target :vde, Size 12G

View in Sunstone :

ID  Target  Image / Format-Size   Persistent  Save as   Actions   
0   vda   Debian Jessie 8   NO  -   Snapshot  Detach
3   vdc   15GB - ext4   NO  -   Detach
4   vde   12GB - ext4   NO  -   Detach

XML Virsh :

[.. Ceph configuration rbd ..]      
    <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
[..]
      <target dev='vdc' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
[.. vde ..]
      <target dev='vde' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

Now we have problems relationship:

root@techdayhost-1124:~# fdisk -l

Disk /dev/vda: 7 GiB,
[..]
Disk /dev/vdc: 15 GiB,
[..]
Disk /dev/vdb: 12 GiB,
[..]
root@techdayhost-1124:~# blkid
/dev/vda1: UUID="c476e966-7e42-4987-8163-fc09943e0589" TYPE="ext4" PARTUUID="77fe1b99-01" 
/dev/vdb: UUID="574d17a2-e7d9-4fd5-993c-5f28ebde675c" TYPE="ext4" 
/dev/sr0: UUID="2015-07-08-15-03-31-00" LABEL="CONTEXT" TYPE="iso9660" 
/dev/vdc: UUID="d3dcfeba-3d2c-4ece-a9d5-aef7484ca8da" TYPE="ext4" 

I decided to shut down the VM (POWEROFF) and start the VM .. The result is worse !!!

root@techdayhost-1124:~# fdisk -l

Disk /dev/vda: 7 GiB, 
[...]
Disk /dev/vdb: 15 GiB,
[...]
Disk /dev/vdc: 12 GiB,
[...]
root@techdayhost-1124:~# blkid 
/dev/vda1: UUID="c476e966-7e42-4987-8163-fc09943e0589" TYPE="ext4" PARTUUID="77fe1b99-01" 
/dev/vdb: UUID="d3dcfeba-3d2c-4ece-a9d5-aef7484ca8da" TYPE="ext4" 
/dev/sr0: UUID="2015-07-08-15-03-31-00" LABEL="CONTEXT" TYPE="iso9660" 
/dev/vdc: UUID="574d17a2-e7d9-4fd5-993c-5f28ebde675c" TYPE="ext4" 

vdb => vdc
vdc => vdb
vde ?

Imagine the size of the disks in Sunstone is the same one does not even know which drive is to be deleted: /

I hope you understand what I mean;)

Thank you !! ;)

History

#1 Updated by Ruben S. Montero about 4 years ago

  • Tracker changed from Feature to Backlog
  • Priority changed from Normal to High

#2 Updated by Javi Fontan over 2 years ago

  • Category set to Drivers - Monitor

The target given to libvirt is a hint to the OS but it's not forced to use that specific naming. That problem is caused because the systems fills the holes left in the storage bus identifiers.

There is not a simple and fast way to extract UUID from qcow2 images so this can not be generalized for both of the most used formats. Moreover the latest versions don't let you format the disk so this UUID or even label could not be assigned.

We will look into other ways of distinguishing the disk devices that could work for all the most common storage options.

#3 Updated by Javi Fontan over 2 years ago

  • Target version set to Release 5.4

#4 Updated by Ruben S. Montero about 2 years ago

  • Target version changed from Release 5.4 to Release 5.6

Also available in: Atom PDF