12. Managing Application Snapshots

Application Snapshots

An application snapshot is a reference marker for an application at a particular point in time. It contains a copy of the application’s data plus the application’s current state. Snapshots provide a safeguard against application data corruption. For example, if key application data is accidentally deleted, a snapshot can be used to revert (roll back) the app to a point in time before the deletion occurred.

Taking snapshots of storage volumes has existed for decades in the industry. However, when an application is distributed and/or uses multiple storage volumes across one or more pods, orchestrating storage-only snapshots across all of them is tedious, error-prone and inconsistent. Storage-only snapshots are also unaware of the application configuration and its topology, which makes cloning, backing up or restoring cumbersome and prone to misconfiguration.

Robin allows creating application-consistent snapshots of an entire application, which capture:

  1. The entire application topology and its configuration (i.e., specs of Pod, Service, StatefulSet, Secrets, ConfigMaps, etc)

  2. Snapshots of all data volumes (PersistentVolumeClaims)

Robin snapshots at the storage layer use redirect-on-write, which means that snapshots can be taken in less than a second even for terabyte sized data volumes. Because only the changed blocks are tracked between snapshots, Robin snapshots are very space efficient.

Topics covered in this chapter:

robin snapshot create

Snapshot an entire application (data and metadata)

robin snapshot delete

Delete the snapshot of an application

robin snapshot restore

Restore a snapshot from a backup copy stored on an external storage repository

robin snapshot list

List snapshots for one or more applications

robin snapshot info

Show detailed information about a specific snapshot

12.1. Create an Application Snapshot

An application snapshot is created using this command:

# robin snapshot create <app_name>
                        --snapname <snapname>
                        --quiesce <quiesce>
                        --labels <labels>
                        --desc <desc>
                        --app-namespace <app_ns>

app_name

Name of the application to be snapshotted

--snapname <snapname>

A suffix to be appended to the application’s name in order to form the name of the snapshot being taken

--quiesce <quiesce>

Quiesce option to exercise in order to achieve a consistent application state. Valid options include: fs, container and all. Note this option is only valid for Robin applications

--labels <labels>

Comma seperated list of labels to attach to the snapshot with each label in the format: <key>:<value>

--desc <desc>

Description for snapshot being taken

--app-namespace <app_ns>

Namespace of application to be snapshotted. This option only needs to be used when there are multiple applications with the same name

Example:

# robin snapshot create mysql3 --wait
Job:  331 Name: ApplicationSnapshot  State: VALIDATED       Error: 0
Job:  331 Name: ApplicationSnapshot  State: WAITING         Error: 0
Job:  331 Name: ApplicationSnapshot  State: COMPLETED       Error: 0

# robin snapshot list --app mysql3
+----------------------------------+--------+----------+----------+----------------------------+
| Snapshot ID                      | State  | App Name | App Kind | Snapshot name              |
+----------------------------------+--------+----------+----------+----------------------------+
| b6033a5a4d6a11eab805255c7aa2236e | ONLINE | mysql3   | ROBIN    | mysql3_snapshot-1581493122 |
+----------------------------------+--------+----------+----------+----------------------------+

Creates an application snapshot.

End Point: /api/v3/robin_server/apps/<app_name>

Method: PUT

URL Parameters: None

Data Parameters:

  • action: snapshot - This mandatory field within the payload specifies the snapshot operation is to be performed.

  • snapname: <snap_name> - Utilizing this parameter by specifiying a string, results in it being appended to the application name to form the name of the snapshot being taken.

  • quiesce: <list_of_quiesce_options> - Utilizing this parameter by specifiying a comma seperated list of quiesce options results in them being exercised in order to acheive a consistent application state. Valid values include: ‘fs’, ‘container’ and ‘all’. Note this option is only valid for ROBIN applications.

  • labels: <list_of_labels> - Utilizing this parameter by specifiying a comma seperated list of labels with each label in the format: <key>:<value> results in them being attached and associated with the snasphot to be created.

  • desc: <desc> - Utilizing this parameter by specifying a string, results in it being set as the description for the snapshot being taken.

  • namespace: <app_ns> - Utilizing this parameter by specifiying the name of a namespace results in the application within the given namespace being snapshotted. This option only needs to be used when there are multiple applications with the same name.

Port: RCM Port (default value is 29442)

Headers:

  • Authorization: <auth_token> : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

Success Response Code: 202

Error Response Code: 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error), 409 (Duplicate Resource Error)

Example Response:

Output
{
   "jobid":275,
   "plan":{
      "kind":"robin",
      "quiesce":[
         "fs"
      ],
      "original_app_tenant":1,
      "snapname":"snap1",
      "action":"snapshot",
      "original_app_owner":3,
      "opcode":8,
      "current_user":{
         "session_expires":"2020-09-10T10:40:27",
         "tenant_id":1,
         "tenant":"Administrators",
         "user_capabilities":[
            "AllSuperAdminCapabilities"
         ],
         "user_contexts":[
            "robin"
         ],
         "username":"robin",
         "user_permissions":{

         },
         "tenant_role":"superadmin",
         "user_context":"robin",
         "tenants":[
            "Administrators"
         ],
         "user_id":3,
         "namespace":"t001-u000003",
         "ip_addr":"172.17.0.1"
      },
      "namespace":"t001-u000003",
      "name":"custom-labels-app"
   }
}

12.2. Configuring snapshot schedules and retention policies

This is covered under the Manage Application Snapshot Schedules section of Applications chapter. See details of the command robin app snapshot-schedule.

12.3. Delete an Application Snapshot

In order to delete an application snapshot, issue the following command:

# robin snapshot delete <snapshotid>

snapshotid

Unique ID of the snapshot (obtained from the output of robin snapshot list)

Example:

# robin snapshot list --app mysql3
+----------------------------------+--------+----------+----------+----------------------------+
| Snapshot ID                      | State  | App Name | App Kind | Snapshot name              |
+----------------------------------+--------+----------+----------+----------------------------+
| b6033a5a4d6a11eab805255c7aa2236e | ONLINE | mysql3   | ROBIN    | mysql3_snapshot-1581493122 |
+----------------------------------+--------+----------+----------+----------------------------+

# robin snapshot delete b6033a5a4d6a11eab805255c7aa2236e --wait
Job:  330 Name: ApplicationDelete    State: VALIDATED       Error: 0
Job:  330 Name: ApplicationDelete    State: COMPLETED       Error: 0

# robin snapshot list --app mysql3
+-------------+--------+----------+----------+---------------+
| Snapshot ID | State  | App Name | App Kind | Snapshot name |
+-------------+--------+----------+----------+---------------+
+-------------+--------+----------+----------+---------------+

Delete an application snapshot from a Robin Platform cluster

End Point: /api/v6/robin_server/apps/<snapshot_id>?objtype=snapshot

Method: DELETE

URL Parameters: None

Data Parameters: None

Port: RCM Port (default value is 29442)

Headers:

  • Authorization: <auth_token> : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

Success Response Code: 202

Error Response Code: 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error)

Example Response:

