~bgh/nova/qmanager-rbp-trunk

« back to all changes in this revision

Viewing changes to nova/virt/xenapi/vmops.py

  • Committer: Chris Behrens
  • Date: 2011-09-08 19:33:43 UTC
  • mfrom: (1534 nova)
  • mto: This revision was merged to the branch mainline in revision 1537.
  • Revision ID: cbehrens@codestud.com-20110908193343-mb620w60pm63xt6u
merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
                ramdisk = VMHelper.fetch_image(context, self._session,
189
189
                        instance, instance.ramdisk_id, instance.user_id,
190
190
                        instance.project_id, ImageType.RAMDISK)[0]
191
 
            # Create the VM ref and attach the first disk
192
 
            first_vdi_ref = self._session.call_xenapi('VDI.get_by_uuid',
193
 
                    vdis[0]['vdi_uuid'])
 
191
 
 
192
            # NOTE(jk0): Since vdi_type may contain either 'os' or 'swap', we
 
193
            # need to ensure that the 'swap' VDI is not chosen as the mount
 
194
            # point for file injection.
 
195
            first_vdi_ref = None
 
196
            for vdi in vdis:
 
197
                if vdi.get('vdi_type') != 'swap':
 
198
                    # Create the VM ref and attach the first disk
 
199
                    first_vdi_ref = self._session.call_xenapi(
 
200
                            'VDI.get_by_uuid', vdi['vdi_uuid'])
194
201
 
195
202
            vm_mode = instance.vm_mode and instance.vm_mode.lower()
196
203
            if vm_mode == 'pv':