vm images are not removed from XenServer storage when euca-terminate-instance is executed

Bug #676128 reported by Armando Migliaccio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Armando Migliaccio

Bug Description

This is a known issue; when an instance is terminated, we need to make sure that the VM's image is deleted from whichever storage the vm is attached to.

Changed in nova:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
Itai Frenkel (itaifrenkel) wrote :

Here's the code in Java (sorry don't have it in python)

// The tricky part in destroying a VM, is to find the disks before terminating
// the machine, and delete the disks after terminating the machine.
// find vm's virtuaL disks
List<VDI> virtualDiskImagesToDelete = new ArrayList<VDI>();
for (VBD vbd : VBD.getAll(connection)) {
  if (vbd.getVM(connection).equals(vm) {
    VDI vdi = vbd.getVDI(connection);
    if (!vdi.getReadOnly(connection)) {
      virtualDiskImagesToDelete.add(vdi);
    }
  }
}

// destroy vm and disks
vm.destroy(connection);
for (VDI vdi : virtualDiskImagesToDelete) {
  vdi.destroy(connection);
}

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Hi Itai,

I'll look into this soon. Thanks for your input!

Changed in nova:
status: New → In Progress
Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
status: Fix Committed → Fix Released
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.