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

Bug #1383542 reported by zx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Expired
Undecided
Unassigned

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

Changed in horizon:
assignee: nobody → Ritesh (rsritesh)
Andy Yan (yanchao3)
Changed in horizon:
status: New → Confirmed
status: Confirmed → New
Changed in horizon:
assignee: Ritesh (rsritesh) → nobody
Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

There are no clear directions for how to reproduce this in horizon. The code samples are not from horizon, either. Can you confirm that this is still a problem, and if so, how I can reproduce and verify that it is a problem?

Changed in horizon:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in horizon:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.