objects: add os_require_quiesce image property

The compute api and libvirt driver both use the image meta
property os_require_quiesce to determine if snapshots are
permitted without quiescing the guest filesystems. This
was missed from the original ImageMetaProps object impl.

Change-Id: Iebf77be0db01ffd740c1c7560fc57c7ab91ae632
This commit is contained in:
Daniel P. Berrange 2015-06-04 11:26:30 +01:00
parent 593fe1a92f
commit 9491f8be82
2 changed files with 14 additions and 5 deletions

View File

@ -23,7 +23,9 @@ from nova.virt import hardware
@base.NovaObjectRegistry.register
class ImageMeta(base.NovaObject):
VERSION = '1.0'
# Version 1.0: Initial version
# Version 1.1: updated ImageMetaProps
VERSION = '1.1'
# These are driven by what the image client API returns
# to Nova from Glance. This is defined in the glance
@ -56,7 +58,8 @@ class ImageMeta(base.NovaObject):
}
obj_relationships = {
'properties': [('1.0', '1.0')],
'properties': [('1.0', '1.0'),
('1.1', '1.1')],
}
@classmethod
@ -101,6 +104,8 @@ class ImageMeta(base.NovaObject):
@base.NovaObjectRegistry.register
class ImageMetaProps(base.NovaObject):
# Version 1.0: Initial version
# Version 1.1: added os_require_quiesce field
VERSION = ImageMeta.VERSION
# 'hw_' - settings affecting the guest virtual machine hardware
@ -268,6 +273,10 @@ class ImageMetaProps(base.NovaObject):
# leave it freeform
'os_distro': fields.StringField(),
# boolean - if true, then guest must support disk quiesce
# or snapshot operation will be denied
'os_require_quiesce': fields.FlexibleBooleanField(),
# boolean - if using agent don't inject files, assume someone else is
# doing that (cloud-init)
'os_skip_agent_inject_files_at_boot': fields.FlexibleBooleanField(),

View File

@ -1111,8 +1111,8 @@ object_data = {
'FloatingIP': '1.6-52a67d52d85eb8b3f324a5b7935a335b',
'FloatingIPList': '1.7-bdd31ccd6ff9bb0d290108397b3cd44c',
'HVSpec': '1.0-3999ff70698fc472c2d4d60359949f6b',
'ImageMeta': '1.0-642d1b2eb3e880a367f37d72dd76162d',
'ImageMetaProps': '1.0-5bc6f1e8631059bd6a3ae7d15dcddc4c',
'ImageMeta': '1.1-642d1b2eb3e880a367f37d72dd76162d',
'ImageMetaProps': '1.1-8fe09b7872538f291649e77375f8ac4c',
'Instance': '1.20-260d385315d4868b6397c61a13109841',
'InstanceAction': '1.1-f9f293e526b66fca0d05c3b3a2d13914',
'InstanceActionEvent': '1.1-e56a64fa4710e43ef7af2ad9d6028b33',
@ -1176,7 +1176,7 @@ object_relationships = {
'VirtualInterface': '1.0',
'FloatingIPList': '1.7'},
'FloatingIP': {'FixedIP': '1.10'},
'ImageMeta': {'ImageMetaProps': '1.0'},
'ImageMeta': {'ImageMetaProps': '1.1'},
'Instance': {'InstanceFault': '1.2',
'InstanceInfoCache': '1.5',
'InstanceNUMATopology': '1.1',