Output
{
   "plan":{
      "version":"1.15.8",
      "pvcpolicy":"create",
      "roles":[
         {
            "display_name":"nginx",
            "serviceAccountName":"{{app['name'].lower()}}-sa",
            "scaleout":"enabled",
            "name":"nginx",
            "restart_on_qoscfg":true,
            "vnodes":[
               {
                  "allocated_initContainers":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"init",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "limits":{
                              "memory":"128Mi",
                              "cpu":"25m"
                           }
                        },
                        "imagePullPolicy":"IfNotPresent",
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "1"
                        ]
                     }
                  ],
                  "k8s_provider":"robin",
                  "bundle_object_id":"a9f229864a74f936047b1b005de391a8",
                  "allocated_volumeMounts":[
                     {
                        "mountPath":"\/cm1",
                        "name":"vol-cm1"
                     },
                     {
                        "mountPath":"\/cm2",
                        "name":"vol-cm2"
                     },
                     {
                        "mountPath":"\/cm3",
                        "name":"vol-cm3"
                     }
                  ],
                  "mem":{
                     "hugepages_2m":0,
                     "hugepages_1g":0,
                     "size":1283457024
                  },
                  "restart_num":15,
                  "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1597953097832\/1597953155269\/nginx-1.0",
                  "root_fs":"\/usr\/local\/robin\/instances\/demo-nginx-01.t001-u000003.svc.cluster.local",
                  "pod_name":"demo-nginx-01",
                  "appid":13,
                  "host_ip":"172.21.20.104",
                  "volumes":[
                     {
                        "name":"vol-cm1",
                        "configMap":{
                           "defaultMode":420,
                           "name":"{{app['name'].lower()}}-cm1"
                        }
                     },
                     {
                        "name":"vol-cm2",
                        "configMap":{
                           "defaultMode":420,
                           "name":"{{app['name'].lower()}}-cm2"
                        }
                     },
                     {
                        "name":"vol-cm3",
                        "configMap":{
                           "defaultMode":420,
                           "name":"{{app['name'].lower()}}-cm3"
                        }
                     }
                  ],
                  "service_uids":[
                     "8de44f8e-fec0-47ee-b425-970758749188",
                     "3ca02e11-24b9-4555-8386-4f1b0e5e44fc",
                     "d273da82-86c3-4be6-9b29-1b930bece779"
                  ],
                  "appname":"demo",
                  "restart_on_qoscfg":true,
                  "env":{
                     "allocated":{
                        "ROBINHOST_TAG_ROBINRPOOL":"default",
                        "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux",
                        "POD_NS":"t001-u000003",
                        "POD_NAME":"demo-nginx-01",
                        "K8S_NODE":"cscale-82-140",
                        "ROBINHOST":"cscale-82-140.robinsystems.com",
                        "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64"
                     }
                  },
                  "serviceAccountName":"{{app['name'].lower()}}-sa",
                  "initContainers":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"init",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "limits":{
                              "memory":"128Mi",
                              "cpu":"25m"
                           }
                        },
                        "imagePullPolicy":"IfNotPresent",
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "1"
                        ]
                     }
                  ],
                  "enable_hooklogs":true,
                  "vnodeid":13,
                  "allocated_volumes":[
                     {
                        "name":"vol-cm1",
                        "configMap":{
                           "defaultMode":420,
                           "name":"demo-cm1"
                        }
                     },
                     {
                        "name":"vol-cm2",
                        "configMap":{
                           "defaultMode":420,
                           "name":"demo-cm2"
                        }
                     },
                     {
                        "name":"vol-cm3",
                        "configMap":{
                           "defaultMode":420,
                           "name":"demo-cm3"
                        }
                     }
                  ],
                  "volume_groups":[
                     {
                        "rpoolid":1,
                        "name":"demo.nginx.01.72.1.9457505a-dcf2-4f0c-b416-9467c10342d7",
                        "media":"HDD",
                        "stormgr_id":6,
                        "layout":"round-robin",
                        "replicas":1,
                        "volumes":[
                           "demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42"
                        ],
                        "device_sets":[
                           {
                              "devices":[
                                 {
                                    "host":"cscale-82-140.robinsystems.com",
                                    "tags":{

                                    },
                                    "wwn":"0x600224803bcdafde95b1f5cd27ceb5fb",
                                    "hostname":"cscale-82-140.robinsystems.com",
                                    "max_volumes_per_disk":10,
                                    "stormgr_id":2,
                                    "slices":77,
                                    "score":73,
                                    "type":"HDD",
                                    "devpath":"\/dev\/disk\/by-id\/scsi-3600224803bcdafde95b1f5cd27ceb5fb",
                                    "allocated_slices":24,
                                    "max_latency_sensitive_vols_per_disk":2,
                                    "write_unit":4096,
                                    "psize":107374182400,
                                    "reattachable":0,
                                    "pused":1107296256,
                                    "max_throughput_intensive_vols_per_disk":1,
                                    "protected":0,
                                    "role":"Storage",
                                    "aslices":50,
                                    "state":"READY",
                                    "capacity":107374182400
                                 }
                              ],
                              "name":"demo.nginx.01.72.1.9457505a-dcf2-4f0c-b416-9467c10342d7.0.a6cab386-2774-46d1-ad51-7a0f11fcdb35",
                              "stormgr_id":6
                           }
                        ]
                     }
                  ],
                  "gpu":{
                     "min":0,
                     "max":0
                  },
                  "bundleid":1,
                  "engine":"docker",
                  "annotations":{
                     "annokey1":"annovalue1",
                     "allocated":{
                        "annokey1":"annovalue1",
                        "annokey2":"annovalue2"
                     },
                     "annokey2":"annovalue2"
                  },
                  "ctime":1598453564,
                  "podSecurityContext":{
                     "runAsUser":0,
                     "allocated":{
                        "runAsUser":0
                     }
                  },
                  "hosttags":{
                     "robin.io\/robinrpool":[
                        "default"
                     ],
                     "kubernetes.io\/arch":[
                        "amd64"
                     ],
                     "kubernetes.io\/os":[
                        "linux"
                     ]
                  },
                  "allocated_host":"cscale-82-140.robinsystems.com",
                  "calico_inuse":true,
                  "image":{
                     "version":"1.15.8-alpine",
                     "registry_hostname":"",
                     "name":"nginx",
                     "engine":"docker",
                     "registry_port":""
                  },
                  "hostAliases":[
                     {
                        "hostnames":[
                           "foo.remote",
                           "bar.remote"
                        ],
                        "ip":"1.2.3.4"
                     }
                  ],
                  "readinessProbe":{
                     "exec":{
                        "command":[
                           "sleep",
                           "1"
                        ]
                     },
                     "initialDelaySeconds":5,
                     "allocated":{
                        "exec":{
                           "command":[
                              "sleep",
                              "1"
                           ]
                        },
                        "initialDelaySeconds":5
                     }
                  },
                  "rpoolid":1,
                  "role":"nginx",
                  "livenessProbe":{
                     "allocated":{
                        "periodSeconds":3,
                        "httpGet":{
                           "path":"\/",
                           "httpHeaders":[
                              {
                                 "value":"Awesome",
                                 "name":"Custom-Header"
                              }
                           ],
                           "port":80
                        },
                        "initialDelaySeconds":3
                     },
                     "periodSeconds":3,
                     "httpGet":{
                        "path":"\/",
                        "httpHeaders":[
                           {
                              "value":"Awesome",
                              "name":"Custom-Header"
                           }
                        ],
                        "port":80
                     },
                     "initialDelaySeconds":3
                  },
                  "utime":1598453564,
                  "volumeMounts":[
                     {
                        "mountPath":"\/cm1",
                        "name":"vol-cm1"
                     },
                     {
                        "mountPath":"\/cm2",
                        "name":"vol-cm2"
                     },
                     {
                        "mountPath":"\/cm3",
                        "name":"vol-cm3"
                     }
                  ],
                  "hostname":"demo-nginx-01.t001-u000003.svc.cluster.local",
                  "name":"demo.nginx.01",
                  "numa_allocations":{
                     "0":{
                        "gpu_used":0,
                        "isol_shared_cores_used":0,
                        "isol_dedicated_cores_used":0,
                        "hugepages_1g_used":0,
                        "hugepages_2m_used":0,
                        "mem_used":1283457024,
                        "non_isol_cores_used":1
                     }
                  },
                  "sidecars":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"busyside1",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "requests":{
                              "memory":"100Mi"
                           },
                           "limits":{
                              "memory":"200Mi"
                           }
                        },
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "3000"
                        ]
                     }
                  ],
                  "storage":[
                     {
                        "faultdomain":"host",
                        "pvcpolicy":"create",
                        "compression":"disabled",
                        "vol_ns":"t001-u000003",
                        "snapname":"snap1",
                        "lvm_vol_count":"0",
                        "replication":1,
                        "name":"demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42",
                        "blocksize":4096,
                        "workload":0,
                        "protection":0,
                        "type":"data",
                        "k8s_name":"demo-nginx-01-data-1-68f51300",
                        "volgrp_name":"demo.nginx.01.72.1.9457505a-dcf2-4f0c-b416-9467c10342d7",
                        "stordriver":{
                           "faultdomain":"host",
                           "protection":0,
                           "type":"das",
                           "media":"HDD"
                        },
                        "lvm_type":"None",
                        "snapshot_space_limit":4294967296,
                        "layout":"round-robin",
                        "encryption":"none",
                        "disk_tags":{

                        },
                        "mount_in_sidecars":true,
                        "allocated":{
                           "qgroupid":5,
                           "multinode_mounting":false,
                           "compression":0,
                           "genkey":1598453534287911,
                           "priority":2,
                           "snapname":"snap1",
                           "vtype":0,
                           "replication":1,
                           "current_snapshotid":1,
                           "name":"demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42",
                           "params":{

                           },
                           "protection":0,
                           "appid":1,
                           "appname":"default",
                           "snapshot_space_limit":4294967296,
                           "stordriver":{
                              "faultdomain":"host",
                              "protection":0,
                              "type":"das",
                              "media":"HDD"
                           },
                           "block_size":4096,
                           "partitions":0,
                           "current_snapshot":"active_snap",
                           "grpid":6,
                           "next_snapshotid":2,
                           "next_backupid":1,
                           "media":72,
                           "size":21474836480,
                           "slice_size":1073741824,
                           "volumeid":"6",
                           "resource_poolid":1
                        },
                        "snap_reserved":20,
                        "media":"HDD",
                        "mount_in_initcontainers":true,
                        "path":"\/opt\/data",
                        "fstype":"ext4",
                        "size":21474836480
                     }
                  ],
                  "labels":{
                     "labelkey2":"labelvalue2",
                     "allocated":{
                        "labelkey2":"labelvalue2",
                        "labelkey1":"labelvalue1"
                     },
                     "labelkey1":"labelvalue1"
                  },
                  "allocated_host_type":"physical",
                  "enable_metrics":true,
                  "pod_ns":"t001-u000003",
                  "allocated_host_public_ip":"10.9.82.140",
                  "enable_portmapping":true,
                  "vnodehookargs":{

                  },
                  "cpu":{
                     "reserve":false,
                     "min":0,
                     "max":1
                  },
                  "allocated_host_public_hostname":"cscale-82-140.robinsystems.com",
                  "allocated_sidecars":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"busyside1",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "requests":{
                              "memory":"100Mi"
                           },
                           "limits":{
                              "memory":"200Mi"
                           }
                        },
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "3000"
                        ]
                     }
                  ],
                  "cm_keys":[
                     "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCULUZ7abTGyeGhxSuXejf0VohBrk2ndhAQj0mx8whbs\/qyJmVmzenvGUVGGXSfri7m3PE++2V0xMathKizVpjcrWXoFTNZLlJKBVWog5XaCYIYRswAlow+rQU6aKJ+lP2DlUgmpZ9iG9VCae0vt+JosC2LeIDmgNm5vD6AN0aB\/rKHeQjCiJyvr90d9MbQ\/JAsh+\/1EkA4fTuTXRstlMH86gB+7JhAeCROIBz32Y7HV8hKf0SQx2fj2XFeQsRcZm8oC8n1En87qBXk+iz3qKkZBduNDp8XnKWFvhsKDQkuWGr1jUNp1SyaqNSFFZrv+EyFC1sHoORuJwAwYp8DLwyF root@cscale-82-140"
                  ],
                  "role_name":"nginx",
                  "allocated":{
                     "zonename":"default",
                     "nodeid":1,
                     "nodename":"cscale-82-140",
                     "zoneid":1597969746
                  },
                  "allocated_serviceAccountName":"demo-sa",
                  "securityContext":{
                     "allowPrivilegeEscalation":true,
                     "allocated":{
                        "allowPrivilegeEscalation":true
                     }
                  },
                  "network":[
                     {
                        "allocated_names":[
                           "eth0"
                        ],
                        "interfaces":1,
                        "allocated_netmask":"255.255.0.0",
                        "name":"robin-default",
                        "ippool":"robin-default",
                        "allocated_ip":"172.21.20.104",
                        "driver":"calico",
                        "subnet":"172.21.0.0",
                        "allocated_by":"system",
                        "allocated_prefix":16
                     }
                  ],
                  "sidecar_info":{
                     "containers":[
                        {
                           "hugepages_2m":0,
                           "name":"busyside1",
                           "cpu":0,
                           "mem":209715200,
                           "gpu":0,
                           "hugepages_1g":0
                        }
                     ],
                     "hugepages_2m":0,
                     "cpu":0,
                     "mem":209715200,
                     "gpu":0,
                     "hugepages_1g":0
                  },
                  "state":"STARTED",
                  "id":13,
                  "services":[
                     {
                        "annotations":{
                           "a1":"av1",
                           "a2":"av2"
                        },
                        "labels":{
                           "l2":"v2",
                           "namespace":"t001-u000003",
                           "robin.io\/username":"robin",
                           "scope":"vnode",
                           "robin.io\/tenant":"Administrators",
                           "robin.io\/tenant_id":"1",
                           "robin.io\/user_id":"3",
                           "l1":"v1"
                        },
                        "appname":"demo",
                        "scope":"pod",
                        "ports":[
                           {
                              "protocol":"TCP",
                              "name":"web",
                              "node_port":31574,
                              "port":80,
                              "target_port":80
                           }
                        ],
                        "cluster_ip":"172.19.64.18",
                        "vnodename":"demo-nginx-01",
                        "type":"NodePort",
                        "k8s_name":"demo-nginx-01-np-0",
                        "selectors":{
                           "robin.io\/vnode":"demo-nginx-01"
                        }
                     }
                  ]
               }
            ],
            "hostAliases":[
               {
                  "hostnames":[
                     "foo.remote",
                     "bar.remote"
                  ],
                  "ip":"1.2.3.4"
               }
            ],
            "volume_groups":[

            ],
            "image":{
               "version":"1.15.8-alpine",
               "registry_hostname":"",
               "name":"nginx",
               "engine":"docker",
               "registry_port":""
            },
            "services":[
               {
                  "rolename":"nginx",
                  "annotations":{
                     "a1":"av1",
                     "a2":"av2"
                  },
                  "ports":[
                     {
                        "protocol":"TCP",
                        "name":"web",
                        "node_port":null,
                        "port":80,
                        "target_port":80
                     }
                  ],
                  "appname":"demo",
                  "cluster_ip":"172.19.177.184",
                  "labels":{
                     "l2":"v2",
                     "namespace":"t001-u000003",
                     "robin.io\/username":"robin",
                     "scope":"role",
                     "robin.io\/tenant":"Administrators",
                     "robin.io\/tenant_id":"1",
                     "robin.io\/user_id":"3",
                     "l1":"v1"
                  },
                  "type":"ClusterIP",
                  "k8s_name":"demo-nginx-cl-0",
                  "selectors":{
                     "app":"demo",
                     "robin.io\/role":"nginx"
                  }
               },
               {
                  "rolename":"nginx",
                  "annotations":{
                     "a1":"av1",
                     "a2":"av2"
                  },
                  "ports":[
                     {
                        "protocol":"TCP",
                        "name":"web",
                        "node_port":32392,
                        "port":80,
                        "target_port":80
                     }
                  ],
                  "appname":"demo",
                  "cluster_ip":"172.19.51.165",
                  "labels":{
                     "l2":"v2",
                     "namespace":"t001-u000003",
                     "robin.io\/username":"robin",
                     "scope":"role",
                     "robin.io\/tenant":"Administrators",
                     "robin.io\/tenant_id":"1",
                     "robin.io\/user_id":"3",
                     "l1":"v1"
                  },
                  "type":"LoadBalancer",
                  "k8s_name":"demo-nginx-lb-0",
                  "selectors":{
                     "app":"demo",
                     "robin.io\/role":"nginx"
                  }
               }
            ],
            "qgroups":{
               "data":{
                  "rd_min_iops":0,
                  "rd_weight":1,
                  "enabled":false,
                  "rd_max_iops":2000000,
                  "wr_min_window":500,
                  "wr_weight":1,
                  "priority":1,
                  "wr_min_iops":0,
                  "rd_min_window":500,
                  "wr_max_iops":2000000
               }
            }
         }
      ],
      "apphooks":{
         "postdestroy":"python3 postdestroy.py",
         "allocated":{
            "postcreate":{
               "spec":{
                  "template":{
                     "spec":{
                        "containers":[
                           {
                              "volumeMounts":[
                                 {
                                    "mountPath":"\/cm1",
                                    "name":"vol-cm1"
                                 },
                                 {
                                    "mountPath":"\/cm2",
                                    "name":"vol-cm2"
                                 },
                                 {
                                    "mountPath":"\/cm3",
                                    "name":"vol-cm3"
                                 }
                              ],
                              "name":"demo-pin1",
                              "image":"k8s.gcr.io\/busybox",
                              "command":[
                                 "sleep",
                                 "1"
                              ]
                           }
                        ],
                        "backoffLimit":4,
                        "volumes":[
                           {
                              "name":"vol-cm1",
                              "configMap":{
                                 "defaultMode":420,
                                 "name":"demo-cm1"
                              }
                           },
                           {
                              "name":"vol-cm2",
                              "configMap":{
                                 "defaultMode":420,
                                 "name":"demo-cm2"
                              }
                           },
                           {
                              "name":"vol-cm3",
                              "configMap":{
                                 "defaultMode":420,
                                 "name":"demo-cm3"
                              }
                           }
                        ],
                        "restartPolicy":"Never"
                     }
                  }
               },
               "type":"job"
            },
            "precreate":"python3 precreate.py",
            "info":"python3 app_info.py",
            "preclone":"python3 precreate.py",
            "postdestroy":"python3 postdestroy.py"
         },
         "postcreate":{
            "spec":{
               "template":{
                  "spec":{
                     "containers":[
                        {
                           "volumeMounts":[
                              {
                                 "mountPath":"\/cm1",
                                 "name":"vol-cm1"
                              },
                              {
                                 "mountPath":"\/cm2",
                                 "name":"vol-cm2"
                              },
                              {
                                 "mountPath":"\/cm3",
                                 "name":"vol-cm3"
                              }
                           ],
                           "name":"{{app['name'].lower()}}-pin1",
                           "image":"k8s.gcr.io\/busybox",
                           "command":[
                              "sleep",
                              "1"
                           ]
                        }
                     ],
                     "backoffLimit":4,
                     "volumes":[
                        {
                           "name":"vol-cm1",
                           "configMap":{
                              "defaultMode":420,
                              "name":"{{app['name'].lower()}}-cm1"
                           }
                        },
                        {
                           "name":"vol-cm2",
                           "configMap":{
                              "defaultMode":420,
                              "name":"{{app['name'].lower()}}-cm2"
                           }
                        },
                        {
                           "name":"vol-cm3",
                           "configMap":{
                              "defaultMode":420,
                              "name":"{{app['name'].lower()}}-cm3"
                           }
                        }
                     ],
                     "restartPolicy":"Never"
                  }
               }
            },
            "type":"job"
         },
         "info":"python3 app_info.py",
         "preclone":"python3 precreate.py",
         "precreate":"python3 precreate.py"
      },
      "bundle_object_id":"a9f229864a74f936047b1b005de391a8",
      "clonemode":"unfenced",
      "zoneid":1597969746,
      "tenant":"Administrators",
      "from_template":null,
      "master_name":"demo",
      "parent_app_state":6,
      "parent_last_known_state":6,
      "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1597953097832\/1597953155269\/nginx-1.0",
      "rpoolid":1,
      "snapshot":"enabled",
      "appvars":{
         "var2":"{{APP_NAME}}-val2",
         "var1":"{{APP_NAME}}-val1"
      },
      "snapname":"snap1",
      "rpool":"default",
      "restart_num":15,
      "username":"robin",
      "app_ns":"t001-u000003",
      "namespace":"t001-u000003",
      "desc":"",
      "parentid":13,
      "enable_metrics":true,
      "enable_hooklogs":true,
      "allocated_appvars":{
         "var2":"demo-val2",
         "var1":"demo-val1"
      },
      "id":13,
      "robin_version":"5.3.1-230",
      "auto_relocate":true,
      "bundleid":1,
      "name":"demo_snap1",
      "content_id":"a9f229864a74f936047b1b005de391a8",
      "planid":14,
      "clone":"enabled",
      "parent_app":"demo"
   },
   "jobid":147
}

