Ansible で Nutanix AHV の VM Snapshot を取得する。Nutanix REST API v2
--- | |
- name: Nutnaix AHV Take VM Snapshot | |
hosts: localhost | |
connection: local | |
vars: | |
prism_address: "Prism のアドレス" | |
prism_username: "admin" | |
prism_password: "Prism ユーザのパスワード" | |
ahv_vm_uuid: "ff156400-4234-4ddf-8d3f-6ac56b9b7a52" | |
ahv_vm_snapshot_name: "ansible-snapshot-test-001" | |
tasks: | |
- name: Take VM Snapshot {{ ahv_vm_snapshot_name }} | |
uri: | |
url: "https://{{ prism_address }}:9440/api/nutanix/v2.0/snapshots/" | |
method: POST | |
user: "{{ prism_username }}" | |
password: "{{ prism_password }}" | |
body: | |
snapshot_specs: | |
- vm_uuid: "{{ ahv_vm_uuid }}" | |
snapshot_name: "{{ ahv_vm_snapshot_name }}" | |
body_format: json | |
headers: | |
Content-Type: application/json | |
Accept: application/json | |
force_basic_auth: yes | |
validate_certs: no | |
status_code: 201 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment