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 always migrate VM without to note DRS rules #2195

Open
StefanSchwiedel opened this issue Oct 3, 2024 · 0 comments
Open

vmware_vmotion always migrate VM without to note DRS rules #2195

StefanSchwiedel opened this issue Oct 3, 2024 · 0 comments

Comments

@StefanSchwiedel
Copy link

StefanSchwiedel commented Oct 3, 2024

SUMMARY

When migrating a VM to other SDRS Cluster, the VM always gets migrated to another esx within the cluster without taking into account the DRS rules. This causes cross site traffic on the san and running VMs on wrong hosts.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_vmotion

ANSIBLE VERSION
ansible [core 2.14.16]
COLLECTION VERSION
community.vmware              3.7.0
CONFIGURATION
DIFF_ALWAYS = True
DEFAULT_TRANSPORT = paramiko
DEFAULT_GATHERING = smart
OS / ENVIRONMENT

Debian 12
6.1.0-23-amd64

STEPS TO REPRODUCE

Streched Cluster configuration.
Host A in DRS Group A in Datacenter A with SDRS Cluster A.
DRS Rule defined: "VMs in group_A should run on Hostgroup_A"
VM is running on Host A
Run a playbook to migrate only the VMDKs of the VM to datastore_cluster_site_A

Host A and Host B can access all Datastores in Datastore Cluster "Site A".
No issues on SAN.
dastastore_cluster_A and datastore_cluster_B are present.

Same issue when defining the destination cluster!
Only when defining the destination_host, the task does not move the VM to another host.

- name: Storage Migration to defined cluster
  hosts: my_vm
  gather_facts: no
  serial: 1
  tasks:
    - name: Perform vMotion of virtual machine
      vmware_vmotion:
        hostname: "{{ vcenter }}"
        username: "{{ user }}"
        password: "{{ pass }}"
        vm_name: "{{ inventory_hostname }}"
        #destination_cluster: "{{ vmware_cluster }}"
        destination_datastore_cluster: "{{ datastore_cluster_site_A }}"
        timeout: 18000
      delegate_to: localhost
EXPECTED RESULTS

Only Storage DRS for this VM is executed without moving the VM to another ESX because the VM runs already on the correct Host regarding DRS Ruleset.
Same issue when defining the destination cluster!
Only when defining the destination_host, the task does not move the VM to another host.

ACTUAL RESULTS

The module executes first a VMotion to relocate VM from Host A to Host B including Storage VMotion to the correct datastore_cluster _A
After the Task is completed, VMware DRS migrates VM_A from Host_B back to Host_A because of the DRS Rules.

VMware Task Message: Hot migrating VM_A from host_A, datastore_B in vdc to host_B, datastore_A
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