host_maintenance – Enable or disable host maintenance mode and migrate virtual machines in IBM PowerVC

Synopsis

Enable or disable maintenance mode for a PowerVC host.

Supports migration of virtual machines based on placement policy.

Parameters

host (True, str, None)

HYPERVISOR_ID/MTMS of the Host

status (True, str, None)

Desired maintenance status of the host.

migrate (optional, str, None)

VM migration behavior during maintenance.

target_host (optional, str, None)

ID of the destination host

Examples

- name: Enable Host Manintenance Playbook
  hosts: localhost
  gather_facts: no
  tasks:
     - name: Enable Maintenance mode
       ibm.powervc.host_maintenance:
          cloud: "CLOUD"
          host: "HOST_ID"
          status: "enable"
       register: output
     - debug:
          var: output.result

- name: Enable Host Manintenance and migrate All VMs based on Placement Policy
  hosts: localhost
  gather_facts: no
  tasks:
     - name: Enable maintenance mode and migrate all VMs
       ibm.powervc.host_maintenance:
          cloud: "CLOUD"
          host: "HOST_ID"
          status: "enable"
          migrate: "all"
       register: result
     - debug:
          var: result

- name: Enable Host Manintenance and migrate Only Active VMs based on Placement Policy
  hosts: localhost
  gather_facts: no
  tasks:
     - name: Enable maintenance mode and migrate only active VMs
       ibm.powervc.host_maintenance:
          cloud: "CLOUD"
          host: "HOST_ID"
          status: "enable"
          migrate: "active_only"
       register: output
     - debug:
          var: output.result

- name: Disable Host maintenance
  hosts: localhost
  gather_facts: no
  tasks:
     - name: Disable the host maintenance mode
       ibm.powervc.host_maintenance:
          cloud: "CLOUD"
          host: "HOST_ID"
          status: "disable"
       register: output
     - debug:
          var: output.result

Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]

  • This module is maintained by PowerVC.

Authors

  • Karteesh Kumar Vipparapelli (@vkarteesh)