1"use strict";(self.webpackChunkpxdocs_docusaurus=self.webpackChunkpxdocs_docusaurus||[]).push([[3762,39495,38731,51951],{3905:(e,t,a)=>{a.d(t,{Zo:()=>c,kt:()=>m});var n=a(67294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function p(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),i=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},c=function(e){var t=i(e.components);return n.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),d=i(a),m=r,h=d["".concat(l,".").concat(m)]||d[m]||u[m]||o;return a?n.createElement(h,s(s({ref:t},c),{},{components:a})):n.createElement(h,s({ref:t},c))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,s=new Array(o);s[0]=d;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:r,s[1]=p;for(var i=2;i<o;i++)s[i]=a[i];return n.createElement.apply(null,s)}return n.createElement.apply(null,a)}d.displayName="MDXCreateElement"},82854:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>b,frontMatter:()=>l,items:()=>m,metadata:()=>c,toc:()=>d});var n=a(87462),r=(a(67294),a(3905)),o=a(67013),s=a(23723),p=a(40444);const l={title:"Create and use cloud snapshots",sidebar_label:"Cloud snapshots",keywords:["cloud snapshots, cloud snaps, stork, kubernetes, k8s"],description:"Learn to take a cloud snapshot of a volume from a Kubernetes persistent volume claim (PVC) and use that snapshot as the volume for a new pod. Try today!",aliases:["/docs/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud/"],sidebar_position:200},i=void 0,c={unversionedId:"operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud",id:"operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud",title:"Create and use cloud snapshots",description:"Learn to take a cloud snapshot of a volume from a Kubernetes persistent volume claim (PVC) and use that snapshot as the volume for a new pod. Try today!",source:"@site/docs/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud.md",sourceDirName:"operations/operate-kubernetes/storage-operations/create-snapshots/on-demand",slug:"/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud",permalink:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud",draft:!1,tags:[],version:"current",lastUpdatedAt:1692678431,formattedLastUpdatedAt:"Aug 22, 2023",sidebarPosition:200,frontMatter:{title:"Create and use cloud snapshots",sidebar_label:"Cloud snapshots",keywords:["cloud snapshots, cloud snaps, stork, kubernetes, k8s"],description:"Learn to take a cloud snapshot of a volume from a Kubernetes persistent volume claim (PVC) and use that snapshot as the volume for a new pod. Try today!",aliases:["/docs/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapsh
1ots/on-demand/snaps-cloud/"],sidebar_position:200},sidebar:"pxEnterpriseSidebar",previous:{title:"Cloud backups for single PVCs",permalink:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud-single"},next:{title:"Snapshot single PVCs",permalink:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-single-pvc"}},u={},d=[{value:"Back up a volume and restore it to the same Portworx cluster",id:"back-up-a-volume-and-restore-it-to-the-same-portworx-cluster",level:2},{value:"Prerequisites",id:"prerequisites",level:3},{value:"Create cloud snapshots",id:"create-cloud-snapshots",level:3},{value:"Restore cloud snapshots",id:"restore-cloud-snapshots",level:3},{value:"Restore a cloud snapshot to a new PVC",id:"restore-a-cloud-snapshot-to-a-new-pvc",level:4},{value:"Restore a cloud snapshot to the original PVC",id:"restore-a-cloud-snapshot-to-the-original-pvc",level:4},{value:"References",id:"references",level:3},{value:"Back up a volume and restore it to a different Portworx cluster",id:"back-up-a-volume-and-restore-it-to-a-different-portworx-cluster",level:2},{value:"Prerequisites",id:"prerequisites-1",level:3},{value:"Create your cloud snapshot credentials on the source cluster",id:"create-your-cloud-snapshot-credentials-on-the-source-cluster",level:3},{value:"Back up a volume",id:"back-up-a-volume",level:3},{value:"Create your cloud snapshot credentials on the destination cluster",id:"create-your-cloud-snapshot-credentials-on-the-destination-cluster",level:3},{value:"Restore your volume on the target cluster",id:"restore-your-volume-on-the-target-cluster",level:3},{value:"The naming scheme for cloud backups",id:"the-naming-scheme-for-cloud-backups",level:2}
1],m=[{link:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud-single",description:"Instructions for backing up a PVC with consistency to cloud and restore PVCs.",icon:"\ud83d\udcc4",title:"Cloud backups for single PVCs"},{link:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-group-cloud",description:"Instructions for backing up a group of PVCs with consistency to cloud and restore PVCs from the backups.",icon:"\ud83d\udcc4",title:"Cloud backups for group of PVCs"}],h=e=>function(t){return console.warn("Component "+e+" was not imported, exported, or provided by MDXProvider as global scope"),(0,r.kt)("div",t)},k=h("CustomList"),f=h("NewValue178"),N=h("Variable"),g={toc:d,items:m};function b(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},g,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"This document shows how you can create cloud snapshots of Portworx volumes and how you can clone those snapshots to use them in pods."),(0,r.kt)("admonition",{type:"note"},(0,r.kt)("p",{parentName:"admonition"},"You cannot use an older version of Portworx to restore a cloud snapshot created with a newer one. For example, if you're running Portworx 2.1, you can't restore a cloud snapshot created with Portworx 2.2.")),(0,r.kt)("h2",{id:"back-up-a-volume-and-restore-it-to-the-same-portworx-cluster"},"Back up a volume and restore it to the same Portworx cluster"),(0,r.kt)("p",null,"This section shows how you can back up a volume and restore it to the same Portworx cluster."),(0,r.kt)("h3",{id:"prerequisites"},"Prerequisites"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"This requires that you already have ",(0,r.kt)("a",{parentName:"li",href:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/stork"},"Stork")," installed and running on your\nKubernetes cluster. If you fetched the Portworx specs from the Portworx spec generator in ",(0,r.kt)("a",{parentName:"li",href:"https://central.portworx.com/"},"Portworx Central")," and used the default options, Stork is already installed."),(0,r.kt)("li",{parentName:"ul"},"Cloud snapshots using below method is supported in Portworx version 1.4 and above."),(0,r.kt)("li",{parentName:"ul"},"Cloud snapshots (for aggregated volumes) using below method is supported in Portworx version 2.0 and above.")),(0,r.kt)(o.default,{mdxType:"NewValue177"}),(0,r.kt)("h3",{id:"create-cloud-snapshots"},"Create cloud snapshots"),(0,r.kt)("p",null,"With cloud snapshots, you can either snapshot individual PVCs one by one or snapshot a group of PVCs."),(0,r.kt)(k,{items:m,mdxType:"CustomList"}),(0,r.kt)("h3",{id:"restore-cloud-snapshots"},"Restore cloud snapshots"),(0,r.kt)("p",null,"Once you've created a cloud snapshot, you can restore it to a new PVC or the original PVC."),(0,r.kt)("h4",{id:"restore-a-cloud-snapshot-to-a-new-pvc"},"Restore a cloud snapshot to a new PVC"),(0,r.kt)(f,{mdxType:"NewValue178"}),(0,r.kt)("h4",{id:"restore-a-cloud-snapshot-to-the-original-pvc"},"Restore a cloud snapshot to the original PVC"),(0,r.kt)(s.default,{mdxType:"NewValue179"}),(0,r.kt)("h3",{id:"references"},"References"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"For details about how you can restore a snapshot to a new PVC or the original PVC, see the ",(0,r.kt)("a",{parentName:"li",href:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-cloud#restore-cloud-snapshots"},"Restore cloud snapshots")," section."),(0,r.kt)("li",{parentName:"ul"},"To create PVCs from group snapshots, read ",(0,r.kt)("a",{parentName:"li",href:"/portworx-enterprise/operations/operate-kubernetes/storage-operations/create-snapshots/on-demand/snaps-group"},"Creating PVCs from group snapshots"),".")),(0,r.kt)("h2",{id:"back-up-a-volume-and-restore-it-to-a-different-portworx-cluster"},"Back up a volume and restore it to a different Portworx cluster"),(0,r.kt)("p",null,"This section shows how you can back up a volume and restore it to a different Portworx cluster using the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl")," command-line utility."),(0,r.kt)("h3",{id:"prerequisites-1"},"Prerequisites"),(0,r.kt)("p",null,"Before you can back up and restore a volume to a different Portworx cluster, you must meet the following prerequisites:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"Two running Portworx clusters")," ",". Refer to the ",(0,r.kt)("a",{parentName:"li",href:"/portworx-enterprise/install-portworx/prerequisites#installation"},"Installation")," page for details about how to install Portworx."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"An object store"),". Cloud snapshots work with Amazon S3, Azure Blob, Google Cloud Storage, or any S3 compatible object store. If you don't have an object store, ",(0,r.kt)(N,{name:"companyName",mdxType:"Variable"})," recommends using MinIO. See the ",(0,r.kt)("a",{parentName:"li",href:"https://docs.min.io/"},"MinIO Quickstart Guide")," page for details about installing MinIO."),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("strong",{parentName:"li"},"A secret store provider"),". Refer to the ",(0,r.kt)("a",{parentName:"li",href:"/portworx-enterprise/operations/key-management/"},"Secret store management")," page for details about configuring a secret store provider.")),(0,r.kt)("h3",{id:"create-your-cloud-snapshot-credentials-on-the-source-cluster"},"Create your cloud snapshot credentials on the source cluster"),(0,r.kt)("p",null,"The options you use to create your cloud snapshot credentials differ based on which secret store provider you use. The steps in this document describe AWS KMS, but you can find instructions for creating other credentials in the ",(0,r.kt)("a",{parentName:"p",href:"/portworx-enterprise/reference/CLI/credentials#create-and-configure-credentials"},"CLI reference"),"."),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Enter the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl credentials create")," command, specifying the following:"),(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--provider")," flag with the name of the cloud provider (",(0,r.kt)("inlineCode",{parentName:"p"},"s3"),").")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-access-key")," flag with your secret access key")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-secret-key")," flag with your access key ID")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-region")," flag with the name of the S3 region (",(0,r.kt)("inlineCode",{parentName:"p"},"us-east-1"),")")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-endpoint")," flag with the name of the endpoint (",(0,r.kt)("inlineCode",{parentName:"p"},"s3.amazonaws.com"),")")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The optional ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-storage-class")," flag with either the ",(0,r.kt)("inlineCode",{parentName:"p"},"STANDARD")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"STANDARD-IA")," value, depending on which storage class you prefer")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The name of your cloud credentials"),(0,r.kt)("p",{parentName:"li"},"Example:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl credentials create --provider s3 --s3-access-key <YOUR_ACCESS_KEY> --s3-secret-key <YOUR_SECRET_KEY> --s3-region us-east-1 --s3-endpoint <YOUR_ENDPOINT> --s3-storage-class <YOUR_STORAGE_CLASS> <YOUR_SOURCE_S3_CRED>\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"Credentials created successfully, UUIDU0d9847d6-786f-4ed8- b263-5cde5a5a12f5\n"))))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"You can validate your cloud snapshot credentials by entering the ",(0,r.kt)("inlineCode",{parentName:"p"}
1,"pxctl credentials validate")," command followed by the name of your cloud credentials:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cred validate <YOUR_SOURCE_S3_CRED>\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"Credential validated successfully\n")))),(0,r.kt)("h3",{id:"back-up-a-volume"},"Back up a volume"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Enter the following ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl volume list")," command to list all volumes on the source cluster:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl volume list\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"ID NAME SIZE HA SHARED ENCRYPTED IO_PRIORITY STATUS SNAP-ENABLED\n869510655149846346 testvol 1 GiB 1 no no HIGH up - attached on 70.0.88.123 no\n186765995885697345 vol2 1 GiB 1 no no HIGH up - attached on 70.0.88.123 no\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"To back up a volume, enter the following ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl cloudsnap backup")," command, specifying the name of your volume. The following example backs up a volume called ",(0,r.kt)("inlineCode",{parentName:"p"},"testvol"),":"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cloudsnap backup testvol\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"Cloudsnap backup started successfully with id: 0be453e1-ec7a-4db7-9724-a46868cc6b5c\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Enter the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl cloudsnap status")," command to display the status of your backup or restore operations:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cloudsnap status\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"NAME SOURCEVOLUME STATE NODE TIME-ELAPSED COMPLETED\n5c5d3afa-6579-465e-9e34-9bff6ea440eb 869510655149846346 Backup-Failed 70.0.87.153 80.915632ms Wed, 22 Jan 2020 23:51:17 UTC\ne44b3fb4-45f6-4a83-980b-10458b7a8445 869510655149846346 Backup-Done 70.0.87.153 55.098204ms Wed, 22 Jan 2020 23:52:15 UTC\n8a32dd41-931b-4ccf-8b99-f15839b26e76 186765995885697345 Backup-Failed 70.0.87.153 39.703754ms Wed, 29 Jan 2020 18:17:30 UTC\n7ddc9d23-541c-41d3-90c6-2f4a504c01f9 186765995885697345 Backup-Done 70.0.87.153 60.439873ms Wed, 29 Jan 2020 18:34:17 UTC\n0be453e1-ec7a-4db7-9724-a46868cc6b5c 869510655149846346 Backup-Done 70.0.87.153 45.874676ms Wed, 29 Jan 2020 22:32:30 UTC\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"To see more details about your backup operation, enter the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl cloudsnap status")," command specifying the following:"),(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--json")," flag")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--name")," flag with the task name of your backup."),(0,r.kt)("p",{parentName:"li"}," Example:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl --json cloudnsap status --name 0be453e1-ec7a-4db7-9724-a46868cc6b5c\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},'0be453e1-ec7a-4db7-9724-a46868cc6b5c\n{\n"0be453e1-ec7a-4db7-9724-a46868cc6b5c": {\n"ID": "3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-1140911084048715440",\n"OpType": "Backup",\n"Status": "Done",\n"BytesDone": 368640,\n"BytesTotal": 0,\n"EtaSeconds": 0,\n"StartTime": "2020-01-29T22:32:30.258745865Z",\n"CompletedTime": "2020-01-29T22:32:30.304620541Z",\n"NodeID": "a5f87c11-05c5-41b4-84e5-3c38a8c04736",\n"SrcVolumeID": "869510655149846346",\n"Info": [\n""\n],\n"CredentialUUID": "0d9847d6-786f-4ed8-b263-5cde5a5a12f5",\n"GroupCloudBackupID": ""\n}\n')))))),(0,r.kt)("ol",{start:5},(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Run the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl cloudsnap list")," command, and look through the output to find the identifier of the cloud snapshot associated with your volume. You will use this to restore your cloud snapshot."),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cloudsnap list\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"SOURCEVOLUME SOURCEVOLUMEID CLOUD-SNAP-ID CREATED-TIME TYPE STATUS\ntestvol 869510655149846346 3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-457116323485794032 Wed, 22 Jan 2020 23:52:15 UTC Manual Done\nvol2 186765995885697345 3f2fa12e-186f-466d-ac35-92cf569c9358/186765995885697345-237744851553132030 Wed, 29 Jan 2020 18:34:17 UTC Manual Done\ntestvol 869510655149846346 3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-1140911084048715440 Wed, 29 Jan 2020 22:32:30 UTC Manual Done\n")),(0,r.kt)("p",{parentName:"li"}," The ",(0,r.kt)("inlineCode",{parentName:"p"},"CLOUD-SNAP-ID")," column is in the form of ",(0,r.kt)("inlineCode",{parentName:"p"},"<YOUR_SOURCE_CLUSTER_ID>/<YOUR_CLOUD_SNAP_ID>"),". In this example, the identifier of the source cluster is ",(0,r.kt)("inlineCode",{parentName:"p"},"3f2fa12e-186f-466d-ac35-92cf569c9358"),", and the identifier of the cloud snapshot is ",(0,r.kt)("inlineCode",{parentName:"p"},"869510655149846346-457116323485794032"),"."))),(0,r.kt)("h3",{id:"create-your-cloud-snapshot-credentials-on-the-destination-cluster"},"Create your cloud snapshot credentials on the destination cluster"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Enter the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl credentials create")," command, specifying the following:"),(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--provider")," flag with the name of the cloud provider (",(0,r.kt)("inlineCode",{parentName:"p"},"s3"),").")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-access-key")," flag with your secret access key")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-secret-key")," flag with your access key ID")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-region")," flag with the name of the S3 region (",(0,r.kt)("inlineCode",{parentName:"p"},"us-east-1"),")")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-endpoint")," flag with the name of the endpoint (",(0,r.kt)("inlineCode",{parentName:"p"},"s3.amazonaws.com"),")")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The optional ",(0,r.kt)("inlineCode",{parentName:"p"},"--s3-storage-class")," flag with either the ",(0,r.kt)("inlineCode",{parentName:"p"},"STANDARD")," or ",(0,r.kt)("inlineCode",{parentName:"p"},"STANDARD-IA")," value, depending on which storage class you prefer")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},"The name of your cloud credentials"),(0,r.kt)("p",{parentName:"li"},"Example:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl credentials create --provider s3 --s3-access-key <YOUR_ACCESS_KEY> --s3-secret-key <YOUR_SECRET_KEY> --s3-region us-east-1 --s3-endpoint <YOUR_ENDPOINT> --s3-storage-class <YOUR_STORAGE_CLASS> <YOUR_DEST_S3_CRED>\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"Credentials created successfully, UUID:bb281a27-c2bb-4b3d-b5b9- efa0316a9561\n")))))),(0,r.kt)("h3",{id:"restore-your-volume-on-the-target-cluster"},"Restore your volume on the target cluster"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"On the target cluster, verify that your cloud snapshot is visible. Enter the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl cloudsnap list")," command, specifying the ",(0,r.kt)("inlineCode",{parentName:"p"},"--cluster")," flag with the identifier of the source cluster."),(0,r.kt)("p",{parentName:"li"}," Example:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cloudsnap list --cluster 3f2fa12e-186f-466d- ac35-92cf569c9358\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"3f2fa12e-186f-466d-ac35-92cf569c9358\nSOURCEVOLUME SOURCEVOLUMEID CLOUD-SNAP-ID CREATED-TIME TYPE STATUS\ntestvol 869510655149846346 3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-457116323485794032 Wed, 22 Jan 2020 23:52:15 UTC Manual Done\nvol2 186765995885697345 3f2fa12e-186f-466d-ac35-92cf569c9358/186765995885697345-237744851553132030 Wed, 29 Jan 2020 18:34:17 UTC Manual Done\ntestvol 869510655149846346 3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-1140911084048715440 Wed, 29 Jan 2020 22:32:30 UTC Manual Done\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"To restore your volume, run the ",(0,r.kt)("inlineCode",{parentName:"p"}
1,"pxctl cloudsnap restore")," command specifying the ",(0,r.kt)("inlineCode",{parentName:"p"},"--snap")," flag with the cloud snapshot identifier associated with your backup.\nExample:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cloudsnap restore --snap 3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-1140911084048715440\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"Cloudsnap restore started successfully on volume: 1127186980413628688 with task name:e306a2e0-4c88-426c-ae88-a6b731f73983\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"To see the status of your restore operation, enter the following command:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl cloudsnap status\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"NAME SOURCEVOLUME STATE NODE TIME-ELAPSED COMPLETED\n2e53ca62-8289-498b-ad9d-dd77c14c00bc 79001397979145130 Backup-Done 70.0.91.94 44.634974ms Wed, 29 Jan 2020 20:13:58 UTC\n6304dfb7-2f9f-4236-9392-2aba15c5b300 3f2fa12e-186f-466d-ac35-92cf569c9358/869510655149846346-1140911084048715440 Restore-Done 70.0.91.94 53.527074ms Wed, 29 Jan 2020 22:52:47 UTC\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Run the ",(0,r.kt)("inlineCode",{parentName:"p"},"pxctl volume list")," command to list all volumes on the destination cluster:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"pxctl volume list\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"ID NAME SIZE HA SHARED ENCRYPTED IO_PRIORITY STATUS SNAP-ENABLED\n1021141073379827532 Restore-869510655149846346-556794585 1 GiB 1 no no HIGH up - detached no\n79001397979145130 samvol 1 GiB 1 no no HIGH up - detached no\n")))),(0,r.kt)("h2",{id:"the-naming-scheme-for-cloud-backups"},"The naming scheme for cloud backups"),(0,r.kt)(p.default,{mdxType:"NewValue180"}))}b.isMDXComponent=!0},40444:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>i});var n=a(87462),r=(a(67294),a(3905));const o={hidden:!0},s=void 0,p={unversionedId:"shared/cloud-snaps-naming-scheme",id:"shared/cloud-snaps-naming-scheme",title:"cloud-snaps-naming-scheme",description:"Cloud backups adhere to the following naming scheme: /-.",source:"@site/docs/portworx-enterprise/shared/cloud-snaps-naming-scheme.md",sourceDirName:"shared",slug:"/shared/cloud-snaps-naming-scheme",permalink:"/portworx-enterprise/shared/cloud-snaps-naming-scheme",draft:!1,tags:[],version:"current",lastUpdatedAt:1690215190,formattedLastUpdatedAt:"Jul 24, 2023",frontMatter:{hidden:!0},sidebar:"pxEnterpriseSidebar",previous:{title:"Generate shared secrets",permalink:"/portworx-enterprise/shared/cloud-references-security-kubernetes-shared-secret-model-generating-secrets"},next:{title:"Shared Volumes",permalink:"/portworx-enterprise/shared/concepts-shared-volumes"}},l={},i=[],c={toc:i};
1function u(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"Cloud backups adhere to the following naming scheme: ",(0,r.kt)("inlineCode",{parentName:"p"},"<bucket-id>/<vol-id>-<snap-id>"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Example"),":"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"2e4d4b67-95d7-481e-aec5-14223ac55170/56706279008755778-725134927222077463"))),(0,r.kt)("p",null,"For incremental backups, Portworx adds the ",(0,r.kt)("inlineCode",{parentName:"p"},"-incr")," suffix as follows: ",(0,r.kt)("inlineCode",{parentName:"p"},"<bucket-id>/<vol-id>-<snap-id>-incr"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},"Example"),":"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("inlineCode",{parentName:"li"},"2e4d4b67-95d7-481e-aec5-14223ac55170/590114184663672482-951325819047337066-incr"))))}u.isMDXComponent=!0},67013:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>i});var n=a(87462),r=(a(67294),a(3905));const o={title:"Shared content for Kubernetes snapshots - configuring cloud secrets",description:"Shared content for Kubernetes snapshots - configuring cloud secrets",keywords:["snapshots, cloud secrets, kubernetes, k8s"],hidden:!0},s=void 0,p={unversionedId:"shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-cloud-snap-creds-prereq",id:"shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-cloud-snap-creds-prereq",title:"Shared content for Kubernetes snapshots - configuring cloud secrets",description:"Shared content for Kubernetes snapshots - configuring cloud secrets",source:"@site/docs/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-cloud-snap-creds-prereq.md",sourceDirName:"shared",slug:"/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-cloud-snap-creds-prereq",permalink:"/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-cloud-snap-creds-prereq",draft:!1,tags:[],version:"current",lastUpdatedAt:1690623727,formattedLastUpdatedAt:"Jul 29, 2023",frontMatter:{title:"Shared content for Kubernetes snapshots - configuring cloud secrets",description:"Shared content for Kubernetes snapshots - configuring cloud secrets",keywords:["snapshots, cloud secrets, kubernetes, k8s"],hidden:!0},sidebar:"pxEnterpriseSidebar",previous:{title:"Shared",permalink:"/portworx-enterprise/shared/portworx-install-with-kubernetes-shared-generate-the-spec-footer-operator"},next:{title:"Shared content for Kubernetes snapshots - cassandra steps 1 & 2",permalink:"/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-group-snap-cassandra-step-1-2"}},l={},i=[{value:"Configuring cloud secrets",id:"configuring-cloud-secrets",level:3}],c={toc:i};
1function u(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h3",{id:"configuring-cloud-secrets"},"Configuring cloud secrets"),(0,r.kt)("p",null,"To create cloud snapshots, one needs to setup secrets with Portworx which will get used to connect and authenticate with the configured cloud provider."),(0,r.kt)("p",null,"Follow instructions on the ",(0,r.kt)("a",{parentName:"p",href:"/portworx-enterprise/reference/CLI/credentials#create-and-configure-credentials"},"create and configure credentials")," section to setup secrets."))}u.isMDXComponent=!0},23723:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>i});var n=a(87462),r=(a(67294),a(3905));const o={title:"Shared content for Kubernetes snapshots - in-place restore PVC from snap",description:"Shared content for Kubernetes snapshots - restore PVC from snap",keywords:["snapshots, kubernetes, k8s"],hidden:!0},s=void 0,p={unversionedId:"shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-in-place-restore-pvc-from-snap",id:"shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-in-place-restore-pvc-from-snap",title:"Shared content for Kubernetes snapshots - in-place restore PVC from snap",description:"Shared content for Kubernetes snapshots - restore PVC from snap",source:"@site/docs/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-in-place-restore-pvc-from-snap.md",sourceDirName:"shared",slug:"/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-in-place-restore-pvc-from-snap",permalink:"/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-in-place-restore-pvc-from-snap",draft:!1,tags:[],version:"current",lastUpdatedAt:1690328882,formattedLastUpdatedAt:"Jul 25, 2023",frontMatter:{title:"Shared content for Kubernetes snapshots - in-place restore PVC from snap",description:"Shared content for Kubernetes snapshots - restore PVC from snap",keywords:["snapshots, kubernetes, k8s"],hidden:!0},sidebar:"pxEnterpriseSidebar",previous:{title:"Shared content for Kubernetes snapshots - group snaps v2",permalink:"/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-group-snap-v2-prereqs"},next:{title:"Shared content for Kubernetes snapshots - restore PVC from snap",permalink:"/portworx-enterprise/shared/portworx-install-with-kubernetes-storage-operations-create-snapshots-k8s-restore-pvc-from-snap"}},l={},i=[],c={toc:i};
1function u(e){let{components:t,...a}=e;return(0,r.kt)("wrapper",(0,n.Z)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"When you perform an in-place restore to a PVC, Stork takes the pods using that PVC offline, restores the volume from the snapshot, then brings the pods back online."),(0,r.kt)("admonition",{type:"note"},(0,r.kt)("p",{parentName:"admonition"},"In-place restore using VolumeSnapshotRestore works only for applications deployed using the ",(0,r.kt)("inlineCode",{parentName:"p"},"stork")," scheduler.\nIf you're not using the Stork scheduler, Portworx displays the following error when describing the VolumeSnapshotRestore resource:"),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"Events:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Warning Failed 5s (x2 over 15s) stork application not scheduled by stork scheduler\n"))),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Create a ",(0,r.kt)("inlineCode",{parentName:"p"},"VolumeSnapshotRestore")," YAML file specifying the following:"),(0,r.kt)("ul",{parentName:"li"},(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},(0,r.kt)("strong",{parentName:"p"},"apiVersion")," as ",(0,r.kt)("inlineCode",{parentName:"p"},"stork.libopenstorage.org/v1alpha1"))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},(0,r.kt)("strong",{parentName:"p"},"kind")," as ",(0,r.kt)("inlineCode",{parentName:"p"},"VolumeSnapshotRestore"))),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},(0,r.kt)("strong",{parentName:"p"},"metadata.name")," with the name of the object that performs the restore")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},(0,r.kt)("strong",{parentName:"p"},"metadata.namespace")," with the name of the target namespace")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},(0,r.kt)("strong",{parentName:"p"},"spec.sourceName")," with the name of the snapshot you want to restore")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("p",{parentName:"li"},(0,r.kt)("strong",{parentName:"p"},"spec.sourceNamespace")," with the namespace in which the snapshot resides"),(0,r.kt)("p",{parentName:"li"},"The following example restores data from a snapshot called ",(0,r.kt)("inlineCode",{parentName:"p"},"mysql-snapshot")," which was created in the ",(0,r.kt)("inlineCode",{parentName:"p"},"mysql-snap-restore-splocal")," namespace to a PVC called ",(0,r.kt)("inlineCode",{parentName:"p"},"mysql-snap-inrestore")," in the ",(0,r.kt)("inlineCode",{parentName:"p"},"default")," namespace:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-yaml"},"apiVersion: stork.libopenstorage.org/v1alpha1\nkind: VolumeSnapshotRestore\nmetadata:\n name: mysql-snap-inrestore\n namespace: default\nspec:\n sourceName: mysql-snapshot\n sourceNamespace: mysql-snap-restore-splocal\n"))))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"Place the spec into a file called ",(0,r.kt)("inlineCode",{parentName:"p"},"mysql-cloud-snapshot-restore.yaml")," and apply it:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl apply -f mysql-cloud-snapshot-restore.yaml\n"))),(0,r.kt)("li",{parentName:"ol"},(0,r.kt)("p",{parentName:"li"},"You can enter the following command to see the status of the restore process:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"storkctl get volumesnapshotrestore\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},"NAME SOURCE-SNAPSHOT SOURCE-SNAPSHOT-NAMESPACE STATUS VOLUMES CREATED\nmysql-snap-inrestore mysql-snapshot default Successful 1 23 Sep 19 21:55 EDT \n")),(0,r.kt)("p",{parentName:"li"}," You can also use the ",(0,r.kt)("inlineCode",{parentName:"p"},"kubectl describe")," command to retrieve more detailed information about the status of the restore process."),(0,r.kt)("p",{parentName:"li"}," Example:"),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl describe volumesnapshotrestore mysql-snap-inrestore\n")),(0,r.kt)("pre",{parentName:"li"},(0,r.kt)("code",{parentName:"pre",className:"language-output"},'Name: mysql-snap-inrestore\nNamespace: default\nLabels: <none>\nAnnotations: kubectl.kubernetes.io/last-applied-configuration:\n {"apiVersion":"stork.libopenstorage.org/v1alpha1","kind":"VolumeSnapshotRestore","metadata":{"annotations":{},"name":"mysql-snap-inrestore...\nAPI Version: stork.libopenstorage.org/v1alpha1\nKind: VolumeSnapshotRestore\nMetadata:\n Creation Timestamp: 2019-09-23T17:24:30Z\n Generation: 5\n Resource Version: 904014\n Self Link: /apis/stork.libopenstorage.org/v1alpha1/namespaces/default/volumesnapshotrestores/mysql-snap-inrestore\n UID: 00474a5c-de27-11e9-986b-000c295d6364\nSpec:\n Group Snapshot: false\n Source Name: mysql-snapsh
1ot\n Source Namespace: default\nStatus:\n Status: Successful\n Volumes:\n Namespace: default\n Pvc: mysql-data\n Reason: Restore is successful\n Snapshot: k8s-volume-snapshot-cb909cf9-de26-11e9-ad56-320ff611f4ca\n Status: Successful\n Volume: pvc-8b996a17-de26-11e9-986b-000c295d6364\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal Successful 0s stork Snapshot in-Place Restore completed\n')))))}u.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.