Capturing a Snapshot with CLI
Capture snapshots of a running application using the mvmcli snapshot create command.
About this task
For more information about the CLI utility, see Memory Machine CLI Command Summary.
Warning: Changing an application dependency can render a snapshot unrestorable. See
Upgrading Application Dependencies.
Procedure
-
Determine the PID of the application instance you want to capture:
$ mvmcli snapshot list PID User Date Started Command ------------------------------------------------------------------- 10918 mvmm Mon Sep 21 14:01:59 2020 redis-server --port 6380 Snapshots: Date Created Status Label Mon Sep 21 14:11:11 2020 Incomplete test1_97e38023 Mon Sep 21 14:30:39 2020 Incomplete test3_73143fac $
- Optional: Save open files along with the processes that have opened them. See Saving Files and Directories with Snapshots.
-
Capture the snapshot:
$ mvmcli snapshot create -p pid_of_app -l snapshot_name
where:- pid_of_app
- is the PID of the application to be snapshotted.
- snapshot_name
- is a name you assign the snapshot image. A timestamp is appended to the name to create a unique snapshot label for the snapshot. (The timestamp format is YYYYMMDDHHMMSS.) You need this label to restore the snapshot image.
For example:$ mvmcli snapshot create -p 10918 -l test4 -F /usr/mvmm-user/config* Snapshot test4 created in 177.29 ms, application frozen for 166.53ms. $ mvmcli snapshot list PID User Date Started Command ------------------------------------------------------------------- 10918 mvmm Mon Sep 21 14:01:59 2020 redis-server --port 6380 Snapshots: Date Created Status Label Mon Sep 21 14:11:11 2020 Incomplete test1_97e38023 Mon Sep 21 14:30:39 2020 Incomplete test3_73143fac Mon Sep 21 14:30:57 2020 Incomplete test4_740a02c2 $