<\/figure><\/div>\n\n\nCreate a volume group<\/h4>\n\n\n\n Check the physical volumes in the machine by running the following command.<\/p>\n\n\n\n
pvs<\/code><\/pre>\n\n\n\nTerminal output for reference<\/em><\/p>\n\n\n\n[root@localhost hyrule]# pvs\n PV VG Fmt Attr PSize PFree\n \/dev\/sda2 rhel lvm2 a-- <199.00g 0<\/code><\/pre>\n\n\n\nCreate a PV. Change physical volume name accordingly by inspecting \/dev folder in the system. In my case its \/dev\/sdb.<\/p>\n\n\n\n
pvcreate \/dev\/sdb<\/code><\/pre>\n\n\n\nTerminal output for reference<\/em><\/p>\n\n\n\n[root@localhost hyrule]# pvcreate \/dev\/sdb\n Physical volume \"\/dev\/sdb\" successfully created.\n[root@localhost hyrule]# pvs\n PV VG Fmt Attr PSize PFree \n \/dev\/sda2 rhel lvm2 a-- <199.00g 0 \n \/dev\/sdb lvm2 --- 200.00g 200.00g<\/code><\/pre>\n\n\n\nCreate a new volume group<\/p>\n\n\n\n
vgcreate hyrule\/dev\/sdb <\/code><\/pre>\n\n\n\nTerminal output for reference<\/em><\/p>\n\n\n\n[root@localhost hyrule]# vgcreate hyrule\/dev\/sdb\n Volume group \"hyrule\" successfully created<\/code><\/pre>\n\n\n\nCheck the pvs in the machine.<\/p>\n\n\n\n
[root@localhost hyrule]# pvs\n PV VG Fmt Attr PSize PFree \n \/dev\/sda2 rhel lvm2 a-- <199.00g 0 \n \/dev\/sdb hyrule lvm2 a-- <200.00g <200.00g<\/code><\/pre>\n\n\n\nLVMS Configuration<\/h4>\n\n\n\n Create an LVMS configuration file. When MicroShift runs, it uses LVMS configuration from \/etc\/microshift\/lvmd.yaml. Make sure that volume-group ‘hyrule’ is created.<\/p>\n\n\n\n
sudo cp \/etc\/microshift\/lvmd.yaml.default \/etc\/microshift\/lvmd.yaml<\/code><\/pre>\n\n\n\nEdit \/etc\/microshift\/lvmd.yaml.<\/p>\n\n\n\n
# Unix domain socket endpoint of gRPC\nsocket-name: \/run\/lvmd\/lvmd.socket\n\ndevice-classes:\n # The name of a device-class\n - name: default\n\n # The group where this device-class creates the logical volumes\n volume-group: hyrule\n\n # Storage capacity in GiB to be spared\n spare-gb: 0\n\n # A flag to indicate that this device-class is used by default\n default: true\n\n # The number of stripes in the logical volume\n #stripe: \"\"\n\n # The amount of data that is written to one device before moving to the next device\n #stripe-size: \"\"\n\n # Extra arguments to pass to lvcreate, e.g. [\"--type=raid1\"]\n #lvcreate-options:\n #- \"\"<\/code><\/pre>\n\n\n\nRestart MicroShift<\/p>\n\n\n\n
sudo systemctl start microshift<\/code><\/pre>\n\n\n\nTesting<\/h3>\n\n\n\n Create a namespace<\/p>\n\n\n\n
oc create ns test<\/code><\/pre>\n\n\n\nCreate test.yaml and copy below contents.<\/p>\n\n\n\n
kind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n name: my-lv-pvc\n namespace: test\nspec:\n accessModes:\n - ReadWriteOnce\n resources:\n requests:\n storage: 1G\n---\napiVersion: v1\nkind: Pod\nmetadata:\n name: my-pod\n namespace: test\nspec:\n containers:\n - name: nginx\n image: quay.io\/jitesoft\/nginx\n command: [\"\/bin\/sleep\", \"1d\"]\n volumeMounts:\n - mountPath: \/mnt\n name: my-volume\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - ALL\n runAsNonRoot: true\n seccompProfile:\n type: RuntimeDefault\n volumes:\n - name: my-volume\n persistentVolumeClaim:\n claimName: my-lv-pvc<\/code><\/pre>\n\n\n\nCreate pvc and pod<\/p>\n\n\n\n
oc create -f test.yaml<\/code><\/pre>\n\n\n\nCheck the status of pod, pvc and pv.<\/p>\n\n\n\n
[hyrule@localhost test]$ oc get po -n test\nNAME READY STATUS RESTARTS AGE\nmy-pod 1\/1 Running 0 2m7s\n[hyrule@localhost test]$ oc get pvc -n test\nNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE\nmy-lv-pvc Bound pvc-1d6e6430-b052-4c4b-8ff2-df3b23dd9160 1Gi RWO topolvm-provisioner 2m13s\n[hyrule@localhost test]$ oc get pv -n test\nNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE\npvc-1d6e6430-b052-4c4b-8ff2-df3b23dd9160 1Gi RWO Delete Bound test\/my-lv-pvc topolvm-provisioner 2m19s<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"MicroShift enables dynamic storage provisioning with the Logical Volume Manager Storage (LVMS) provider. The LVMS plugin is a Container Storage Interface (CSI) plugin for managing LVM volumes for Kubernetes. LVMS provisions new logical volume management (LVM) and logical volumes (LVs) for container workloads with persistent volume claims (PVC). Each PVC references a storage class that … Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":249,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[68,5],"_links":{"self":[{"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/posts\/891"}],"collection":[{"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":33,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":941,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/posts\/891\/revisions\/941"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/media\/249"}],"wp:attachment":[{"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/media?parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/categories?post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/192.168.0.142\/wp-json\/wp\/v2\/tags?post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}