Skip to content

Commit

Permalink
functionality fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cbabinsack committed Nov 14, 2024
1 parent 2d2ad43 commit e321f02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/module_utils/prism/spec/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DefaultVMSpec:
),
vcpus=dict(type="int"),
cores_per_vcpu=dict(type="int"),
memory_gb=dict(type="int"),
memory_gb=dict(type="float"),
networks=dict(type="list", elements="dict", options=network_spec),
boot_config=dict(type="dict", options=boot_config_spec),
guest_customization=dict(type="dict", options=gc_spec),
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/prism/subnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def _build_spec_vlan_subnet(self, payload, config):
payload["spec"]["resources"]["subnet_type"] = "VLAN"
payload["spec"]["resources"]["vlan_id"] = config["vlan_id"]
payload["spec"]["resources"]["is_external"] = False
payload["spec"]["resources"]["advanced_networking"] = False

cluster_uuid, error = get_cluster_uuid(config["cluster"], self.module)
if error:
Expand Down
5 changes: 3 additions & 2 deletions plugins/module_utils/prism/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _build_spec_cores(self, payload, cores):
return payload, None

def _build_spec_mem(self, payload, mem_gb):
mem_mib = mem_gb * 1024
mem_mib = int(mem_gb * 1024)
current_mem_mib = payload["spec"]["resources"].get("memory_size_mib", 0)
self._check_and_set_require_vm_restart(current_mem_mib, mem_mib)
payload["spec"]["resources"]["memory_size_mib"] = mem_mib
Expand Down Expand Up @@ -452,7 +452,8 @@ def _generate_disk_spec(
if vdisk.get("empty_cdrom", None):
disk.pop("data_source_reference", None)
disk.pop("storage_config", None)

disk.pop("disk_size_bytes", None)
disk.pop("disk_size_mib", None)
else:
if vdisk.get("size_gb"):
disk_size_bytes = int(vdisk["size_gb"]) * 1024 * 1024 * 1024
Expand Down

0 comments on commit e321f02

Please sign in to comment.