When I fixed https://bugs.launchpad.net/nova/+bug/1478607
I found I can't remove those error instances which was failed when config xml.
This is because of following block:
https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L894
When nova try to destroy instance, it will cleanup relative resources.
if we enable serial console, nova will try to find ports, which was assigned to it, and release them.
But the instance was created failed, therefore nova will throw nova instance not found.
Yes, the block looks like it had handle instance not found exception.
But the function of "_get_serial_ports_from_instance" has yield keyword.
It will not raise exception immediately instead of raise exception when program try to iterator yielded items.
Therefore instance not found exception will been raised at L894 instead of L889.
You can checkout following sample code.
http://www.tutorialspoint.com/execute_python_online.php?PID=0Bw_CjBb95KQMU05ycERQdUFfcms
Fix proposed to branch: master /review. openstack. org/208268
Review: https:/