Skip to content
Migrate Pure Storage FlashArray Volumes to PKS - List, Snap and Clone vVols used for Kubernetes Persistent Volumes
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


List, Snap and Clone vvols used for Kubernetes Persistent Volumes

Start with PyVmomi

I started here with the great examples written for python and first class disks.

PyVomi Community Examples

Other required packages

We need the kubernetes module and the purestorage module for python.

pip install kubernetes
pip install purestorage

If you are using macosx and it is messing up your python environment you might need to:

pip3 install kubernetes
pip3 install purestorage

It is also required to have Ansible 2.8.x installed.

How to use to import to PKS functions

  1. First add your FlashArray IP and API token in two places.

Each should have a clearly marked section for you to edit. Also edit the file and change this line to match your KUBECONFIG. Failure to do so will result in more failing.

config.load_kube_config(config_file="<Path to KUBECONFIG>")
  1. Run the shell script (or create your own), you must supply the source PVC name or it will fail.

This script will scale down the deployment, in this demo script it is minio-deployment in the PKS cluster named testcluster. Your environment will vary. Please edit the script. Know the risks of messing with deployments and only do this if you are sure you have this right. I would hate for you to take down a Production app because you were playing with my script. Also, If you skip this section and do it anyway. It isn't my fault.

Also we assume you are using PSO. Make the pso-

./ <Your PVC Name>

FCD python files

These are for reference, mostly. The ansible playbook and python do not call them directly but might use the "tools" folder these scrips use. Honestly, these are handy to have around.

You can’t perform that action at this time.