Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functionality fixes #517

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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