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

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, ...@@ -1144,7 +1144,7 @@ def _ComputeIPolicyInstanceViolation(ipolicy, instance,
""" """
mem_size = instance.beparams.get(constants.BE_MAXMEM, None) mem_size = instance.beparams.get(constants.BE_MAXMEM, None)
cpu_count = instance.beparams.get(constants.BE_VCPUS, 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_count = len(instance.disks)
disk_sizes = [disk.size for disk in instance.disks] disk_sizes = [disk.size for disk in instance.disks]
nic_count = len(instance.nics) nic_count = len(instance.nics)
...@@ -9352,7 +9352,7 @@ class LUInstanceCreate(LogicalUnit): ...@@ -9352,7 +9352,7 @@ class LUInstanceCreate(LogicalUnit):
os=self.op.os_type, os=self.op.os_type,
vcpus=self.be_full[constants.BE_VCPUS], vcpus=self.be_full[constants.BE_VCPUS],
memory=self.be_full[constants.BE_MAXMEM], 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, disks=self.disks,
nics=nics, nics=nics,
hypervisor=self.op.hypervisor, hypervisor=self.op.hypervisor,
...@@ -9848,7 +9848,7 @@ class LUInstanceCreate(LogicalUnit): ...@@ -9848,7 +9848,7 @@ class LUInstanceCreate(LogicalUnit):
nodenames = [pnode.name] + self.secondaries nodenames = [pnode.name] + self.secondaries
   
# Verify instance specs # 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 = { ispec = {
constants.ISPEC_MEM_SIZE: self.be_full.get(constants.BE_MAXMEM, None), constants.ISPEC_MEM_SIZE: self.be_full.get(constants.BE_MAXMEM, None),
constants.ISPEC_CPU_COUNT: self.be_full.get(constants.BE_VCPUS, None), constants.ISPEC_CPU_COUNT: self.be_full.get(constants.BE_VCPUS, None),
...@@ -14516,7 +14516,7 @@ class IAllocator(object): ...@@ -14516,7 +14516,7 @@ class IAllocator(object):
self.in_text = self.out_text = self.in_data = self.out_data = None self.in_text = self.out_text = self.in_data = self.out_data = None
# init all input fields so that pylint is happy # init all input fields so that pylint is happy
self.mode = mode 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.os = self.tags = self.nics = self.vcpus = None
self.hypervisor = None self.hypervisor = None
self.relocate_from = None self.relocate_from = None
...@@ -14722,7 +14722,7 @@ class IAllocator(object): ...@@ -14722,7 +14722,7 @@ class IAllocator(object):
"admin_state": iinfo.admin_state, "admin_state": iinfo.admin_state,
"vcpus": beinfo[constants.BE_VCPUS], "vcpus": beinfo[constants.BE_VCPUS],
"memory": beinfo[constants.BE_MAXMEM], "memory": beinfo[constants.BE_MAXMEM],
"spindle_usage": beinfo[constants.BE_SPINDLE_USAGE], "spindle_use": beinfo[constants.BE_SPINDLE_USE],
"os": iinfo.os, "os": iinfo.os,
"nodes": [iinfo.primary_node] + list(iinfo.secondary_nodes), "nodes": [iinfo.primary_node] + list(iinfo.secondary_nodes),
"nics": nic_data, "nics": nic_data,
...@@ -14762,7 +14762,7 @@ class IAllocator(object): ...@@ -14762,7 +14762,7 @@ class IAllocator(object):
"os": self.os, "os": self.os,
"vcpus": self.vcpus, "vcpus": self.vcpus,
"memory": self.memory, "memory": self.memory,
"spindle_usage": self.spindle_usage, "spindle_use": self.spindle_use,
"disks": self.disks, "disks": self.disks,
"disk_space_total": disk_space, "disk_space_total": disk_space,
"nics": self.nics, "nics": self.nics,
...@@ -14876,7 +14876,7 @@ class IAllocator(object): ...@@ -14876,7 +14876,7 @@ class IAllocator(object):
[ [
("name", ht.TString), ("name", ht.TString),
("memory", ht.TInt), ("memory", ht.TInt),
("spindle_usage", ht.TInt), ("spindle_use", ht.TInt),
("disks", ht.TListOf(ht.TDict)), ("disks", ht.TListOf(ht.TDict)),
("disk_template", ht.TString), ("disk_template", ht.TString),
("os", ht.TString), ("os", ht.TString),
......
...@@ -918,7 +918,7 @@ BE_MINMEM = "minmem" ...@@ -918,7 +918,7 @@ BE_MINMEM = "minmem"
BE_VCPUS = "vcpus" BE_VCPUS = "vcpus"
BE_AUTO_BALANCE = "auto_balance" BE_AUTO_BALANCE = "auto_balance"
BE_ALWAYS_FAILOVER = "always_failover" BE_ALWAYS_FAILOVER = "always_failover"
BE_SPINDLE_USAGE = "spindle_usage" BE_SPINDLE_USE = "spindle_use"
BES_PARAMETER_TYPES = { BES_PARAMETER_TYPES = {
BE_MAXMEM: VTYPE_SIZE, BE_MAXMEM: VTYPE_SIZE,
...@@ -926,7 +926,7 @@ BES_PARAMETER_TYPES = { ...@@ -926,7 +926,7 @@ BES_PARAMETER_TYPES = {
BE_VCPUS: VTYPE_INT, BE_VCPUS: VTYPE_INT,
BE_AUTO_BALANCE: VTYPE_BOOL, BE_AUTO_BALANCE: VTYPE_BOOL,
BE_ALWAYS_FAILOVER: VTYPE_BOOL, BE_ALWAYS_FAILOVER: VTYPE_BOOL,
BE_SPINDLE_USAGE: VTYPE_INT, BE_SPINDLE_USE: VTYPE_INT,
} }
BES_PARAMETER_COMPAT = { BES_PARAMETER_COMPAT = {
...@@ -1821,7 +1821,7 @@ BEC_DEFAULTS = { ...@@ -1821,7 +1821,7 @@ BEC_DEFAULTS = {
BE_VCPUS: 1, BE_VCPUS: 1,
BE_AUTO_BALANCE: True, BE_AUTO_BALANCE: True,
BE_ALWAYS_FAILOVER: False, BE_ALWAYS_FAILOVER: False,
BE_SPINDLE_USAGE: 1, BE_SPINDLE_USE: 1,
} }
NDC_DEFAULTS = { NDC_DEFAULTS = {
......
...@@ -688,7 +688,7 @@ class TestComputeIPolicyInstanceViolation(unittest.TestCase): ...@@ -688,7 +688,7 @@ class TestComputeIPolicyInstanceViolation(unittest.TestCase):
beparams = { beparams = {
constants.BE_MAXMEM: 2048, constants.BE_MAXMEM: 2048,
constants.BE_VCPUS: 2, constants.BE_VCPUS: 2,
constants.BE_SPINDLE_USAGE: 4, constants.BE_SPINDLE_USE: 4,
} }
disks = [objects.Disk(size=512)] disks = [objects.Disk(size=512)]
instance = objects.Instance(beparams=beparams, disks=disks, nics=[]) 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