Search This Blog

Sunday, 13 September 2020

Portworx Useful Commands

 Basic Commands


$ pxctl --version        #To get the version
$ pxctl status     #To get the portworx cluster status
$ pxctl service --help                          #To list the availale commands
$ pxctl service drive --help                 #To list the availale commands     
$ pxctl service pool show --json         #To show pool status in json format
$ pxctl service pool show                   #To get the pool information
$ pxctl volume list     #To list the all volumes
$ pxctl cluster --help     #To get the Portwork cluster commands
$ pxctl status --json                            #To get Portwork status in json format

#Working with Volumes


$ pxctl volume list
$ pxctl volume inspect VOLUME_NAME

#####################################################
Volume  :  604134074344827416
        Name                     :  user_volume
        Size                     :  2.0 GiB
        Format                   :  ext4
        HA                       :  2
        IO Priority              :  LOW
        Creation time            :  Sep 14 07:16:37 UTC 2020
        Shared                   :  no
        Status                   :  up
        State                    :  detached
        Reads                    :  0
        Reads MS                 :  0
        Bytes Read               :  0
        Writes                   :  0
        Writes MS                :  0
        Bytes Written            :  0
        IOs in progress          :  0
        Bytes used               :  600 KiB
        Replica sets on nodes:
                Set 0
                  Node           : 172.17.0.32 (Pool 0)
                  Node           : 172.17.0.56 (Pool 0)
        Replication Status       :  Detached
##############################################################
$ pxctl volume create VOLUME_NAME -s 2 -r 2  #To create volume with 2GB size & 2 replica unit

$ pxctl volume delete VOLUME_ID #To delete a volume

$ pxctl volume update --shared on VOLUME_NAME  #To turn on shared on a Volume

$ pxctl volume update --label env=qa VOLUME_NAME


$ pxctl volume stats VOLUME_NAME
$ pxctl host attach VOLUME_NAME              #To attach a volume to the host

$ pxctl host mount VOLUME_NAME --path /LOCATION  #To munt a volume on a specific location
$ pxctl host unmount VOLUME_NAME --path /LOCATION #To unmount a volume 

Ansible_Notes

   ansible -i inventory.ini -m ping all   # inventory.ini it will ping to the hosts which are in inventory # ansible -i inventory.ini -m pin...