Commit 34700f5b authored by René Nussbaumer's avatar René Nussbaumer

Rename spindle_usage to spindle_use on Ganeti side

Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent fafd0773
......@@ -1144,7 +1144,7 @@ def _ComputeIPolicyInstanceViolation(ipolicy, instance,
"""
mem_size = instance.beparams.get(constants.BE_MAXMEM, None)
cpu_count = instance.beparams.get(constants.BE_VCPUS, None)
spindle_use = instance.beparams.get(constants.BE_SPINDLE_USAGE, None)
spindle_use = instance.beparams.get(constants.BE_SPINDLE_USE, None)
disk_count = len(instance.disks)
disk_sizes = [disk.size for disk in instance.disks]
nic_count = len(instance.nics)
......@@ -9352,7 +9352,7 @@ class LUInstanceCreate(LogicalUnit):
os=self.op.os_type,
vcpus=self.be_full[constants.BE_VCPUS],
memory=self.be_full[constants.BE_MAXMEM],
spindle_usage=self.be_full[constants.BE_SPINDLE_USAGE],
spindle_use=self.be_full[constants.BE_SPINDLE_USE],
disks=self.disks,
nics=nics,
hypervisor=self.op.hypervisor,
......@@ -9848,7 +9848,7 @@ class LUInstanceCreate(LogicalUnit):
nodenames = [pnode.name] + self.secondaries
# Verify instance specs
spindle_use = self.be_full.get(constants.BE_SPINDLE_USAGE, None)
spindle_use = self.be_full.get(constants.BE_SPINDLE_USE, None)
ispec = {
constants.ISPEC_MEM_SIZE: self.be_full.get(constants.BE_MAXMEM, None),
constants.ISPEC_CPU_COUNT: self.be_full.get(constants.BE_VCPUS, None),
......@@ -14516,7 +14516,7 @@ class IAllocator(object):
self.in_text = self.out_text = self.in_data = self.out_data = None
# init all input fields so that pylint is happy
self.mode = mode
self.memory = self.disks = self.disk_template = self.spindle_usage = None
self.memory = self.disks = self.disk_template = self.spindle_use = None
self.os = self.tags = self.nics = self.vcpus = None
self.hypervisor = None
self.relocate_from = None
......@@ -14722,7 +14722,7 @@ class IAllocator(object):
"admin_state": iinfo.admin_state,
"vcpus": beinfo[constants.BE_VCPUS],
"memory": beinfo[constants.BE_MAXMEM],
"spindle_usage": beinfo[constants.BE_SPINDLE_USAGE],
"spindle_use": beinfo[constants.BE_SPINDLE_USE],
"os": iinfo.os,
"nodes": [iinfo.primary_node] + list(iinfo.secondary_nodes),
"nics": nic_data,
......@@ -14762,7 +14762,7 @@ class IAllocator(object):
"os": self.os,
"vcpus": self.vcpus,
"memory": self.memory,
"spindle_usage": self.spindle_usage,
"spindle_use": self.spindle_use,
"disks": self.disks,
"disk_space_total": disk_space,
"nics": self.nics,
......@@ -14876,7 +14876,7 @@ class IAllocator(object):
[
("name", ht.TString),
("memory", ht.TInt),
("spindle_usage", ht.TInt),
("spindle_use", ht.TInt),
("disks", ht.TListOf(ht.TDict)),
("disk_template", ht.TString),
("os", ht.TString),
......
......@@ -918,7 +918,7 @@ BE_MINMEM = "minmem"
BE_VCPUS = "vcpus"
BE_AUTO_BALANCE = "auto_balance"
BE_ALWAYS_FAILOVER = "always_failover"
BE_SPINDLE_USAGE = "spindle_usage"
BE_SPINDLE_USE = "spindle_use"
BES_PARAMETER_TYPES = {
BE_MAXMEM: VTYPE_SIZE,
......@@ -926,7 +926,7 @@ BES_PARAMETER_TYPES = {
BE_VCPUS: VTYPE_INT,
BE_AUTO_BALANCE: VTYPE_BOOL,
BE_ALWAYS_FAILOVER: VTYPE_BOOL,
BE_SPINDLE_USAGE: VTYPE_INT,
BE_SPINDLE_USE: VTYPE_INT,
}
BES_PARAMETER_COMPAT = {
......@@ -1821,7 +1821,7 @@ BEC_DEFAULTS = {
BE_VCPUS: 1,
BE_AUTO_BALANCE: True,
BE_ALWAYS_FAILOVER: False,
BE_SPINDLE_USAGE: 1,
BE_SPINDLE_USE: 1,
}
NDC_DEFAULTS = {
......
......@@ -688,7 +688,7 @@ class TestComputeIPolicyInstanceViolation(unittest.TestCase):
beparams = {
constants.BE_MAXMEM: 2048,
constants.BE_VCPUS: 2,
constants.BE_SPINDLE_USAGE: 4,
constants.BE_SPINDLE_USE: 4,
}
disks = [objects.Disk(size=512)]
instance = objects.Instance(beparams=beparams, disks=disks, nics=[])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment