DaDesktop: Automatic snapshots

Ability to create snapshot (e.g. hourly, daily, etc…)

Gui passes paramters which are kept in kvm/lxc folders

  1. Snapshot Internval

(in seconds)

  1. Snapshot_kept (integer)

tpapi do snpahsots

comment:4 by Xiong Peng, 4 weeks ago

TPAPI Design:

  1. enable/change auto snapshot , dd4t send a request:

PUT /tpapi/v1/lxc_and_kvm/MACHINENAME/autosnapshot
{

“snapshot_interval”: 3600,
“snapshot_kept”: 3

}

response 200
{

“snapshot_interval”: 3600,
“snapshot_kept”: 3

}

  1. disable auto snapshot , dd4t send a request:

DELETE /tpapi/v1/lxc_and_kvm/MACHINENAME/autosnapshot

response 200
{}

  1. get auto snapshot config info, dd4t send a request:

GET /tpapi/v1/lxc_and_kvm/MACHINENAME/autosnapshot

response 200
{

“autosnapshot”: {

“snapshot_interval”: 3600,
“snapshot_kept”: 3,
“last_time”: 1627031006

}

}

4.tpapi will create a file autosnapshot.json in the machine folder. Tpapi run auto snapshot according to this config every time user stop the machine.
{

“snapshot_interval”: 3600,
“snapshot_kept”: 3,
“last_time”: 1627028714

}

  1. snapshots will not copy to new cloned machine, also will not copy/move to other server
  2. autosnapshot.json will not copy to new cloned machine, or “copy to” other server, but will be kept when “move to” other server.