Instance uses base image file when it is rebooted after snapshot creation if cinder nfs backend is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
Gorka Eguileor |
Bug Description
Description
===========
When we use nfs backend in cinder and attach a cinder volume to an instance, the instance access to the file in nfs share, which is named like volume-<volume id>.
When the volume is attached to an instance and we take snapshot with "openstack volume snapshot create <volume> --force", it will create the following 3 files in nfs share.
(1) volume-<volume id>
base image freezed when taking snapshot
(2) volume-<volume id>-<snapshot id>
diff image where instance should write into after taking snapshot
(3) volume-<volume id>.info
json file to manage active snapshot
As described above, after taking snapshot, the instance should write into (2) volume-<volume id>-<snapshot id> .
It works just after taking snapshot, but if we stop and start the instance, the instance starts to write into (1) volume-<volume id>, which it should not modify.
Steps to reproduce
==================
1. Create a volume in cinder nfs backend
2. Create a bfv instance with the volume
3. Take snapshot of the volume
4. Stop and Start the instance
Expected result
===============
The instance keeps writing into volume-<volume id>-<snapshot id>
Actual result
=============
The instance writes into volume-<volume id>
Environment
===========
I reproduced the issue with Queens release with
nova: libvirt driver
cinder: nfs backed, with nfs_snapshot_
As far as I see the implementation about file path handling, I don't see any changes in the way how we handle disk file path for nfs backend, so the problem should be reproduced with master.
Logs & Configs
==============
N/A
tags: | added: volumes |
Changed in nova: | |
importance: | Undecided → Medium |
assignee: | nobody → Lee Yarwood (lyarwood) |
Changed in cinder: | |
assignee: | nobody → Lee Yarwood (lyarwood) |
Changed in cinder: | |
status: | New → In Progress |
Changed in nova: | |
status: | New → In Progress |
no longer affects: | nova |
Changed in cinder: | |
assignee: | Lee Yarwood (lyarwood) → nobody |
Changed in cinder: | |
assignee: | nobody → Gorka Eguileor (gorka) |
By definition, a snapshot is an immutable object that shouldn't modified after being created.
I'm surprised you say you can see some writes to the snapshot just after creating it. How do you know this ? By looking at the QEMU command line or lsof/strace() it ?
To be clear, I think it's an invalid bug if you want to write the snapshot, but if you found some way to write the snapshot, then it could be a bug.
Punting the status to Invalid, but please modify the bug status back to New once you reply.