-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapshot.yml
129 lines (127 loc) · 3.77 KB
/
snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
- name: Take snapshots
hosts: localhost
tasks:
- ec2_snapshot:
region: us-east-1
instance_id: i-0a6cdeccab357f45f
device_name: /dev/sda1
description: snapshot of ROOT from node1
## Simple snapshot of volume using volume_id
#- ec2_snapshot:
# volume_id: vol-abcdef12
# description: snapshot of /data from DB123 taken 2013/11/28 12:18:32
#
## Snapshot of volume mounted on device_name attached to instance_id
#- ec2_snapshot:
# instance_id: i-12345678
# device_name: /dev/sdb1
# description: snapshot of /data from DB123 taken 2013/11/28 12:18:32
#
## Snapshot of volume with tagging
#- ec2_snapshot:
# instance_id: i-12345678
# device_name: /dev/sdb1
# snapshot_tags:
# frequency: hourly
# source: /data
#
## Remove a snapshot
#- local_action:
# module: ec2_snapshot
# snapshot_id: snap-abcd1234
# state: absent
#
## Create a snapshot only if the most recent one is older than 1 hour
#- local_action:
# module: ec2_snapshot
# volume_id: vol-abcdef12
# last_snapshot_min_age: 60
#- name: Create a snapshot
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: present
# snapshot_name: snap1
# description: snap1_description
# delegate_to: localhost
#
#- name: Remove a snapshot
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: absent
# snapshot_name: snap1
# delegate_to: localhost
#
#- name: Revert to a snapshot
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: revert
# snapshot_name: snap1
# delegate_to: localhost
#
#- name: Remove all snapshots of a VM
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: remove_all
# delegate_to: localhost
#
#- name: Take snapshot of a VM using quiesce and memory flag on
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: present
# snapshot_name: dummy_vm_snap_0001
# quiesce: yes
# memory_dump: yes
# delegate_to: localhost
#
#- name: Remove a snapshot and snapshot subtree
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: absent
# remove_children: yes
# snapshot_name: snap1
# delegate_to: localhost
#
#- name: Rename a snapshot
# vmware_guest_snapshot:
# hostname: "{{ vcenter_hostname }}"
# username: "{{ vcenter_username }}"
# password: "{{ vcenter_password }}"
# datacenter: "{{ datacenter_name }}"
# folder: /"{{ datacenter_name }}"/vm/
# name: "{{ guest_name }}"
# state: present
# snapshot_name: current_snap_name
# new_snapshot_name: im_renamed
# new_description: "{{ new_snapshot_description }}"
# delegate_to: localhost