creation image for volume-backend instance should use volume size in image property 'min_disk'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Medium
|
bryan |
Bug Description
Description
===========
Currently, Nova is using disk size in flavor to set min_disk property in image when creating instance snapshot, even if it's a volume-backend instance. If disk size in flavor is bigger than volume size, there is a issue that Nova will raise "Volume is smaller than the minimum size specified in image metadata" when use this image to create a new instance.
Nova should set min_disk just using volume size if it's a volume-backend instance.
Steps to reproduce
==================
1. Create volume-backend instance with 1G size volume but flavor has 2G disk size.
2. Creation of instance is successful and then create a snapshot for this instance.
3. The image is created successfully, and the property min_disk of image is 2G.
4. Create a new instance by using this image.
Expected result
===============
The new instance created successfully.
Actual result
=============
Nova returns 400 error: " Volume is smaller than the minimum size specified in image metadata. Volume size is 1073741824 bytes, minimum size is 2147483648 bytes."
Environment
===========
commit 5f465e83e2c2987
Merge: c10ff21 19a52c9
Author: Jenkins <email address hidden>
Date: Mon Nov 14 21:26:07 2016 +0000
Merge "Remove ceph install/config functions from l-m hook"
hypervisor: libvirt+KVM
storage: LVM
Changed in nova: | |
assignee: | nobody → wanghao (wanghao749) |
Changed in nova: | |
assignee: | wanghao (wanghao749) → bryan (lcsong) |
Changed in nova: | |
assignee: | bryan (lcsong) → wanghao (wanghao749) |
Changed in nova: | |
assignee: | wanghao (wanghao749) → Matt Riedemann (mriedem) |
Changed in nova: | |
assignee: | Matt Riedemann (mriedem) → bryan (lcsong) |
I guess we could question what to do if there are multiple volumes attached to the instance when we create the snapshot, but I'd think we'd set the min_disk in the image meta based on the root volume's size.