hpe-storage / python-hpedockerplugin

HPE Native Docker Plugin
Apache License 2.0
36 stars 64 forks source link

snapshots in openshift #665

Closed oscarnorori closed 5 years ago

oscarnorori commented 5 years ago

I have a question regarding the openshift/kubernetes plugin. Beyond being able to dynamically provision volumes, we also have a need to create a snapshot of one of those volumes and then mount that snapshot in another pod. Typical use case is needing to create a pod for production investigation purposes or for testing of a new feature with production data. The documentation does not cover how to do this via the plugin. We are using openshift/kubernetes for this.

wdurairaj commented 5 years ago

You need to use virtualCopyOf parameter in storage class Eg.

---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
 name: sc-hpe-3par-snap
provisioner: hpe.com/hpe
parameters:
  virtualCopyOf: "vol_name_to_take_snapshot"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-hpe
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 16Gi
  storageClassName: sc-hpe-3par-snap

Complete list of parameters are there in

https://github.com/hpe-storage/python-hpedockerplugin/blob/master/docs/usage.md#supported-storageclass-parameters

wdurairaj commented 5 years ago

Once the PVC created above gets into Bound state the snapshot will be taken for src volume pointed in virtualCopyOf and that snapshot will be used for POD mount.

oscarnorori commented 5 years ago

Thanks for responding to my query. So basically, for any scenario where a snapshot needs to be created from a dynamically provisioned volume, a new storage class needs to be created for that volume. Then if we need to create X pods with a copy of that volume, we just need to create X pvcs that reference that specific storage class. In terms of the list of supported storage parameters, is there another document that describes in detail what each one means? Some of the parameters are obvious while others are not in terms of their use case.

From: William Durairaj notifications@github.com Sent: June 25, 2019 12:54 PM To: hpe-storage/python-hpedockerplugin python-hpedockerplugin@noreply.github.com Cc: Norori, Oscar ONorori@ifdsgroup.com; Author author@noreply.github.com Subject: Re: [hpe-storage/python-hpedockerplugin] snapshots in openshift (#665)

You need to use virtualCopyOf parameter in storage class Eg.


kind: StorageClass

apiVersion: storage.k8s.io/v1

metadata:

name: sc-hpe-3par-snap

provisioner: hpe.com/hpe

parameters:

virtualCopyOf: "vol_name_to_take_snapshot"


kind: PersistentVolumeClaim

apiVersion: v1

metadata:

name: pvc-hpe

spec:

accessModes:

- ReadWriteOnce

resources:

requests:

  storage: 16Gi

storageClassName: sc-hpe-3par-snap

Complete list of parameters are there in

https://github.com/hpe-storage/python-hpedockerplugin/blob/master/docs/usage.md#supported-storageclass-parameters

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/hpe-storage/python-hpedockerplugin/issues/665?email_source=notifications&email_token=AMOLE7JQUYNP7KMQPX5R4SLP4JERBA5CNFSM4H3J64O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQ4PIQ#issuecomment-505530274, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMOLE7PNTT4XKMEXOYCVQ63P4JERBANCNFSM4H3J64OQ.

Please consider the environment before printing this email and any attachments.

This e-mail and any attachments are intended only for the individual or company to which it is addressed and may contain information which is privileged, confidential and prohibited from disclosure or unauthorized use under applicable law. If you are not the intended recipient of this e-mail, you are hereby notified that any use, dissemination, or copying of this e-mail or the information contained in this e-mail is strictly prohibited by the sender. If you have received this transmission in error, please return the material received to the sender and delete all copies from your system.

oscarnorori commented 5 years ago

Please ignore my question about parameters. I found the section where it describes their use. Thanks.

From: William Durairaj notifications@github.com Sent: June 25, 2019 12:54 PM To: hpe-storage/python-hpedockerplugin python-hpedockerplugin@noreply.github.com Cc: Norori, Oscar ONorori@ifdsgroup.com; Author author@noreply.github.com Subject: Re: [hpe-storage/python-hpedockerplugin] snapshots in openshift (#665)

You need to use virtualCopyOf parameter in storage class Eg.


kind: StorageClass

apiVersion: storage.k8s.io/v1

metadata:

name: sc-hpe-3par-snap

provisioner: hpe.com/hpe

parameters:

virtualCopyOf: "vol_name_to_take_snapshot"


kind: PersistentVolumeClaim

apiVersion: v1

metadata:

name: pvc-hpe

spec:

accessModes:

- ReadWriteOnce

resources:

requests:

  storage: 16Gi

storageClassName: sc-hpe-3par-snap

Complete list of parameters are there in

https://github.com/hpe-storage/python-hpedockerplugin/blob/master/docs/usage.md#supported-storageclass-parameters

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/hpe-storage/python-hpedockerplugin/issues/665?email_source=notifications&email_token=AMOLE7JQUYNP7KMQPX5R4SLP4JERBA5CNFSM4H3J64O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQ4PIQ#issuecomment-505530274, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMOLE7PNTT4XKMEXOYCVQ63P4JERBANCNFSM4H3J64OQ.

Please consider the environment before printing this email and any attachments.

This e-mail and any attachments are intended only for the individual or company to which it is addressed and may contain information which is privileged, confidential and prohibited from disclosure or unauthorized use under applicable law. If you are not the intended recipient of this e-mail, you are hereby notified that any use, dissemination, or copying of this e-mail or the information contained in this e-mail is strictly prohibited by the sender. If you have received this transmission in error, please return the material received to the sender and delete all copies from your system.

wdurairaj commented 5 years ago

Complete list of -o options are there in https://github.com/hpe-storage/python-hpedockerplugin/blob/master/docs/usage.md#usage-of-the-hpe-3par-volume-plug-in-for-docker

oscarnorori commented 5 years ago

Yes found it. Thank you.

From: William Durairaj notifications@github.com Sent: June 25, 2019 1:31 PM To: hpe-storage/python-hpedockerplugin python-hpedockerplugin@noreply.github.com Cc: Norori, Oscar ONorori@ifdsgroup.com; Author author@noreply.github.com Subject: Re: [hpe-storage/python-hpedockerplugin] snapshots in openshift (#665)

Complete list of -o options are there in https://github.com/hpe-storage/python-hpedockerplugin/blob/master/docs/usage.md#usage-of-the-hpe-3par-volume-plug-in-for-docker

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/hpe-storage/python-hpedockerplugin/issues/665?email_source=notifications&email_token=AMOLE7LHXXNVRKY33KKVFQTP4JI6RA5CNFSM4H3J64O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQ76MQ#issuecomment-505544498, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMOLE7MZP7EPF4B7I4QKDQTP4JI6RANCNFSM4H3J64OQ.

Please consider the environment before printing this email and any attachments.

This e-mail and any attachments are intended only for the individual or company to which it is addressed and may contain information which is privileged, confidential and prohibited from disclosure or unauthorized use under applicable law. If you are not the intended recipient of this e-mail, you are hereby notified that any use, dissemination, or copying of this e-mail or the information contained in this e-mail is strictly prohibited by the sender. If you have received this transmission in error, please return the material received to the sender and delete all copies from your system.