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

vmware_vmotion doesn't migrate vms between resourcepools unless it's migrating VMs for other reasons. #2282

Open
kbrowder opened this issue Jan 15, 2025 · 0 comments

Comments

@kbrowder
Copy link

SUMMARY

vmware_vmotion should be able to move a VM to a new resourcepool even if destination_host isn't changed.
I think some minor additional logic could allow this to happen in these lines to detect if the resourcepool is being changed.

# Get Destination resourcepool
dest_resourcepool = self.params.get('destination_resourcepool', None)
self.resourcepool_object = None
if dest_resourcepool:
self.resourcepool_object = find_resource_pool_by_name(content=self.content,
resource_pool_name=dest_resourcepool)
if self.resourcepool_object is None:
self.module.fail_json(msg="Unable to find destination resource pool object for %s" % dest_resourcepool)
elif not dest_resourcepool and self.host_object:
self.resourcepool_object = self.host_object.parent.resourcePool

It'd be nice if the following could work:

- name: Perform vMotion of virtual machine to resource_pool
  community.vmware.vmware_vmotion:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    moid: vm-42
    destination_resourcepool: 'destination_resourcepool_as_per_vcenter'
  delegate_to: localhost
ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_vmotion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant