Changed size and image id/name, added RAM/cpu limits to create machine
@@ -637,9 +637,12 @@ class KubeVirtNodeDriver(NodeDriver):
-portworx Volumes
-scaleIO Volumes
-storageOS
- This parameter is a dict in the form {type: {key1:value1, key2:value2,...}},
- where type is one of the above and key1, key2... are type specific keys and
- their corresponding values. eg: {nsf: {server: "172.0.0.0", path: "/tmp"}}
+ This parameter is a dict in the form
+ {type: {key1:value1, key2:value2,...}},
+ where type is one of the above and key1, key2...
+ are type specific keys and their corresponding
+ values.
+ eg: {nsf: {server: "172.0.0.0", path: "/tmp"}}
{awsElasticBlockStore: {fsType: 'ext4', volumeID: "1234"}}
:type volume_type: `str`
@@ -1047,8 +1050,8 @@ class KubeVirtNodeDriver(NodeDriver):
'domain']['resources']['limits']:
memory = vm['spec']['template']['spec'][
'domain']['resources']['limits']['memory']
- elif vm['spec']['template']['spec'][
- 'domain']['resources'].get('requests',None):
+ elif vm['spec']['template']['spec']['domain']['resources'].get(
+ 'requests', None):
if vm['spec']['template']['spec'][
'domain']['resources']['requests'].get('memory', None):
memory = vm['spec']['template']['spec'][
@@ -1067,8 +1070,8 @@ class KubeVirtNodeDriver(NodeDriver):
cpu = 1
if vm['spec']['template']['spec'][
'domain']['resources'].get('limits', None):
- if vm['spec']['template']['spec'][
- 'domain']['resources']['limits'].get('cpu',None):
+ if vm['spec']['template']['spec']['domain']['resources'][
+ 'limits'].get('cpu', None):
cpu = vm['spec']['template']['spec'][
'domain']['resources']['limits']['cpu']
elif vm['spec']['template']['spec'][
@@ -1078,7 +1081,8 @@ class KubeVirtNodeDriver(NodeDriver):
cpu = vm['spec']['template']['spec'][
'domain']['resources']['requests']['cpu']
elif vm['spec']['template']['spec']['domain'].get('cpu', None):
- cpu = vm['spec']['template']['spec']['domain']['cpu'].get('cores', 1)
+ cpu = vm['spec']['template']['spec']['domain'][
+ 'cpu'].get('cores', 1)
if not isinstance(cpu, int):
cpu = int(cpu.rstrip('m'))
extra_size = {'cpus': cpu}
