Prevent the migration of VM with 'optimize' False in VM metadata
This patch adds the functionality to filter out VMs which have metadata field 'optimize' set to False. This patch implements the functionality for basic_consolidation strategy. Change-Id: Iaf7b63e09534e4a67406e7f092242558b78c0bde Partially-Implements: BP audit-tag-vm-metadata
This commit is contained in:
@@ -48,7 +48,7 @@ class Instance(compute_resource.ComputeResource):
|
||||
"disk": wfields.IntegerField(),
|
||||
"disk_capacity": wfields.NonNegativeIntegerField(),
|
||||
"vcpus": wfields.NonNegativeIntegerField(),
|
||||
"metadata": wfields.DictField(),
|
||||
"metadata": wfields.JsonField(),
|
||||
}
|
||||
|
||||
def accept(self, visitor):
|
||||
|
||||
@@ -235,3 +235,10 @@ class ModelRoot(nx.DiGraph, base.Model):
|
||||
model.add_instance(instance)
|
||||
|
||||
return model
|
||||
|
||||
@classmethod
|
||||
def is_isomorphic(cls, G1, G2):
|
||||
def node_match(node1, node2):
|
||||
return node1.as_dict() == node2.as_dict()
|
||||
return nx.algorithms.isomorphism.isomorph.is_isomorphic(
|
||||
G1, G2, node_match=node_match)
|
||||
|
||||
Reference in New Issue
Block a user