You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xapi/design/schedule-snapshot.md
+47-32Lines changed: 47 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,13 @@ title: Schedule Snapshot Design
3
3
layout: default
4
4
design_doc: true
5
5
design_review: 186
6
-
revision: 1
6
+
revision: 2
7
7
status: proposed
8
+
revision_history:
9
+
- revision_number: 1
10
+
description: Initial version
11
+
- revision_number: 2
12
+
description: Renaming VMSS fields and APIs. API message_create superseeds vmss_create_alerts.
8
13
---
9
14
10
15
The scheduled snapshot feature will utilize the existing architecture of VMPR. In terms of functionality, schedule snapshot is basically VMPR without its archiving capability.
@@ -13,7 +18,14 @@ Introduction
13
18
------------
14
19
15
20
* Schedule snapshot will be a new object in xapi as VMSS.
16
-
* A pool can have multiple VMSS and each VMSS will be configured to take snapshot of type disk, checkpoint or quiesce for the VMs as part of VMSS, on configured intervals.
21
+
* A pool can have multiple VMSS.
22
+
* Multiple VMs can be a part of VMSS but a VM cannot be a part of multiple VMSS.
23
+
* A VMSS takes VMs snapshot with type [`snapshot`, `checkpoint`, `snapshot_with_quiesce`].
24
+
* VMSS takes snapshot of VMs on configured intervals:
25
+
* `hourly` -> On everyday, Each hour, Mins [0;15;30;45]
26
+
* `daily` -> On everyday, Hour [0 to 23], Mins [0;15;30;45]
27
+
* `weekly` -> Days [`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`], Hour[0 to 23], Mins [0;15;30;45]
28
+
* VMSS will have a limit on retaining number of VM snapshots in range [1 to 10].
17
29
18
30
Datapath Design
19
31
---------------
@@ -22,7 +34,6 @@ Datapath Design
22
34
* VMSS plugin will go through all the schedule snapshot policies in the pool and check if any of them are due.
23
35
* If a snapshot is due then : Go through all the VM objects in XAPI associated with this schedule snapshot policy and create a new snapshot.
24
36
* If the snapshot operation fails, create a notification alert for the event and move to the next VM.
25
-
* Flag the snapshot to have been created by the schedule service, using either other-config for the VM object or another parameter added for this purpose.
26
37
* Check if an older snapshot now needs to be deleted to comply with the retention value defined in the schedule policy.
27
38
* If we need to delete any existing snapshots, delete the oldest snapshot created via schedule policy.
28
39
* Set the last-run timestamp in the schedule policy.
@@ -34,45 +45,49 @@ There is a new record for VM Scheduled Snapshot with new fields.
34
45
35
46
New fields:
36
47
37
-
* "name-label" type String : Name label for VMSS.
38
-
* "name-description" type String : Name description for VMSS.
39
-
* "is-schedule-snapshot-enabled" type Bool : Enable/Disable VMSS to take snapshot.
40
-
* "schedule-snapshot-type" type [DiskSnapshot; Checkpoint; Quiesce] : Type of snapshot policy takes.
41
-
* "schedule-snapshot-retention-value" type Int64 : Number of snapshots limit for a VM, max limit is 10.
42
-
* "schedule-snapshot-frequency" type [hourly; daily; weekly] : Frequency of taking snapshot of VMs.
43
-
* "snapshot-schedule" type (hour: DateTime, min: DateTime, days: string list) : Time Hour, Min of interval of 15mins and Days of a week.
44
-
* "is-schedule-snapshot-running" type Bool : If VMSS is in progress of taking snapshot.
45
-
* "schedule-snapshot-last-run-time" type Date : DateTime of last execution of VMSS.
46
-
* "is-alarm-enabled" type Bool : Alarm enable/disable for VMSS.
47
-
* "alarm-config" : type (is_alarm_enabled,["email_address", ((String), "");"smtp_server", ((String), "");"smtp_port", ((IntRange(1,65535)), "25")] : Sets the alarm config field for VMSS.
48
-
* "VMs" type VM refs : List of VMs part of VMSS.
48
+
*`name-label` type `String` : Name label for VMSS.
49
+
*`name-description` type `String` : Name description for VMSS.
50
+
*`enabled` type `Bool` : Enable/Disable VMSS to take snapshot.
51
+
*`type` type `Enum`[`snapshot`; `checkpoint`; `snapshot_with_quiesce`] : Type of snapshot VMSS takes.
52
+
*`retention-value` type `Int64` : Number of snapshots limit for a VM, max limit is 10 and default is 7.
53
+
*`frequency` type `Enum`[`hourly`; `daily`; `weekly`] : Frequency of taking snapshot of VMs.
54
+
*`schedule` type `Map(String,String)` with (key, value) pair:
55
+
* hour : 0 to 23
56
+
* min : [0;15;30;45]
57
+
* days : [`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`]
58
+
*`last-run-time` type Date : DateTime of last execution of VMSS.
59
+
*`is-alarm-enabled` type Bool : Alarm enable/disable for VMSS.
60
+
*`alarm-config` : `Map(String,String)` with (key, value) pair:
61
+
* email_address : ((String), "")
62
+
* smtp_server : ((String), "")
63
+
* smtp_port : ((IntRange(1,65535)), "25")
64
+
Sets the alarm config field for VMSS.
65
+
*`VMs` type VM refs : List of VMs part of VMSS.
49
66
50
67
New fields to VM record:
51
68
52
-
*"schedule-snapshot" type VMSS ref : VM part of VMSS.
53
-
*"is-snapshot-from-vmss" type Bool : If snapshot created from VMSS.
69
+
*`schedule-snapshot` type VMSS ref : VM part of VMSS.
70
+
*`is-vmss-snapshot` type Bool : If snapshot created from VMSS.
54
71
55
72
New APIs
56
73
--------
57
74
58
75
* vmss_snapshot_now (Ref vmss, Pool_Operater) -> String : This call executes the schedule snapshot immediately.
59
-
* vmss_create_alert (Ref _vmss, String "name", Int "priority", String "body", String "data", Local_Root) -> unit : This call creates an alert for schedule snapshot.
60
-
* vmss_get_alerts (Ref vmss, Int "hours_from_now", Pool_Operater) -> Set String : This call fetches a history of alerts for a given schedule snapshot
61
-
* vmss_set_snapshot_retention_value (Ref vmss, Int value, Pool_Operater) -> unit : Set the value of the_schedule_snapshot_retention value max is 10.
62
-
* vmss_set_is_schedule_snapshot_running (Ref vmss, Bool value, Local_Root) -> unit : Set the value of the is_schedule_snapshot_running field
63
-
* vmss_set_snapshot_frequency (Ref vmss, String "value", Pool_Operater) -> unit : Set the value of the snapshot_frequency field
64
-
* vmss_set_snapshot_schedule (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the schedule to take snapshot.
65
-
* vmss_set_is_alarm_enabled (Ref vmss, Bool "value", Pool_Operater) -> unit : Set the value of the is_alarm_enabled field
66
-
* vmss_set_alarm_config (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the alarm_config
67
-
* vmss_add_to_snapshot_schedule (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to VMSS
68
-
* vmss_add_to_alarm_config (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to alarm_config field.
69
-
* vmss_remove_from_snapshot_schedule (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from VMSS.
70
-
* vmss_remove_from_alarm_config (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from alarm_config field.
71
-
* vmss_set_schedule_snapshot_last_run_time (Ref vmss, DateTime "value", Local_Root) -> unit : Set the last run time for VMSS.
76
+
* vmss_get_alerts (Ref vmss, Int "hours_from_now", Pool_Operater) -> Set String : This call fetches a history of alerts for a given schedule snapshot.
77
+
* vmss_set_retention_value (Ref vmss, Int value, Pool_Operater) -> unit : Set the value of vmss retention value, max is 10.
78
+
* vmss_set_frequency (Ref vmss, String "value", Pool_Operater) -> unit : Set the value of the vmss frequency field.
79
+
* vmss_set_type (Ref vmss, String "value", Pool_Operater) -> unit : Set the snapshot type of the vmss type field.
80
+
* vmss_set_schedule (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the vmss schedule to take snapshot.
81
+
* vmss_set_is_alarm_enabled (Ref vmss, Bool "value", Pool_Operater) -> unit : Set the value of the is_alarm_enabled field.
82
+
* vmss_set_alarm_config (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the alarm_config.
83
+
* vmss_add_to_schedule (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to VMSS schedule.
84
+
* vmss_add_to_alarm_config (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to VMSS alarm_config field.
85
+
* vmss_remove_from_schedule (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from VMSS schedule.
86
+
* vmss_remove_from_alarm_config (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from VMSS alarm_config field.
87
+
* vmss_set_last_run_time (Ref vmss, DateTime "value", Local_Root) -> unit : Set the last run time for VMSS.
72
88
73
89
New CLIs
74
90
--------
75
91
76
-
* vmss-create (required : "name-label";"schedule-snapshot-type";"schedule-snapshot-frequency", optional : "name-description";"is-schedule-snapshot-enabled";"snapshot-schedule:";"snapshot-retention-value";"is-alarm-enabled";"alarm-config:") -> unit : Creates VM schedule snapshot.
92
+
* vmss-create (required : "name-label";"type";"frequency", optional : "name-description";"is-enabled";"schedule:";"retention-value";"is-alarm-enabled";"alarm-config:") -> unit : Creates VM schedule snapshot.
77
93
* vmss-destroy (required : uuid) -> unit : Destroys a VM schedule snapshot.
0 commit comments