Comment 38 for bug 1560965

Revision history for this message
eblock@nde.ag (eblock) wrote :

I have to revoke my statement about the failing patch, it does work if it's image -> volume. Unfortunately, none of the suggested patches (in #16, #20) for volume -> volume work for me, I have tried it in different ways and also in combination, nothing works and nova-api reports an error like this:

HTTP exception thrown: Can not find requested image

My current setFinalSpecBootFromVolumeDevice:

---cut here---
    function setFinalSpecBootFromVolumeDevice(finalSpec, sourceType) {
      if (finalSpec.vol_create) {
        // Specify null to get Autoselection (not empty string)
        var deviceName = finalSpec.vol_device_name ? finalSpec.vol_device_name : null;
        finalSpec.block_device_mapping_v2 = [];
        if (finalSpec.vol_device_name==='NOTSET'){
          finalSpec.block_device_mapping_v2.push(
            {
              'source_type': bootSourceTypes.VOLUME,
              'destination_type': bootSourceTypes.VOLUME,
              'delete_on_termination': finalSpec.vol_delete_on_instance_delete,
              'uuid': finalSpec.source_id,
              'boot_index': '0',
              'volume_size': finalSpec.vol_size
            }
          );
        }
        else {
          finalSpec.block_device_mapping_v2.push(
            {
              'device_name': deviceName,
              'source_type': bootSourceTypes.VOLUME,
              'destination_type': bootSourceTypes.VOLUME,
              'delete_on_termination': finalSpec.vol_delete_on_instance_delete,
              'uuid': finalSpec.source_id,
              'boot_index': '0',
              'volume_size': finalSpec.vol_size
            }
          );
      }
      finalSpec.source_id = null;
    }
  }
---cut here---

I'm not sure what I have to change here to make it work. At least image -> volume works again.