12.4. List Application Snapshots

Issue the following command to list application snapshots the current user is entitled to view:

# robin snapshot list --app <app_name>
                      --app-kind <app_kind>
                      --app-namespace <app_ns>
                      --level <level>
                      --labels <labels>
                      --verbose

--app <app_name>

Only include snapshots for the specified applicaiton instance

--app-kind <app_kind>

Filter by application kind (valid choices are ‘robin’, ‘helm’, and ‘flexapp’)

--app-namespace <app_ns>

If there are multiple applications of the same name but in different namespaces this option can be used to distinguish them. Note this option is only valid when --app is specified

--level <level>

Filter by the level of the snapshot (valid choices are ‘app’ and ‘namespace’)

--labels <labels>

Filter by the labels provided. Multiple labels must be provided in a comma seperated manner with each label in the format: <key>:<value>

--verbose

Include additional information in the output

Example 1: List snapshots of a specific app

# robin snapshot list --app mysql1

+----------------------------------+--------+------------+----------+----------------------------+
| Snapshot ID                      | State  | App Name   | App Kind | Snapshot name              |
+----------------------------------+--------+------------+----------+----------------------------+
| 56875efa124d11ecba8f0f255475beae | ONLINE | ns1/mysql1 | helm     | mysql1_snapshot-1631288383 |
+----------------------------------+--------+------------+----------+----------------------------+

Example 2: List all snapshots

# robin snapshot list

+----------------------------------+--------+-------------------------------------+----------+----------------------------------------+
| Snapshot ID                      | State  | App Name                            | App Kind | Snapshot name                          |
+----------------------------------+--------+-------------------------------------+----------+----------------------------------------+
| fc0e74ba0fc611ec90008fd9e303c008 | ONLINE | ns1/ns1obcrh                        | flexapp  | ns1obcrh_nss1                          |
| a44d6e3a108511ecb4620d978aa26f58 | ONLINE | u1ns1/u1ns1iquap                    | flexapp  | u1ns1iquap_ss1u1ns1                    |
| f3f11798108b11ec9673e3f06b68957b | ONLINE | u11ns1/u11ns1plscf                  | flexapp  | u11ns1plscf_ss1u11ns1                  |
| 90d480d8109011ec943d0b68842c3cba | ONLINE | u11ns1a1share1/u11ns1a1share1zonzq  | flexapp  | u11ns1a1share1zonzq_ss1u11ns1a1share1  |
| e5514088109011ec8960b79252b3a9c8 | ONLINE | u11ns1a1share1/u11ns1a1share1zonzq  | flexapp  | u11ns1a1share1zonzq_ss1u11ns1a1share12 |
| 63383f30109511ec9bc51f2f07c2e5f3 | ONLINE | u11ns2a1share1/u11ns2a1share1abcdef | flexapp  | u11ns2a1share1abcdef_ss1u11ns2a1share1 |
| 640f4ad2109711ecb0ada7e2383a10c4 | ONLINE | u1ns2a1share1/u1ns2a1share1dcefr    | flexapp  | u1ns2a1share1dcefr_ss1u1ns2a1share1    |
| 56875efa124d11ecba8f0f255475beae | ONLINE | ns1/mysql1                          | helm     | mysql1_snapshot-1631288383             |
+----------------------------------+--------+-------------------------------------+----------+----------------------------------------+

