Expose persistent serial numbers for local disks

Registered by Matthew Booth on 2017-10-11

A guest querying the hardware properties of a disk will currently see a serial number for a volume, but not for a local disk (local root, ephemeral, or swap). This feature will add a persistent serial number for local disks.

Blueprint information

Status:
Started
Approver:
Matt Riedemann
Priority:
Low
Drafter:
Matthew Booth
Direction:
Needs approval
Assignee:
Matthew Booth
Definition:
Pending Approval
Series goal:
None
Implementation:
Needs Code Review
Milestone target:
None
Started by
Matt Riedemann on 2017-12-01

Related branches

Sprints

Whiteboard

Serial numbers for volumes are simply the volume id. Local disks don't have a unique id, so we will use the SHA256 of '<instance-uuid><bdm id>'.

We could localise the change to the libvirt driver, but to make the logic available to all drivers we will add a serial number to DriverBlockDevice.

An added complication is that for legacy reasons we don't pass a DriverBlockDevice for a local root disk to the driver. We will add this to the block_device_info dict as 'root'.

The change is local to the compute host, and has no RPC or upgrade implications. Newly created, rebooted, or migrated guests will automatically get serial numbers for their local disks.

Gerrit topic: https://review.openstack.org/#q,topic:local-disk-serial-numbers,n,z

Addressed by: https://review.openstack.org/511466
    Add serial numbers for local disks

Approved for Queens. -- mriedem 20171019

Gerrit topic: https://review.openstack.org/#q,topic:bp/local-disk-serial-numbers,n,z

Addressed by: https://review.openstack.org/524126
    Remove unused global variables

Addressed by: https://review.openstack.org/524127
    Add uuid field to BlockDeviceMapping

Addressed by: https://review.openstack.org/524167
    DriverBlockDevice: make subclasses inherit _proxy_as_attr

Gerrit topic: https://review.openstack.org/#q,topic:bug/1489581,n,z

Addressed by: https://review.openstack.org/242602
    Add uuid column to BlockDeviceMapping

Addressed by: https://review.openstack.org/242603
    Make BlockDeviceMapping object support uuid

Addressed by: https://review.openstack.org/525599
    Add an online migration for BDM.uuid

Addressed by: https://review.openstack.org/526346
    Give volume DriverBlockDevice classes a common prefix

Addressed by: https://review.openstack.org/526347
    Add DriverLocalImageBlockDevice

Addressed by: https://review.openstack.org/528362
    Expose driver_block_device fields as attributes

Addressed by: https://review.openstack.org/528363
    Pass DriverBlockDevice to driver.attach_volume

Addressed by: https://review.openstack.org/529028
    Rename block_device_info_get_root

Addressed by: https://review.openstack.org/529029
    Add local_root to block_device_info

Addressed by: https://review.openstack.org/529037
    Expose BDM uuid to drivers

Addressed by: https://review.openstack.org/527916
    Use real block_device_info data in test_blockinfo

Addressed by: https://review.openstack.org/529328
    Fix libvirt volume tests passing invalid disk_info

Addressed by: https://review.openstack.org/529329
    Pass disk_info dict to libvirt_info

Addressed by: https://review.openstack.org/529380
    Local disk serial numbers for the libvirt driver

Addressed by: https://review.openstack.org/530774
    Add test for assignment of uuid to a deleted BDM

Addressed by: https://review.openstack.org/530786
    Expose volume host type and path independent of libvirt config

Addressed by: https://review.openstack.org/530787
    Don't generate fake disk_info in swap_volume

Addressed by: https://review.openstack.org/531179
    Remove redundant swap_volume tests

Sorry but we're now past feature freeze for Queens. Please re-propose the spec for Rocky and we'll try to get this merged early in the first milestone. -- mriedem 20180126

Addressed by: https://review.openstack.org/556565
    Add serial numbers for local disks

Re-approved for Rocky. -- mriedem 20180327

Addressed by: https://review.openstack.org/567277
    Rename block_device_info_get_root_device

We're past feature freeze for Rocky, so this must be deferred. Please re-propose the spec for Stein if you'd like to work on it next cycle. -- melwitt 20180727

Addressed by: https://review.openstack.org/595247
    Add serial numbers for local disks

Re-approved for Stein. -- mriedem 20180906

This did not complete in the Stein release so I am deferring to the Train release. Remember to re-propose the spec for Train as necessary: https://specs.openstack.org/openstack/nova-specs/readme.html#previously-approved-specifications -- mriedem 20190311

Gerrit topic: https://review.opendev.org/#/q/topic:bp/local-disk-serial-numbers

Addressed by: https://review.opendev.org/669081
    Give volume DriverBlockDevice classes a common prefix

Deferring this out of Train since it wasn't re-approved and we're about 2 weeks from feature freeze. -- mriedem 20190829

(?)

Work Items

Work items:
Add a DriverBlockDevice class for local disks from image: TODO
Add 'root' to block_device_info: TODO
Add 'serial' to all DriverBlockDevice classes: TODO
Expose serial for local disks in libvirt driver: TODO

This blueprint contains Public information 
Everyone can see this information.