diff options
| author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-02-03 18:03:39 +0000 |
|---|---|---|
| committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-02-03 18:04:26 +0000 |
| commit | 8f5039615826539dca4e5532185d6c03e386dd87 (patch) | |
| tree | 13434010059b23e925b3aba8547034cbc3a63dbc /nova | |
| parent | 8ac1b20fef00f58bbbe45ac7bdb37a0c1f4bd47d (diff) | |
| download | nova-8f5039615826539dca4e5532185d6c03e386dd87.tar.gz nova-8f5039615826539dca4e5532185d6c03e386dd87.tar.xz nova-8f5039615826539dca4e5532185d6c03e386dd87.zip | |
Delete swap VDI if not used
Fixes bug 889196
Change-Id: I08f4484310c5a35e62ca761193790a464ad15ac9
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index c7f713ea2..139eb3262 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -418,10 +418,14 @@ class VMOps(object): # Attach any other disks for vdi in vdis[1:]: - if generate_swap and vdi['vdi_type'] == 'swap': - continue vdi_ref = self._session.call_xenapi('VDI.get_by_uuid', vdi['vdi_uuid']) + + if generate_swap and vdi['vdi_type'] == 'swap': + # We won't be using it, so don't let it leak + VMHelper.destroy_vdi(self._session, vdi_ref) + continue + VolumeHelper.create_vbd(session=self._session, vm_ref=vm_ref, vdi_ref=vdi_ref, userdevice=userdevice, bootable=False) |
