Merge "when launch instance image size changed, device_size not change"

This commit is contained in:
Jenkins 2015-01-28 17:35:37 +00:00 committed by Gerrit Code Review
commit b39f6726ec
2 changed files with 5 additions and 1 deletions

View File

@ -218,6 +218,9 @@ horizon.addInitFunction(horizon.instances.init = function () {
if (image !== undefined && image.min_disk > volume_size) {
volume_size = image.min_disk;
}
if (image !== undefined && image.size > volume_size) {
volume_size = image.size;
}
// If the user has manually changed the volume size, do not override
// unless user-defined value is too small.

View File

@ -393,7 +393,8 @@ class SetInstanceDetailsAction(workflows.Action):
if images is not None:
attrs = [{'id': i.id,
'min_disk': getattr(i, 'min_disk', 0),
'min_ram': getattr(i, 'min_ram', 0)}
'min_ram': getattr(i, 'min_ram', 0),
'size': functions.bytes_to_gigabytes(i.size)}
for i in images]
extra['images'] = json.dumps(attrs)