[SRU] Virsh disk attach errors silently ignored
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Lee Yarwood | ||
Queens |
Fix Committed
|
Medium
|
Lee Yarwood | ||
Rocky |
Fix Committed
|
Medium
|
Lee Yarwood | ||
Stein |
Fix Committed
|
Medium
|
Lee Yarwood | ||
Ubuntu Cloud Archive |
Fix Released
|
Medium
|
Sahid Orentino | ||
Queens |
Fix Released
|
Medium
|
Unassigned | ||
Rocky |
Fix Released
|
Medium
|
Unassigned | ||
Stein |
Fix Released
|
Medium
|
Sahid Orentino | ||
nova (Ubuntu) |
Fix Released
|
Medium
|
Sahid Orentino | ||
Bionic |
Fix Released
|
Medium
|
Sahid Orentino | ||
Cosmic |
Fix Released
|
Medium
|
Sahid Orentino | ||
Disco |
Fix Released
|
Medium
|
Sahid Orentino |
Bug Description
[Impact]
The following commit (1) is causing volume attachments which fail due to libvirt device attach erros to be silently ignored and Nova report the attachment as successful.
It seems that the original intention of the commit was to log a condition and re-raise the exeption, but if the exception is of type libvirt.
In our case we had ceph/apparmor configuration problems in compute nodes which prevented virsh attaching the device; volumes appeared as successfully attached but the corresponding block device missing in guests VMs. Other libvirt attach error conditions are ignored also, as when you have already occuppied device names (i.e. 'Target vdb already exists', device is busy, etc.)
(1) https:/
[Test Case]
* Deploy any OpenStack version up to Pike , which includes ceph backed cinder
* Create a guest VM (openstack server ...)
* Create a test cinder volume
$ openstack volume create test --size 10
* Force a drop on ceph traffic. Run the following command on the nova hypervisor on which the server runs.
$ iptables -A OUTPUT -d ceph-mon-addr -p tcp --dport 6800 -j DROP
* Attach the volume to a running instance.
$ openstack server add volume 7151f507-
* This should cause the volume attachment to fail
$ virsh domblklist instance-xxxxx
Target Source
-------
vda nova/7151f507-
No volume should attached after this step.
* If the behavior is fixed:
* Check that openstack server show , doesn't displays the displays the volume as attached.
* Check that proper log entries states the libvirt exception and error.
* If the behavior isn't fixed:
* openstack server show <ID> , will display the volume in the volumes_attached property.
[Expected result]
* Volume attach fails and a proper exception is logged.
[Actual result]
* Volume attach fails but remains connected to the host and no further
exception gets logged.
[Regression Potential]
* The patches have been cherry-picked from upstream which helps to reduce the regression potential of these fixes.
[Other Info]
* N/A
Description
tags: | added: libvirt |
description: | updated |
summary: |
- Virsh disk attach errors silently ignored + [SRU] Virsh disk attach errors silently ignored |
Changed in nova (Ubuntu Disco): | |
status: | New → Triaged |
Changed in nova (Ubuntu Cosmic): | |
status: | New → Triaged |
Changed in nova (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in nova (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in nova (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in nova (Ubuntu Cosmic): | |
importance: | Undecided → Medium |
Changed in nova (Ubuntu Disco): | |
importance: | Undecided → Medium |
Changed in cloud-archive: | |
assignee: | nobody → Sahid Orentino (sahid-ferdjaoui) |
Changed in nova (Ubuntu): | |
assignee: | nobody → Sahid Orentino (sahid-ferdjaoui) |
Changed in nova (Ubuntu Bionic): | |
assignee: | nobody → Sahid Orentino (sahid-ferdjaoui) |
Changed in nova (Ubuntu Disco): | |
assignee: | nobody → Sahid Orentino (sahid-ferdjaoui) |
Changed in nova (Ubuntu Cosmic): | |
assignee: | nobody → Sahid Orentino (sahid-ferdjaoui) |
description: | updated |
tags: | added: sts-sru-needed |
tags: | added: sts |
Yeah indeed it looks like the raise was used improperly. Probably a better thing to do here would be to use the excutils. save_and_ reraise_ exception( ) which provides a context manager that you can control if the exception should be re-raised or not.