Example 3: List all snapshots of a particular level

# robin snapshot list --level app

+----------------------------------+--------+------------+----------+----------------------------+
| Snapshot ID                      | State  | App Name   | App Kind | Snapshot name              |
+----------------------------------+--------+------------+----------+----------------------------+
| 56875efa124d11ecba8f0f255475beae | ONLINE | ns1/mysql1 | helm     | mysql1_snapshot-1631288383 |
+----------------------------------+--------+------------+----------+----------------------------+

Example 4: List all snapshots with a particular label

# robin snapshot list --labels system_replicate:yes

+----------------------------------+--------+---------------+----------+---------------------------------------+
| Snapshot ID                      | State  | App Name      | App Kind | Snapshot name                         |
+----------------------------------+--------+---------------+----------+---------------------------------------+
| 1cb934a4ab3a11ec8b84b3d731b0b3bb | ONLINE | test-ns/pgsql | flexapp  | pgsql_5min_auto-1648050416-1648102657 |
| b26fa730ac2911ec9282312d4a1cadc1 | ONLINE | test-ns/pgsql | flexapp  | pgsql_5min_auto-1648050416-1648205557 |
| 6540b266ac2a11ecb401af83176cced7 | ONLINE | test-ns/pgsql | flexapp  | pgsql_5min_auto-1648050416-1648205857 |
| 18c4b84aac2b11ec952e47e3b463ab7d | ONLINE | test-ns/pgsql | flexapp  | pgsql_5min_auto-1648050416-1648206158 |
| c9b57c68ac2b11eca959d7db3dfb1472 | ONLINE | test-ns/pgsql | flexapp  | pgsql_5min_auto-1648050416-1648206456 |
| 7d5c34c0ac2c11ecb94a031211f1ef31 | ONLINE | test-ns/pgsql | flexapp  | pgsql_5min_auto-1648050416-1648206757 |
+----------------------------------+--------+---------------+----------+---------------------------------------+

Lists all application snapshots.

End Point: /api/v6/robin_server/appsview?atype=SNAPSHOT

Method: GET

URL Parameters:

  • parentapp=<app_name> : Utilizing this parameter filters the results such that only snapshots of the specified application are returned.

  • akind=[robin,helm,flexapp] : Utilizing this parameter filters the results by the kind specified. Valid values include robin, helm and flexapp.

  • namespace=<app_ns> : Utilizing this parameter filters the results such that only snapshots of the specified application in the given namespace are returned. Note this option is only valid with the parentapp parameter is utilized.

  • level=[app,namespace] : Utilizing this parameter filters the results by the level specified. Valid values include app and namespace.

  • labels=<labels> : Utilizing this parameter filters the results such that only snapshots with the specified label(s) are returned. Note multiple labels need to be given in a comma seperated manner.

Data Parameters: None

Port: RCM Port (default value is 29442)

Headers:

  • Authorization: <auth_token> : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

Success Response Code: 200

Error Response Code: 500 (Internal Server Error)

Example Response:

