[RBD] Retyping of in-use boot volumes renders instances unusable (possible data corruption)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
New
|
Critical
|
Eric Harney | ||
Wallaby |
New
|
Critical
|
Unassigned | ||
OpenStack Compute (nova) |
New
|
Undecided
|
Unassigned |
Bug Description
While trying out the volume retype feature in cinder, we noticed that after an instance is
rebooted it will not come back online and be stuck in an error state or if it comes back
online, its filesystem is corrupted.
## Observations
Say there are the two volume types `fast` (stored in ceph pool `volumes`) and `slow`
(stored in ceph pool `volumes.hdd`). Before the retyping we can see that the volume
for example is present in the `volumes.hdd` pool and has a watcher accessing the
volume.
```sh
[ceph: root@mon0 /]# rbd ls volumes.hdd
volume-
[ceph: root@mon0 /]# rbd status volumes.
Watchers:
```
Starting the retyping process using the migration policy `on-demand` for that volume either
via the horizon dashboard or the CLI causes the volume to be correctly transferred to the
`volumes` pool within the ceph cluster. However, the watcher does not get transferred, so
nobody is accessing the volume after it has been transferred.
```sh
[ceph: root@mon0 /]# rbd ls volumes
volume-
[ceph: root@mon0 /]# rbd status volumes/
Watchers: none
```
Taking a look at the libvirt XML of the instance in question, one can see that the `rbd`
volume path does not change after the retyping is completed. Therefore, if the instance is
restarted nova will not be able to find its volume preventing an instance start.
#### Pre retype
```xml
[...]
<source protocol='rbd' name='volumes.
<host name='2001:
<host name='2001:
<host name='2001:
</source>
[...]
```
#### Post retype (no change)
```xml
[...]
<source protocol='rbd' name='volumes.
<host name='2001:
<host name='2001:
<host name='2001:
</source>
[...]
```
### Possible cause
While looking through the code that is responsible for the volume retype we found a function
`swap_volume` volume which by our understanding should be responsible for fixing the association
above. As we understand cinder should use an internal API path to let nova perform this action.
This doesn't seem to happen.
(`_swap_volume`: https:/
## Further observations
If one tries to regenerate the libvirt XML by e.g. live migrating the instance and rebooting the
instance after, the filesystem gets corrupted.
## Environmental Information and possibly related reports
We are running the latest version of TripleO Wallaby using the hardened (whole disk)
overcloud image for the nodes.
Cinder Volume Version: `openstack-
### Possibly related
- https:/
(might want to paste the above to a markdown file for better readability)
Changed in cinder: | |
importance: | Medium → Critical |
Changed in cinder: | |
assignee: | nobody → Eric Harney (eharney) |
Hello Alexander Käb,
To clarify:
- (double check) Are instances created from volumes, or are volumes attached to an instance? Can you share the command you are using to do this (steps).
- Is the data on the volumes encrypted?
- Have you encountered any errors in the cinder c-vol logs? Could you share the c-vol log?
Thanks!