vmotion condition

42 views
Skip to first unread message

Mani

unread,
Apr 29, 2020, 2:56:53 PM4/29/20
to Ansible Project
I am trying to perform vmotion of multiple VMs between 2 ESXi hosts using the vmare_vmotion module. We need to set a cap for memory utilization of the destination host to <= 70% and the storage utilization to <= 90%. 

Required result: VMs have to be migrated until the memory and storage utilization has reached. The loop should stop VM migration once the memory & storage threshold has reached.

- name: Perform storage vMotion and host vMotion of virtual machine
  vmware_vmotion:
    hostname: "{{ running_host }}"
    username: "{{ esxi_user }}"
    password: "{{ esxi_pass }}"
    validate_certs: no
    vm_name: "{{ item.guest_name }}"
    destination_host: "{{ destination_host }}"
    destination_datastore: "{{ item.name }}"
  delegate_to: localhost
  with_nested:
    - "{{vm_info.virtual_machines}}"
    - "{{ansible_datastore}}"

Any inputs is highly appreciated.

Mani

unread,
May 7, 2020, 5:49:53 AM5/7/20
to Ansible Project
Real-time memory and datastore calculation using the pre-defined module for VMware.Please provide if this is achievable in Ansible or not.

Thanks,
Mani

Mani

unread,
May 15, 2020, 7:03:49 PM5/15/20
to Ansible Project
Can we invoke any script to capture the memory and datastore utilization?


On Thursday, 30 April 2020 00:26:53 UTC+5:30, Mani wrote:

David Foley

unread,
May 19, 2020, 9:08:54 AM5/19/20
to Ansible Project
Hi Mani,


Mani

unread,
May 20, 2020, 8:45:57 PM5/20/20
to Ansible Project
Hi David,

Thank you for the info.
Reply all
Reply to author
Forward
0 new messages