Output
{
   "robin":{
      "tenants":[
         {
            "name":"Administrators",
            "id":1
         }
      ],
      "rpools":[
         {
            "name":"default",
            "id":1
         }
      ],
      "zones":[
         {
            "zoneid":1597969746,
            "name":"default",
            "id":1
         }
      ],
      "vnodes":[
         {
            "nodeid":1,
            "mem":4194304,
            "userid":3,
            "zoneid":null,
            "cpu":1,
            "role":"dsbundle",
            "gpu":0,
            "hugepages_1g":0,
            "utime":1598343982,
            "hugepages_2m":0,
            "hostname":"test-app-new-dsbundle-01.t001-u000003.svc.cluster.local",
            "name":"test-app-new.dsbundle.01",
            "status":"ONLINE",
            "pod_name":"test-app-new-dsbundle-01",
            "appid":12,
            "engine":"docker",
            "tenantid":1,
            "state":"STARTED",
            "id":12,
            "desired_status":"ONLINE",
            "pod_ns":"t001-u000003"
         },
         {
            "nodeid":1,
            "mem":1283457024,
            "userid":3,
            "zoneid":null,
            "cpu":1,
            "role":"nginx",
            "gpu":0,
            "hugepages_1g":0,
            "utime":1598453564,
            "hugepages_2m":0,
            "hostname":"demo-nginx-01.t001-u000003.svc.cluster.local",
            "name":"demo.nginx.01",
            "status":"ONLINE",
            "pod_name":"demo-nginx-01",
            "appid":13,
            "engine":"docker",
            "tenantid":1,
            "state":"STARTED",
            "id":13,
            "desired_status":"ONLINE",
            "pod_ns":"t001-u000003"
         }
      ],
      "users":[
         {
            "email":null,
            "tenantid":1,
            "firstname":"Robin",
            "id":3,
            "username":"robin",
            "lastname":"Systems"
         }
      ],
      "nodes":[
         {
            "rpoolid":1,
            "memory_used":0,
            "nvnodes":0,
            "k8s_node_name":"cscale-82-140",
            "zoneid":1,
            "cpu":40,
            "mem":33555701760,
            "mem_for_storage":1073741824,
            "cpu_prov_factor":10,
            "name":"cscale-82-140.robinsystems.com",
            "cpu_cores_present":40,
            "state":"ONLINE",
            "id":1,
            "cores_used":0,
            "services":"{\"update_time\":1598470070.8638851643,\"services\":{\"stormgr-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:43.555551\",\"MainPID\":2275,\"Id\":\"stormgr-server\"},\"consul-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:28:49.778591\",\"MainPID\":566,\"Id\":\"consul-server\"},\"consul_members\":[{\"Port\":29460,\"Status\":1,\"DelegateMax\":5,\"ProtocolMin\":1,\"Tags\":{\"segment\":\"\",\"bootstrap\":\"1\",\"vsn_min\":\"2\",\"build\":\"0.9.4:40f243a+\",\"vsn_max\":\"3\",\"vsn\":\"2\",\"raft_vsn\":\"2\",\"role\":\"consul\",\"dc\":\"consul\",\"id\":\"9d550700-9fac-4de6-b6bc-1b957e82bda9\",\"wan_join_port\":\"29461\",\"port\":\"29459\"},\"Name\":\"cscale-82-140.robinsystems.com\",\"DelegateMin\":2,\"ProtocolCur\":2,\"DelegateCur\":4,\"Addr\":\"10.9.82.140\",\"ProtocolMax\":5}],\"robin-auth-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:10.587576\",\"MainPID\":1007,\"Id\":\"robin-auth-server\"},\"robin-node-monitor\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:31.387560\",\"MainPID\":1245,\"Id\":\"robin-node-monitor\"},\"robin-watchdog\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:28:54.388588\",\"MainPID\":867,\"Id\":\"robin-watchdog\"},\"sherlock-server\":{\"ActiveState\":\"inactive\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":0,\"MainPID\":0,\"Id\":\"sherlock-server\"},\"httpd\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:46.799549\",\"MainPID\":2590,\"Id\":\"httpd\"},\"robin-file-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:15.559572\",\"MainPID\":1074,\"Id\":\"robin-file-server\"},\"robin-event-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:15.088572\",\"MainPID\":1041,\"Id\":\"robin-event-server\"},\"consul-client\":{\"ActiveState\":\"inactive\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":0,\"MainPID\":0,\"Id\":\"consul-client\"},\"gui-cli\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:46.964548\",\"MainPID\":2622,\"Id\":\"gui-cli\"},\"robin-agent\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:38.987554\",\"MainPID\":1716,\"Id\":\"robin-agent\"},\"robin-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-26 12:27:39.201277\",\"MainPID\":15116,\"Id\":\"robin-server\"},\"iomgr-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 12:51:14.290049\",\"MainPID\":29172,\"Id\":\"iomgr-server\"},\"monitor-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:47.114548\",\"MainPID\":2662,\"Id\":\"monitor-server\"},\"postgresql-9.6\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:28:52.396589\",\"MainPID\":662,\"Id\":\"postgresql-9.6\"},\"consul_dns\":true}}"
         }
      ],
      "bundles":[
         {
            "version":"1.0",
            "name":"nginx",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":1
         },
         {
            "version":"1.0",
            "name":"tolerations",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":2
         },
         {
            "version":"1.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":3
         },
         {
            "version":"2.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":4
         },
         {
            "version":"3.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":5
         },
         {
            "version":"4.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":6
         },
         {
            "version":"10.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":7
         },
         {
            "version":"11.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":8
         },
         {
            "version":"12.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":9
         },
         {
            "version":"15.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":10
         },
         {
            "version":"new",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":11
         },
         {
            "version":"20.0",
            "name":"dsbundle",
            "share_with_all_tenants":false,
            "tenantid":1,
            "userid":3,
            "zoneid":1,
            "limitperbundle":0,
            "id":12
         }
      ],
      "apps":[
         {
            "rpoolid":1,
            "nvnodes":0,
            "zoneid":1,
            "mem":0,
            "atype":"SNAPSHOT",
            "name":"demo_snap1",
            "status":"Ready",
            "hugepages_1g":0,
            "tenantid":1,
            "error":0,
            "utime":0,
            "parentid":13,
            "userid":3,
            "cpu":0,
            "gpu":0,
            "bundleid":1,
            "hugepages_2m":0,
            "health":"Unknown",
            "ctime":1598454187,
            "unique_id":"3fb7b2c0e7ad11eaaa9ea101b344257c",
            "parent_app_type":"MASTER",
            "state":"ONLINE",
            "id":14,
            "parent_app":"demo"
         }
      ]
   },
   "k8s":[
      {
         "spec":"apiVersion: v1\ndata: {run.sh: ''}\nkind: ConfigMap\nmetadata:\n  labels: {app: ideal-giraffe-mysql, chart: mysql-1.6.6, heritage: Tiller, release: ideal-giraffe}\n  name: ideal-giraffe-mysql-test\n  namespace: t001-u000003\n---\napiVersion: v1\ndata: {mysql-password: Z0dPczVJRnc3aA==, mysql-root-password: WGdoZ0tRd0kyaQ==}\nkind: Secret\nmetadata:\n  labels: {app: ideal-giraffe-mysql, chart: mysql-1.6.6, heritage: Tiller, release: ideal-giraffe}\n  name: ideal-giraffe-mysql\n  namespace: t001-u000003\ntype: Opaque\n---\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  annotations: {robin.io\/appid: '1', robin.io\/blocksize: '4096', robin.io\/encryption: none,\n    robin.io\/fstype: ext4, robin.io\/snapname: demo-helm_snap1, robin.io\/snapshotid: '1',\n    robin.io\/vol_snapname: snap1, robin.io\/volumeid: '7', robin.io\/volumename: pvc-b4d27bfb-a898-4acc-a250-071591c5da14,\n    robin.io\/zoneid: '1597969746', volume.beta.kubernetes.io\/storage-provisioner: robin,\n    volume.kubernetes.io\/selected-node: cscale-82-140}\n  labels: {app: ideal-giraffe-mysql, chart: mysql-1.6.6, heritage: Tiller, release: ideal-giraffe}\n  name: ideal-giraffe-mysql\n  namespace: t001-u000003\nspec:\n  accessModes: [ReadWriteOnce]\n  resources:\n    requests: {storage: 8Gi}\n  storageClassName: robin\n  volumeMode: Filesystem\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  annotations: {cni.projectcalico.org\/podIPs: 172.21.7.204\/32, k8s.v1.cni.cncf.io\/network-status: \"[{\\n\\\n      \\    \\\"name\\\": \\\"calico\\\",\\n    \\\"ips\\\": [\\n        \\\"172.21.7.204\\\"\\n    ],\\n\\\n      \\    \\\"default\\\": true,\\n    \\\"dns\\\": {}\\n}]\", k8s.v1.cni.cncf.io\/networks-status: \"[{\\n\\\n      \\    \\\"name\\\": \\\"calico\\\",\\n    \\\"ips\\\": [\\n        \\\"172.21.7.204\\\"\\n    ],\\n\\\n      \\    \\\"default\\\": true,\\n    \\\"dns\\\": {}\\n}]\"}\n  labels: {app: ideal-giraffe-mysql, pod-template-hash: 7bdc9fd456, release: ideal-giraffe}\n  name: ideal-giraffe-mysql-7bdc9fd456-ld9mm\n  namespace: t001-u000003\nspec:\n  containers:\n  - env:\n    - name: MYSQL_ROOT_PASSWORD\n      valueFrom:\n        secretKeyRef: {key: mysql-root-password, name: ideal-giraffe-mysql}\n    - name: MYSQL_PASSWORD\n      valueFrom:\n        secretKeyRef: {key: mysql-password, name: ideal-giraffe-mysql, optional: true}\n    - {name: MYSQL_USER}\n    - {name: MYSQL_DATABASE}\n    image: mysql:5.7.30\n    imagePullPolicy: IfNotPresent\n    livenessProbe:\n      exec:\n        command: [sh, -c, 'mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}']\n      failureThreshold: 3\n      initialDelaySeconds: 30\n      periodSeconds: 10\n      successThreshold: 1\n      timeoutSeconds: 5\n    name: ideal-giraffe-mysql\n    ports:\n    - {containerPort: 3306, name: mysql, protocol: TCP}\n    readinessProbe:\n      exec:\n        command: [sh, -c, 'mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}']\n      failureThreshold: 3\n      initialDelaySeconds: 5\n      periodSeconds: 10\n      successThreshold: 1\n      timeoutSeconds: 1\n    resources:\n      requests: {cpu: 100m, memory: 256Mi}\n    terminationMessagePath: \/dev\/termination-log\n    terminationMessagePolicy: File\n    volumeMounts:\n    - {mountPath: \/var\/lib\/mysql, name: data}\n  dnsPolicy: ClusterFirst\n  initContainers:\n  - command: [rm, -fr, \/var\/lib\/mysql\/lost+found]\n    image: busybox:1.32\n    imagePullPolicy: IfNotPresent\n    name: remove-lost-found\n    resources:\n      requests: {cpu: 10m, memory: 10Mi}\n    terminationMessagePath: \/dev\/termination-log\n    terminationMessagePolicy: File\n    volumeMounts:\n    - {mountPath: \/var\/lib\/mysql, name: data}\n  nodeName: cscale-82-140\n  priority: 0\n  restartPolicy: Always\n  schedulerName: default-scheduler\n  securityContext: {}\n  serviceAccount: default\n  serviceAccountName: default\n  terminationGracePeriodSeconds: 30\n  tolerations:\n  - {effect: NoExecute, key: node.kubernetes.io\/not-ready, operator: Exists, tolerationSeconds: 300}\n  - {effect: NoExecute, key: node.kubernetes.io\/unreachable, operator: Exists, tolerationSeconds: 300}\n  volumes:\n  - name: data\n    persistentVolumeClaim: {claimName: ideal-giraffe-mysql}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  labels: {app: ideal-giraffe-mysql, chart: mysql-1.6.6, heritage: Tiller, release: ideal-giraffe}\n  name: ideal-giraffe-mysql\n  namespace: t001-u000003\nspec:\n  ports:\n  - {name: mysql, port: 3306, protocol: TCP, targetPort: mysql}\n  selector: {app: ideal-giraffe-mysql}\n  sessionAffinity: None\n  type: ClusterIP\n---\napiVersion: apps\/v1\nkind: ReplicaSet\nmetadata:\n  annotations: {deployment.kubernetes.io\/desired-replicas: '1', deployment.kubernetes.io\/max-replicas: '1',\n    deployment.kubernetes.io\/revision: '1'}\n  labels: {app: ideal-giraffe-mysql, pod-template-hash: 7bdc9fd456, release: ideal-giraffe}\n  name: ideal-giraffe-mysql-7bdc9fd456\n  namespace: t001-u000003\nspec:\n  replicas: 1\n  selector:\n    matchLabels: {app: ideal-giraffe-mysql, pod-template-hash: 7bdc9fd456, release: ideal-giraffe}\n  template:\n    metadata:\n      creationTimestamp: null\n      labels: {app: ideal-giraffe-mysql, pod-template-hash: 7bdc9fd456, release: ideal-giraffe}\n    spec:\n      containers:\n      - env:\n        - name: MYSQL_ROOT_PASSWORD\n          valueFrom:\n            secretKeyRef: {key: mysql-root-password, name: ideal-giraffe-mysql}\n        - name: MYSQL_PASSWORD\n          valueFrom:\n            secretKeyRef: {key: mysql-password, name: ideal-giraffe-mysql, optional: true}\n        - {name: MYSQL_USER}\n        - {name: MYSQL_DATABASE}\n        image: mysql:5.7.30\n        imagePullPolicy: IfNotPresent\n        livenessProbe:\n          exec:\n            command: [sh, -c, 'mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}']\n          failureThreshold: 3\n          initialDelaySeconds: 30\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 5\n        name: ideal-giraffe-mysql\n        ports:\n        - {containerPort: 3306, name: mysql, protocol: TCP}\n        readinessProbe:\n          exec:\n            command: [sh, -c, 'mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}']\n          failureThreshold: 3\n          initialDelaySeconds: 5\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 1\n        resources:\n          requests: {cpu: 100m, memory: 256Mi}\n        terminationMessagePath: \/dev\/termination-log\n        terminationMessagePolicy: File\n        volumeMounts:\n        - {mountPath: \/var\/lib\/mysql, name: data}\n      dnsPolicy: ClusterFirst\n      initContainers:\n      - command: [rm, -fr, \/var\/lib\/mysql\/lost+found]\n        image: busybox:1.32\n        imagePullPolicy: IfNotPresent\n        name: remove-lost-found\n        resources:\n          requests: {cpu: 10m, memory: 10Mi}\n        terminationMessagePath: \/dev\/termination-log\n        terminationMessagePolicy: File\n        volumeMounts:\n        - {mountPath: \/var\/lib\/mysql, name: data}\n      restartPolicy: Always\n      schedulerName: default-scheduler\n      securityContext: {}\n      serviceAccount: default\n      serviceAccountName: default\n      terminationGracePeriodSeconds: 30\n      volumes:\n      - name: data\n        persistentVolumeClaim: {claimName: ideal-giraffe-mysql}\n---\napiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  annotations: {deployment.kubernetes.io\/revision: '1'}\n  labels: {app: ideal-giraffe-mysql, chart: mysql-1.6.6, heritage: Tiller, release: ideal-giraffe}\n  name: ideal-giraffe-mysql\n  namespace: t001-u000003\nspec:\n  progressDeadlineSeconds: 600\n  replicas: 1\n  revisionHistoryLimit: 10\n  selector:\n    matchLabels: {app: ideal-giraffe-mysql, release: ideal-giraffe}\n  strategy: {type: Recreate}\n  template:\n    metadata:\n      creationTimestamp: null\n      labels: {app: ideal-giraffe-mysql, release: ideal-giraffe}\n    spec:\n      containers:\n      - env:\n        - name: MYSQL_ROOT_PASSWORD\n          valueFrom:\n            secretKeyRef: {key: mysql-root-password, name: ideal-giraffe-mysql}\n        - name: MYSQL_PASSWORD\n          valueFrom:\n            secretKeyRef: {key: mysql-password, name: ideal-giraffe-mysql, optional: true}\n        - {name: MYSQL_USER}\n        - {name: MYSQL_DATABASE}\n        image: mysql:5.7.30\n        imagePullPolicy: IfNotPresent\n        livenessProbe:\n          exec:\n            command: [sh, -c, 'mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}']\n          failureThreshold: 3\n          initialDelaySeconds: 30\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 5\n        name: ideal-giraffe-mysql\n        ports:\n        - {containerPort: 3306, name: mysql, protocol: TCP}\n        readinessProbe:\n          exec:\n            command: [sh, -c, 'mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}']\n          failureThreshold: 3\n          initialDelaySeconds: 5\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 1\n        resources:\n          requests: {cpu: 100m, memory: 256Mi}\n        terminationMessagePath: \/dev\/termination-log\n        terminationMessagePolicy: File\n        volumeMounts:\n        - {mountPath: \/var\/lib\/mysql, name: data}\n      dnsPolicy: ClusterFirst\n      initContainers:\n      - command: [rm, -fr, \/var\/lib\/mysql\/lost+found]\n        image: busybox:1.32\n        imagePullPolicy: IfNotPresent\n        name: remove-lost-found\n        resources:\n          requests: {cpu: 10m, memory: 10Mi}\n        terminationMessagePath: \/dev\/termination-log\n        terminationMessagePolicy: File\n        volumeMounts:\n        - {mountPath: \/var\/lib\/mysql, name: data}\n      restartPolicy: Always\n      schedulerName: default-scheduler\n      securityContext: {}\n      serviceAccount: default\n      serviceAccountName: default\n      terminationGracePeriodSeconds: 30\n      volumes:\n      - name: data\n        persistentVolumeClaim: {claimName: ideal-giraffe-mysql}\n",
         "description":"",
         "kind":"helm",
         "tenant":"Administrators",
         "restored":false,
         "name":"demo-helm_snap1",
         "appname":"demo-helm",
         "create_time":1598471771,
         "state":"ONLINE",
         "id":"2e9b06e2e7d611eabebb977b67a45f3b",
         "username":"robin",
         "num_backups":0,
         "desc":"-"
      }
   ]
}

