← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1383626] Re: boot from image(create a new volume) lost image property

 

[Expired for OpenStack Compute (nova) because there has been no activity
for 60 days.]

** Changed in: nova
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1383626

Title:
  boot from image(create a new volume) lost image property

Status in OpenStack Compute (Nova):
  Expired

Bug description:
  when we create a instance by boot from image(create a new volume), if the image has one or more property, it will boot without the property.
  for example, we add a property 'hw_qemu_guest_agent=yes' on image ubt1204,
   Property | Value |
  +--------------------------------+--------------------------------------+
  | Property 'hw_qemu_guest_agent' | yes |
  | checksum | 2823c8bf0336349b23f20fb75ec60626 |
  | container_format | bare |
  | created_at | 2014-10-15T09:07:31 |
  | deleted | False |
  | disk_format | raw |
  | id | 92811d87-d905-4ef4-b173-c7a17805cf9b |
  | is_public | False |
  | min_disk | 0 |
  | min_ram | 0 |
  | name | qga-ubt1404 |
  | owner | b85e1c03b2c84e079417d57ffce97751 |
  | protected | False |
  | size | 5368709120 |
  | status | active |
  | updated_at | 2014-10-15T09:08:54

  then,we create a instance on horizon by boot from image(create a new volume), in the libvirt.xml of this instance, it doesn't contain below config:
  <channel type="unix">
        <source path="/var/lib/libvirt/qemu/org.qemu.guest_agent.0.instance-000000a4.sock" mode="bind"/>
        <target type="virtio" name="org.qemu.guest_agent.0"/>
    </channel>

  and if we create a instance by boot from image, the libvirt.xml
  contain the above config

  I read the code and found :
  if we create a instance by boot from image(create a new volume), image_ref in instance is null, below is the code to create libvirt.xml:
      def to_xml(self, context, instance, network_info, disk_info,
                 image_meta=None, rescue=None,
                 block_device_info=None, write_to_disk=False):
          # We should get image metadata everytime for generating xml
          if image_meta is None:
              (image_service, image_id) = glance.get_remote_image_service(
                                              context, instance['image_ref'])
              image_meta = compute_utils.get_image_metadata(
                                  context, image_service, image_id, instance)
          # NOTE(danms): Stringifying a NetworkInfo will take a lock. Do
          # this ahead of time so that we don't acquire it while also
          # holding the logging lock.
          network_info_str = str(network_info)
          LOG.debug(_('Start to_xml '
                      'network_info=%(network_info)s '
                      'disk_info=%(disk_info)s '
                      'image_meta=%(image_meta)s rescue=%(rescue)s'
                      'block_device_info=%(block_device_info)s'),
                    {'network_info': network_info_str, 'disk_info': disk_info,
                     'image_meta': image_meta, 'rescue': rescue,
                     'block_device_info': block_device_info})
          conf = self.get_guest_config(instance, network_info, image_meta,
                                       disk_info, rescue, block_device_info)
          xml = conf.to_xml()

          if write_to_disk:
              instance_dir = libvirt_utils.get_instance_path(instance)
              xml_path = os.path.join(instance_dir, 'libvirt.xml')
              libvirt_utils.write_to_file(xml_path, xml)

          LOG.debug(_('End to_xml instance=%(instance)s xml=%(xml)s'),
                    {'instance': instance, 'xml': xml})
          return xml

  image_ref is null so it can't generate full libvirt.xml

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1383626/+subscriptions


References