Created
December 24, 2018 18:27
-
-
Save gowatana/5866e0408c6ea89512eff4c39325e9d6 to your computer and use it in GitHub Desktop.
Ansible で Nutanix AHV の VM Snapshot を取得する。Nutanix REST API v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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
Hi,
Could you help with code for deleting snapshot?
Regards
Mk