12.5. Show Information About a Specific Snapshot

In order to attain details about a specific snapshot such as its kind, the objects which are captured within it and its creation time, issue the following command:

# robin snapshot info <snapshotid>
                      --specs

snapshotid

Unique ID of the snapshot

specs

Output the spec file associated with the snapshot

Example 1: Information displayed for a Robin Bundle based application snapshot

# robin snapshot info 3fb7b2c0e7ad11eaaa9ea101b344257c
Name                   : demo_snap1
Id                     : 3fb7b2c0e7ad11eaaa9ea101b344257c
Application Name       : demo
Application Kind       : ROBIN
State                  : ONLINE
Description            : -
Number of volumes      : 1
Number of backups      : 0
Creation Time          : 26 Aug 2020 08:03:07
Restored               : FALSE

Instances:
+---------------+---------------+--------------+
| Name          | Pod Name      | Namespace    |
+---------------+---------------+--------------+
| demo.nginx.01 | demo-nginx-01 | t001-u000003 |
+---------------+---------------+--------------+

Volumes:
+-----------------------------------------------------------+-------------------------------+--------------+-----------+---------------------------+
| ROBIN Name                                                | K8s Name                      | Namespace    | Size (GB) | Snapshot Space Limit (GB) |
+-----------------------------------------------------------+-------------------------------+--------------+-----------+---------------------------+
| demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42 | demo-nginx-01-data-1-68f51300 | t001-u000003 | 20G       | 4G                        |
+-----------------------------------------------------------+-------------------------------+--------------+-----------+---------------------------+

Example 2: Information displayed for a Helm based application snapshot

# robin snapshot info a4e900c84c6611eab476b72c237544ba
Name                   : mysql2_snapshot-1581381428
Id                     : a4e900c84c6611eab476b72c237544ba
Application Name       : mysql2
Application Kind       : helm
State                  : ONLINE
Description            : -
Number of volumes      : 1
Number of backups      : 0
Creation Time          : 10 Feb 2020 16:37:20
Restored               : TRUE

Spec:
+-----------------------+-------------------------------------------+--------------+
| Kind                  | Name                                      | Namespace    |
+-----------------------+-------------------------------------------+--------------+
| ConfigMap             | jaundiced-lionfish-mysql-test             | t003-u000005 |
| Secret                | jaundiced-lionfish-mysql                  | t003-u000005 |
| PersistentVolumeClaim | jaundiced-lionfish-mysql                  | t003-u000005 |
| Pod                   | jaundiced-lionfish-mysql-84bc874656-q4twd | t003-u000005 |
| Service               | jaundiced-lionfish-mysql                  | t003-u000005 |
| ReplicaSet            | jaundiced-lionfish-mysql-84bc874656       | t003-u000005 |
| Deployment            | jaundiced-lionfish-mysql                  | t003-u000005 |
+-----------------------+-------------------------------------------+--------------+

Volumes:
+------------------------------------------+-----------+--------------------+
| ROBIN Name                               | Size (GB) | Snapshot Size (GB) |
+------------------------------------------+-----------+--------------------+
| pvc-a17b6cb2-a6bb-4fc4-a0e3-97baa28ffdc6 | 8         | -                  |
+------------------------------------------+-----------+--------------------+

Example 3: Information displayed for a snapshot of a Namespace

# robin snapshot info fc0e74ba0fc611ec90008fd9e303c008
Name                   : ns1obcrh_nss1
Id                     : fc0e74ba0fc611ec90008fd9e303c008
Application Name       : ns1obcrh
Application Kind       : flexapp
State                  : ONLINE
Description            : Namespace ns1 snapshot
Number of volumes      : 1
Number of backups      : 0
Creation Time          : 07 Sep 2021 10:33:31
Restored               : FALSE

Spec:
+-----------------------+-------------+-----------+
| Kind                  | Name        | Namespace |
+-----------------------+-------------+-----------+
| ConfigMap             | mysql1-test | ns1       |
| Secret                | mysql1      | ns1       |
| PersistentVolumeClaim | mysql1      | ns1       |
| Service               | mysql1      | ns1       |
| Deployment            | mysql1      | ns1       |
+-----------------------+-------------+-----------+

Volumes:
+------------------------------------------+-----------+---------------------------+
| ROBIN Name                               | Size (GB) | Snapshot Space Limit (GB) |
+------------------------------------------+-----------+---------------------------+
| pvc-574b9417-0dd9-4eef-8d9b-9269d95be0ce | 1         | -                         |
+------------------------------------------+-----------+---------------------------+

Applications:
+--------+
| Name   |
+--------+
| mysql1 |
+--------+

Returns details about a specific snapshot such as its kind, the objects which are captured within it and its creation time,

End Point: /api/v6/robin_server/apps/<snapshot_id>?objtype=snapshot

Method: GET

URL Parameters: None

Data Parameters: None

Port: RCM Port (default value is 29442)

Headers:

  • Authorization: <auth_token> : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

Success Response Code: 200

Error Response Code: 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error)

Example Response:

