Hyper-V: destroying an instance can fail, having in-use files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Claudiu Belu | ||
compute-hyperv |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In some cases, destroying an instance can fail, having the instance log files still in-use.
This can happen in the following scenario:
1. The vm is powered on
2. The vm is requested to be destroyed shortly after (less than a few seconds). This driver will now attempt to stop the serial console workers, but none exist yet
3. The instance power on event callback is run, spawning the serial console workers
4. The instance is powered off as the destroy operation continues. The serial console workers are not explicitly stopped now. The instance serial port named pipe should be stopped now, which will cause the serial workers to stop themselves shortly after, but before this happens, the driver attempts to delete the instance files, while the console logs are still in use, which will fail.
Trace: http://
The easiest way to avoid this issue would be to simply retry deleting the instance files if this fails, also ensuring again that the console workers are stopped. Note that this is quite unlikely to happen in a real life deployment.
description: | updated |
Reviewed: https:/ /review. openstack. org/291825 /git.openstack. org/cgit/ openstack/ compute- hyperv/ commit/ ?id=1c16530da82 571cca666d30942 b11d558a92162d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1c16530da82571c ca666d30942b11d 558a92162d
Author: Lucian Petrut <email address hidden>
Date: Fri Mar 11 19:11:15 2016 +0200
Avoid starting serial console workers while deleting vm files
If an instance destroy request is received really quick after it was
powered on, this can fail, having the console log files in use.
This can happen if the instance power on event is received after the
destroy operation has started, which will spawn serial console workers
after the destroy operation tries to clean them up.
We can avoid this situation by simply ensuring that while we delete
the instance log files, the serial console workers are stopped and
no other workers will be spawned.
Change-Id: I3759b557d735cd e4391f94819a329 94dfb184702
Closes-Bug: #1556189