storage pools - dianaclarke/openstack-notes GitHub Wiki

An 'image' in this code refers either to the thing which glance stores, or an instance's disk. This is confusing in any case, and especially confusing when the word has both meanings in the same block of code, for example in create_image (which downloads a glance image and creates an instance disk, which it also calls an image). Image in the latter context has come about because that's what libvirt calls it. However, as it's overloaded in nova we should never have used it. At some point I'd like to rename these all to 'disk'. --https://review.openstack.org/#/c/270998/

  • Read this commit to understand the motivation:

The libvirt driver was calling images.convert_image during snapshot to convert snapshots to the intended output format. However, this function does not take the input format as an argument, meaning it implicitly does format detection. This opened an exploit for setups using raw storage on the backend, including raw on filesystem, LVM, and RBD (Ceph). An authenticated user could write a qcow2 header to their instance's disk which specified an arbitrary backing file on the host. When convert_image ran during snapshot, this would then write the contents of the backing file to glance, which is then available to the user. If the setup uses an LVM backend this conversion runs as root, meaning the user can exfiltrate any file on the host, including raw disks. --Fix format conversion in libvirt snapshot

Each instance needs at least one root disk (that contains the bootloader and core operating system files), and may have optional ephemeral disk (per the definition of the flavor selected at instance creation time). The content for the root disk either comes from an image stored within the Glance repository (and copied to storage attached to the destination hypervisor) or from a persistent block storage volume (via Cinder). For more information on the root disk strategies available during instance creation, refer to the section called “Root Disk Choices When Booting Nova Instances”. -- http://netapp.github.io/openstack-deploy-ops-guide/icehouse/content/section_nova-key-concepts.html

  • Missing local root disk

Reader beware: unlike BDMs, block_device_info does not represent all disks that an instance might have. Significantly, it will not contain any representation of an image-backed local disk, i.e. the root disk of a typical instance which isn't boot-from-volume. Other representations used by the libvirt driver explicitly reconstruct this missing disk. I assume other drivers must do the same. -- http://lists.openstack.org/pipermail/openstack-dev/2016-June/097529.html