Output
{
   "nsnapshots":0,
   "updates_available":false,
   "nvnodes":0,
   "app_kind":"robin",
   "bundle_name":"nginx",
   "zoneid":1597969746,
   "error":0,
   "mem":0,
   "gpu":0,
   "vnodes":[

   ],
   "name":"demo_snap1",
   "status":"Ready",
   "message":"",
   "resources":[

   ],
   "user_shares":[

   ],
   "rpool":"default",
   "nbackups":0,
   "backups":[

   ],
   "utime":0,
   "owner":{
      "first_name":"Robin",
      "last_name":"Systems",
      "email":null,
      "tenant_id":1,
      "username":"robin",
      "user_id":3,
      "tenant_name":"Administrators"
   },
   "restore_status":{
      "bytes_count":0,
      "bytes_skipped":0,
      "creation_end_time":0,
      "bytes_transferred":0,
      "creation_time":0
   },
   "parentid":13,
   "local_avail":true,
   "clone":false,
   "parent_app":"demo",
   "bundle_version":"1.0",
   "atype":"SNAPSHOT",
   "bundleid":1,
   "ctime":1598454187,
   "autopilot":true,
   "health":"Unknown",
   "ainstances":[

   ],
   "config":{
      "version":"1.15.8",
      "pvcpolicy":"create",
      "roles":[
         {
            "display_name":"nginx",
            "serviceAccountName":"{{app['name'].lower()}}-sa",
            "scaleout":"enabled",
            "name":"nginx",
            "restart_on_qoscfg":true,
            "vnodes":[
               {
                  "allocated_initContainers":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"init",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "limits":{
                              "memory":"128Mi",
                              "cpu":"25m"
                           }
                        },
                        "imagePullPolicy":"IfNotPresent",
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "1"
                        ]
                     }
                  ],
                  "k8s_provider":"robin",
                  "bundle_object_id":"a9f229864a74f936047b1b005de391a8",
                  "allocated_volumeMounts":[
                     {
                        "mountPath":"\/cm1",
                        "name":"vol-cm1"
                     },
                     {
                        "mountPath":"\/cm2",
                        "name":"vol-cm2"
                     },
                     {
                        "mountPath":"\/cm3",
                        "name":"vol-cm3"
                     }
                  ],
                  "mem":{
                     "hugepages_2m":0,
                     "hugepages_1g":0,
                     "size":1283457024
                  },
                  "restart_num":15,
                  "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1597953097832\/1597953155269\/nginx-1.0",
                  "root_fs":"\/usr\/local\/robin\/instances\/demo-nginx-01.t001-u000003.svc.cluster.local",
                  "pod_name":"demo-nginx-01",
                  "appid":13,
                  "host_ip":"172.21.20.104",
                  "volumes":[
                     {
                        "name":"vol-cm1",
                        "configMap":{
                           "defaultMode":420,
                           "name":"{{app['name'].lower()}}-cm1"
                        }
                     },
                     {
                        "name":"vol-cm2",
                        "configMap":{
                           "defaultMode":420,
                           "name":"{{app['name'].lower()}}-cm2"
                        }
                     },
                     {
                        "name":"vol-cm3",
                        "configMap":{
                           "defaultMode":420,
                           "name":"{{app['name'].lower()}}-cm3"
                        }
                     }
                  ],
                  "service_uids":[
                     "8de44f8e-fec0-47ee-b425-970758749188",
                     "3ca02e11-24b9-4555-8386-4f1b0e5e44fc",
                     "d273da82-86c3-4be6-9b29-1b930bece779"
                  ],
                  "appname":"demo",
                  "restart_on_qoscfg":true,
                  "env":{
                     "allocated":{
                        "ROBINHOST_TAG_ROBINRPOOL":"default",
                        "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux",
                        "POD_NS":"t001-u000003",
                        "POD_NAME":"demo-nginx-01",
                        "K8S_NODE":"cscale-82-140",
                        "ROBINHOST":"cscale-82-140.robinsystems.com",
                        "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64"
                     }
                  },
                  "serviceAccountName":"{{app['name'].lower()}}-sa",
                  "initContainers":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"init",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "limits":{
                              "memory":"128Mi",
                              "cpu":"25m"
                           }
                        },
                        "imagePullPolicy":"IfNotPresent",
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "1"
                        ]
                     }
                  ],
                  "enable_hooklogs":true,
                  "vnodeid":13,
                  "allocated_volumes":[
                     {
                        "name":"vol-cm1",
                        "configMap":{
                           "defaultMode":420,
                           "name":"demo-cm1"
                        }
                     },
                     {
                        "name":"vol-cm2",
                        "configMap":{
                           "defaultMode":420,
                           "name":"demo-cm2"
                        }
                     },
                     {
                        "name":"vol-cm3",
                        "configMap":{
                           "defaultMode":420,
                           "name":"demo-cm3"
                        }
                     }
                  ],
                  "volume_groups":[
                     {
                        "rpoolid":1,
                        "name":"demo.nginx.01.72.1.9457505a-dcf2-4f0c-b416-9467c10342d7",
                        "media":"HDD",
                        "stormgr_id":6,
                        "layout":"round-robin",
                        "replicas":1,
                        "volumes":[
                           "demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42"
                        ],
                        "device_sets":[
                           {
                              "devices":[
                                 {
                                    "host":"cscale-82-140.robinsystems.com",
                                    "tags":{

                                    },
                                    "wwn":"0x600224803bcdafde95b1f5cd27ceb5fb",
                                    "hostname":"cscale-82-140.robinsystems.com",
                                    "max_volumes_per_disk":10,
                                    "stormgr_id":2,
                                    "slices":77,
                                    "score":73,
                                    "type":"HDD",
                                    "devpath":"\/dev\/disk\/by-id\/scsi-3600224803bcdafde95b1f5cd27ceb5fb",
                                    "allocated_slices":24,
                                    "max_latency_sensitive_vols_per_disk":2,
                                    "write_unit":4096,
                                    "psize":107374182400,
                                    "reattachable":0,
                                    "pused":1107296256,
                                    "max_throughput_intensive_vols_per_disk":1,
                                    "protected":0,
                                    "role":"Storage",
                                    "aslices":50,
                                    "state":"READY",
                                    "capacity":107374182400
                                 }
                              ],
                              "name":"demo.nginx.01.72.1.9457505a-dcf2-4f0c-b416-9467c10342d7.0.a6cab386-2774-46d1-ad51-7a0f11fcdb35",
                              "stormgr_id":6
                           }
                        ]
                     }
                  ],
                  "gpu":{
                     "min":0,
                     "max":0
                  },
                  "bundleid":1,
                  "engine":"docker",
                  "annotations":{
                     "annokey1":"annovalue1",
                     "allocated":{
                        "annokey1":"annovalue1",
                        "annokey2":"annovalue2"
                     },
                     "annokey2":"annovalue2"
                  },
                  "ctime":1598453564,
                  "podSecurityContext":{
                     "runAsUser":0,
                     "allocated":{
                        "runAsUser":0
                     }
                  },
                  "hosttags":{
                     "robin.io\/robinrpool":[
                        "default"
                     ],
                     "kubernetes.io\/arch":[
                        "amd64"
                     ],
                     "kubernetes.io\/os":[
                        "linux"
                     ]
                  },
                  "allocated_host":"cscale-82-140.robinsystems.com",
                  "calico_inuse":true,
                  "image":{
                     "version":"1.15.8-alpine",
                     "registry_hostname":"",
                     "name":"nginx",
                     "engine":"docker",
                     "registry_port":""
                  },
                  "hostAliases":[
                     {
                        "hostnames":[
                           "foo.remote",
                           "bar.remote"
                        ],
                        "ip":"1.2.3.4"
                     }
                  ],
                  "readinessProbe":{
                     "exec":{
                        "command":[
                           "sleep",
                           "1"
                        ]
                     },
                     "initialDelaySeconds":5,
                     "allocated":{
                        "exec":{
                           "command":[
                              "sleep",
                              "1"
                           ]
                        },
                        "initialDelaySeconds":5
                     }
                  },
                  "rpoolid":1,
                  "role":"nginx",
                  "livenessProbe":{
                     "allocated":{
                        "periodSeconds":3,
                        "httpGet":{
                           "path":"\/",
                           "httpHeaders":[
                              {
                                 "value":"Awesome",
                                 "name":"Custom-Header"
                              }
                           ],
                           "port":80
                        },
                        "initialDelaySeconds":3
                     },
                     "periodSeconds":3,
                     "httpGet":{
                        "path":"\/",
                        "httpHeaders":[
                           {
                              "value":"Awesome",
                              "name":"Custom-Header"
                           }
                        ],
                        "port":80
                     },
                     "initialDelaySeconds":3
                  },
                  "utime":1598453564,
                  "volumeMounts":[
                     {
                        "mountPath":"\/cm1",
                        "name":"vol-cm1"
                     },
                     {
                        "mountPath":"\/cm2",
                        "name":"vol-cm2"
                     },
                     {
                        "mountPath":"\/cm3",
                        "name":"vol-cm3"
                     }
                  ],
                  "hostname":"demo-nginx-01.t001-u000003.svc.cluster.local",
                  "name":"demo.nginx.01",
                  "numa_allocations":{
                     "0":{
                        "gpu_used":0,
                        "isol_shared_cores_used":0,
                        "isol_dedicated_cores_used":0,
                        "hugepages_1g_used":0,
                        "hugepages_2m_used":0,
                        "mem_used":1283457024,
                        "non_isol_cores_used":1
                     }
                  },
                  "sidecars":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"busyside1",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "requests":{
                              "memory":"100Mi"
                           },
                           "limits":{
                              "memory":"200Mi"
                           }
                        },
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "3000"
                        ]
                     }
                  ],
                  "storage":[
                     {
                        "faultdomain":"host",
                        "pvcpolicy":"create",
                        "compression":"disabled",
                        "vol_ns":"t001-u000003",
                        "snapname":"snap1",
                        "lvm_vol_count":"0",
                        "replication":1,
                        "name":"demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42",
                        "blocksize":4096,
                        "workload":0,
                        "protection":0,
                        "type":"data",
                        "k8s_name":"demo-nginx-01-data-1-68f51300",
                        "volgrp_name":"demo.nginx.01.72.1.9457505a-dcf2-4f0c-b416-9467c10342d7",
                        "stordriver":{
                           "faultdomain":"host",
                           "protection":0,
                           "type":"das",
                           "media":"HDD"
                        },
                        "lvm_type":"None",
                        "snapshot_space_limit":4294967296,
                        "layout":"round-robin",
                        "encryption":"none",
                        "disk_tags":{

                        },
                        "mount_in_sidecars":true,
                        "allocated":{
                           "qgroupid":5,
                           "multinode_mounting":false,
                           "compression":0,
                           "genkey":1598453534287911,
                           "priority":2,
                           "snapname":"snap1",
                           "vtype":0,
                           "replication":1,
                           "current_snapshotid":1,
                           "name":"demo.nginx.01.data.1.68f51300-c283-4df7-bd9e-43d7314e1a42",
                           "params":{

                           },
                           "protection":0,
                           "appid":1,
                           "appname":"default",
                           "snapshot_space_limit":4294967296,
                           "stordriver":{
                              "faultdomain":"host",
                              "protection":0,
                              "type":"das",
                              "media":"HDD"
                           },
                           "block_size":4096,
                           "partitions":0,
                           "current_snapshot":"active_snap",
                           "grpid":6,
                           "next_snapshotid":2,
                           "next_backupid":1,
                           "media":72,
                           "size":21474836480,
                           "slice_size":1073741824,
                           "volumeid":"6",
                           "resource_poolid":1
                        },
                        "snap_reserved":20,
                        "media":"HDD",
                        "mount_in_initcontainers":true,
                        "path":"\/opt\/data",
                        "fstype":"ext4",
                        "size":21474836480
                     }
                  ],
                  "labels":{
                     "labelkey2":"labelvalue2",
                     "allocated":{
                        "labelkey2":"labelvalue2",
                        "labelkey1":"labelvalue1"
                     },
                     "labelkey1":"labelvalue1"
                  },
                  "allocated_host_type":"physical",
                  "enable_metrics":true,
                  "pod_ns":"t001-u000003",
                  "allocated_host_public_ip":"10.9.82.140",
                  "enable_portmapping":true,
                  "vnodehookargs":{

                  },
                  "cpu":{
                     "reserve":false,
                     "min":0,
                     "max":1
                  },
                  "allocated_host_public_hostname":"cscale-82-140.robinsystems.com",
                  "allocated_sidecars":[
                     {
                        "volumeMounts":[
                           {
                              "mountPath":"\/cm1",
                              "name":"vol-cm1"
                           },
                           {
                              "mountPath":"\/cm2",
                              "name":"vol-cm2"
                           },
                           {
                              "mountPath":"\/cm3",
                              "name":"vol-cm3"
                           }
                        ],
                        "name":"busyside1",
                        "securityContext":{
                           "allowPrivilegeEscalation":true
                        },
                        "resources":{
                           "requests":{
                              "memory":"100Mi"
                           },
                           "limits":{
                              "memory":"200Mi"
                           }
                        },
                        "image":"k8s.gcr.io\/busybox",
                        "command":[
                           "sleep",
                           "3000"
                        ]
                     }
                  ],
                  "cm_keys":[
                     "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCULUZ7abTGyeGhxSuXejf0VohBrk2ndhAQj0mx8whbs\/qyJmVmzenvGUVGGXSfri7m3PE++2V0xMathKizVpjcrWXoFTNZLlJKBVWog5XaCYIYRswAlow+rQU6aKJ+lP2DlUgmpZ9iG9VCae0vt+JosC2LeIDmgNm5vD6AN0aB\/rKHeQjCiJyvr90d9MbQ\/JAsh+\/1EkA4fTuTXRstlMH86gB+7JhAeCROIBz32Y7HV8hKf0SQx2fj2XFeQsRcZm8oC8n1En87qBXk+iz3qKkZBduNDp8XnKWFvhsKDQkuWGr1jUNp1SyaqNSFFZrv+EyFC1sHoORuJwAwYp8DLwyF root@cscale-82-140"
                  ],
                  "role_name":"nginx",
                  "allocated":{
                     "zonename":"default",
                     "nodeid":1,
                     "nodename":"cscale-82-140",
                     "zoneid":1597969746
                  },
                  "allocated_serviceAccountName":"demo-sa",
                  "securityContext":{
                     "allowPrivilegeEscalation":true,
                     "allocated":{
                        "allowPrivilegeEscalation":true
                     }
                  },
                  "network":[
                     {
                        "allocated_names":[
                           "eth0"
                        ],
                        "interfaces":1,
                        "allocated_netmask":"255.255.0.0",
                        "name":"robin-default",
                        "ippool":"robin-default",
                        "allocated_ip":"172.21.20.104",
                        "driver":"calico",
                        "subnet":"172.21.0.0",
                        "allocated_by":"system",
                        "allocated_prefix":16
                     }
                  ],
                  "sidecar_info":{
                     "containers":[
                        {
                           "hugepages_2m":0,
                           "name":"busyside1",
                           "cpu":0,
                           "mem":209715200,
                           "gpu":0,
                           "hugepages_1g":0
                        }
                     ],
                     "hugepages_2m":0,
                     "cpu":0,
                     "mem":209715200,
                     "gpu":0,
                     "hugepages_1g":0
                  },
                  "state":"STARTED",
                  "id":13,
                  "services":[
                     {
                        "annotations":{
                           "a1":"av1",
                           "a2":"av2"
                        },
                        "labels":{
                           "l2":"v2",
                           "namespace":"t001-u000003",
                           "robin.io\/username":"robin",
                           "scope":"vnode",
                           "robin.io\/tenant":"Administrators",
                           "robin.io\/tenant_id":"1",
                           "robin.io\/user_id":"3",
                           "l1":"v1"
                        },
                        "appname":"demo",
                        "scope":"pod",
                        "ports":[
                           {
                              "protocol":"TCP",
                              "name":"web",
                              "node_port":31574,
                              "port":80,
                              "target_port":80
                           }
                        ],
                        "cluster_ip":"172.19.64.18",
                        "vnodename":"demo-nginx-01",
                        "type":"NodePort",
                        "k8s_name":"demo-nginx-01-np-0",
                        "selectors":{
                           "robin.io\/vnode":"demo-nginx-01"
                        }
                     }
                  ]
               }
            ],
            "hostAliases":[
               {
                  "hostnames":[
                     "foo.remote",
                     "bar.remote"
                  ],
                  "ip":"1.2.3.4"
               }
            ],
            "volume_groups":[

            ],
            "image":{
               "version":"1.15.8-alpine",
               "registry_hostname":"",
               "name":"nginx",
               "engine":"docker",
               "registry_port":""
            },
            "services":[
               {
                  "rolename":"nginx",
                  "annotations":{
                     "a1":"av1",
                     "a2":"av2"
                  },
                  "ports":[
                     {
                        "protocol":"TCP",
                        "name":"web",
                        "node_port":null,
                        "port":80,
                        "target_port":80
                     }
                  ],
                  "appname":"demo",
                  "cluster_ip":"172.19.177.184",
                  "labels":{
                     "l2":"v2",
                     "namespace":"t001-u000003",
                     "robin.io\/username":"robin",
                     "scope":"role",
                     "robin.io\/tenant":"Administrators",
                     "robin.io\/tenant_id":"1",
                     "robin.io\/user_id":"3",
                     "l1":"v1"
                  },
                  "type":"ClusterIP",
                  "k8s_name":"demo-nginx-cl-0",
                  "selectors":{
                     "app":"demo",
                     "robin.io\/role":"nginx"
                  }
               },
               {
                  "rolename":"nginx",
                  "annotations":{
                     "a1":"av1",
                     "a2":"av2"
                  },
                  "ports":[
                     {
                        "protocol":"TCP",
                        "name":"web",
                        "node_port":32392,
                        "port":80,
                        "target_port":80
                     }
                  ],
                  "appname":"demo",
                  "cluster_ip":"172.19.51.165",
                  "labels":{
                     "l2":"v2",
                     "namespace":"t001-u000003",
                     "robin.io\/username":"robin",
                     "scope":"role",
                     "robin.io\/tenant":"Administrators",
                     "robin.io\/tenant_id":"1",
                     "robin.io\/user_id":"3",
                     "l1":"v1"
                  },
                  "type":"LoadBalancer",
                  "k8s_name":"demo-nginx-lb-0",
                  "selectors":{
                     "app":"demo",
                     "robin.io\/role":"nginx"
                  }
               }
            ],
            "qgroups":{
               "data":{
                  "rd_min_iops":0,
                  "rd_weight":1,
                  "enabled":false,
                  "rd_max_iops":2000000,
                  "wr_min_window":500,
                  "wr_weight":1,
                  "priority":1,
                  "wr_min_iops":0,
                  "rd_min_window":500,
                  "wr_max_iops":2000000
               }
            }
         }
      ],
      "apphooks":{
         "postdestroy":"python3 postdestroy.py",
         "allocated":{
            "postcreate":{
               "spec":{
                  "template":{
                     "spec":{
                        "containers":[
                           {
                              "volumeMounts":[
                                 {
                                    "mountPath":"\/cm1",
                                    "name":"vol-cm1"
                                 },
                                 {
                                    "mountPath":"\/cm2",
                                    "name":"vol-cm2"
                                 },
                                 {
                                    "mountPath":"\/cm3",
                                    "name":"vol-cm3"
                                 }
                              ],
                              "name":"demo-pin1",
                              "image":"k8s.gcr.io\/busybox",
                              "command":[
                                 "sleep",
                                 "1"
                              ]
                           }
                        ],
                        "backoffLimit":4,
                        "volumes":[
                           {
                              "name":"vol-cm1",
                              "configMap":{
                                 "defaultMode":420,
                                 "name":"demo-cm1"
                              }
                           },
                           {
                              "name":"vol-cm2",
                              "configMap":{
                                 "defaultMode":420,
                                 "name":"demo-cm2"
                              }
                           },
                           {
                              "name":"vol-cm3",
                              "configMap":{
                                 "defaultMode":420,
                                 "name":"demo-cm3"
                              }
                           }
                        ],
                        "restartPolicy":"Never"
                     }
                  }
               },
               "type":"job"
            },
            "precreate":"python3 precreate.py",
            "info":"python3 app_info.py",
            "preclone":"python3 precreate.py",
            "postdestroy":"python3 postdestroy.py"
         },
         "postcreate":{
            "spec":{
               "template":{
                  "spec":{
                     "containers":[
                        {
                           "volumeMounts":[
                              {
                                 "mountPath":"\/cm1",
                                 "name":"vol-cm1"
                              },
                              {
                                 "mountPath":"\/cm2",
                                 "name":"vol-cm2"
                              },
                              {
                                 "mountPath":"\/cm3",
                                 "name":"vol-cm3"
                              }
                           ],
                           "name":"{{app['name'].lower()}}-pin1",
                           "image":"k8s.gcr.io\/busybox",
                           "command":[
                              "sleep",
                              "1"
                           ]
                        }
                     ],
                     "backoffLimit":4,
                     "volumes":[
                        {
                           "name":"vol-cm1",
                           "configMap":{
                              "defaultMode":420,
                              "name":"{{app['name'].lower()}}-cm1"
                           }
                        },
                        {
                           "name":"vol-cm2",
                           "configMap":{
                              "defaultMode":420,
                              "name":"{{app['name'].lower()}}-cm2"
                           }
                        },
                        {
                           "name":"vol-cm3",
                           "configMap":{
                              "defaultMode":420,
                              "name":"{{app['name'].lower()}}-cm3"
                           }
                        }
                     ],
                     "restartPolicy":"Never"
                  }
               }
            },
            "type":"job"
         },
         "info":"python3 app_info.py",
         "preclone":"python3 precreate.py",
         "precreate":"python3 precreate.py"
      },
      "bundle_object_id":"a9f229864a74f936047b1b005de391a8",
      "clonemode":"unfenced",
      "zoneid":1597969746,
      "tenant":"Administrators",
      "from_template":null,
      "master_name":"demo",
      "parent_last_known_state":6,
      "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1597953097832\/1597953155269\/nginx-1.0",
      "rpoolid":1,
      "snapshot":"enabled",
      "appvars":{
         "var2":"{{APP_NAME}}-val2",
         "var1":"{{APP_NAME}}-val1"
      },
      "snapname":"snap1",
      "rpool":"default",
      "restart_num":15,
      "username":"robin",
      "app_ns":"t001-u000003",
      "namespace":"t001-u000003",
      "desc":"",
      "parentid":13,
      "enable_metrics":true,
      "enable_hooklogs":true,
      "allocated_appvars":{
         "var2":"demo-val2",
         "var1":"demo-val1"
      },
      "id":13,
      "robin_version":"5.3.1-230",
      "auto_relocate":true,
      "bundleid":1,
      "name":"demo_snap1",
      "content_id":"a9f229864a74f936047b1b005de391a8",
      "planid":14,
      "clone":"enabled"
   },
   "appcfg_autopilot":true,
   "snapshots":[

   ],
   "unique_id":"3fb7b2c0e7ad11eaaa9ea101b344257c",
   "disk":0,
   "backup_state":"Push failed",
   "state":"ONLINE",
   "id":14,
   "cpu":0,
   "repos":[

   ],
   "storagerepos":[

   ]
}

