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

fix for issue#360 #408

Merged
merged 2 commits into from
Oct 31, 2023
Merged
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
13 changes: 12 additions & 1 deletion plugins/module_utils/prism/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ def _get_default_spec(self):
}
)

def _get_default_boot_config_spec(self):
return deepcopy(
{
"boot_type": "LEGACY",
"boot_device_order_list": ["CDROM", "DISK", "NETWORK"],
}
)

def _get_default_network_spec(self):
return deepcopy(
{
Expand Down Expand Up @@ -224,7 +232,7 @@ def _build_spec_cluster(self, payload, param):
uuid, err = get_cluster_uuid(param, self.module)
if err:
return None, err
payload["spec"]["cluster_reference"]["uuid"] = uuid
payload["spec"]["cluster_reference"] = {"kind": "cluster", "uuid": uuid}
return payload, None

def _build_spec_vcpus(self, payload, vcpus):
Expand Down Expand Up @@ -340,7 +348,10 @@ def _build_spec_disks(self, payload, vdisks):
return payload, None

def _build_spec_boot_config(self, payload, param):
if not payload["spec"]["resources"].get("boot_config"):
payload["spec"]["resources"]["boot_config"] = self._get_default_boot_config_spec()
boot_config = payload["spec"]["resources"]["boot_config"]

if "LEGACY" == param["boot_type"] and "boot_order" in param:
boot_config["boot_device_order_list"] = param["boot_order"]

Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/ntnx_vms_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def get_module_spec():

def clone_vm(module, result):
src_vm_uuid = module.params["src_vm_uuid"]
result["src_vm_uuid"] = src_vm_uuid

vm = VM(module)

Expand All @@ -305,7 +306,8 @@ def clone_vm(module, result):

if module.params.get("wait"):
wait_for_task_completion(module, result)
resp = vm.read(src_vm_uuid)
vm_uuid = result["response"]["entity_reference_list"][0]["uuid"]
resp = vm.read(vm_uuid)
result["response"] = resp


Expand Down
Loading