12.6. Add labels to an Application Snapshot

In order to associate a set of labels to a snapshot to help further identify it, issue the following command:

# robin snapshot add-label <snapname> <labels>

snapname

Snapshot name

labels

Comma seperated list of labels to add to the specified snapshot with each label in the format: <key>:<value>

Example:

# robin snapshot add-label mysql3_snapshot-1581493122 custom:yes --wait
Job:  331 Name: ApplicationSnapshotAddLabel  State: VALIDATED       Error: 0
Job:  331 Name: ApplicationSnapshotAddLabel  State: WAITING         Error: 0
Job:  331 Name: ApplicationSnapshotAddLabel  State: COMPLETED       Error: 0

# robin snapshot list --labels custom:yes
+----------------------------------+--------+----------+----------+----------------------------+
| Snapshot ID                      | State  | App Name | App Kind | Snapshot name              |
+----------------------------------+--------+----------+----------+----------------------------+
| b6033a5a4d6a11eab805255c7aa2236e | ONLINE | mysql3   | ROBIN    | mysql3_snapshot-1581493122 |
+----------------------------------+--------+----------+----------+----------------------------+

12.7. Remove labels from an Application Snapshot

In order to remove a set of labels from a snapshot such that they are no longer associated with it, issue the following command:

# robin snapshot remove-label <snapname> <labels>

snapname

Snapshot name

labels

Comma seperated list of labels to remove from the specified snapshot with each label in the format: <key>:<value>

Example:

# robin snapshot remove-label mysql3_snapshot-1581493122 custom:yes --wait
Job:  331 Name: ApplicationSnapshotRemoveLabel  State: VALIDATED       Error: 0
Job:  331 Name: ApplicationSnapshotRemoveLabel  State: WAITING         Error: 0
Job:  331 Name: ApplicationSnapshotRemoveLabel  State: COMPLETED       Error: 0

# robin snapshot list --labels custom:yes
+-------------+-------+----------+----------+---------------+
| Snapshot ID | State | App Name | App Kind | Snapshot name |
+-------------+-------+----------+----------+---------------+
+-------------+-------+----------+----------+---------------+