Check for in-tree storage in OpenShift Container Platform 4 on VMWare vSphere

Solution Verified - Updated

Environment

  • VMware vSphere
  • Red Hat OpenShift Container Platform (RHOCP) 4

Issue

How to check if the existing vSphere cluster using in-tree storage in OpenShift Container Platform 4.

Resolution

It is needed to check the following:

  1. $ oc get infrastructure -o yaml -> It will reference if there is a vSphere integration in platformSpec

kind: Infrastructure
metadata:
  creationTimestamp: "2023-1-21T18:44:45Z"
  generation: 1
  name: cluster
  resourceVersion: "514"
  uid: 63d20f62-5ecf-4d38-9eeb-306ac65df367
spec:
  cloudConfig:
    key: config
    name: cloud-provider-config
  platformSpec:
    type: VSphere
    vsphere: {}
status:
 ...
  platform: VSphere
  platformStatus:
    type: VSphere
    vsphere:
      apiServerInternalIP: 0.0.0.0
      apiServerInternalIPs:
      - 0.0.0.0
      ingressIP: 0.0.0.0
      ingressIPs:
      - 0.0.0.0
  1. If a storageClass named thin exists in the cluster then in-tree storage is in use.
$ oc get storageclass -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
    annotations:
      storageclass.kubernetes.io/is-default-class: "true"
    managedFields:
    - apiVersion: storage.k8s.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:storageclass.kubernetes.io/is-default-class: {}
        f:parameters:
          .: {}
          f:diskformat: {}
        f:provisioner: {}
        f:reclaimPolicy: {}
        f:volumeBindingMode: {}
      manager: cluster-storage-operator
      operation: Update
    name: thin
    resourceVersion: "46411"
    selfLink: /apis/storage.k8s.io/v1/storageclasses/thin
    uid: 748e1ed3-5822-452c-a17d-0b831ec71b81
  parameters:
    diskformat: thin
  provisioner: kubernetes.io/vsphere-volume
  reclaimPolicy: Delete
  volumeBindingMode: Immediate
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""
  1. Also, each node YAML in the cluster should have a providerID parameter which points to vSphere.
oc get node $id -o yaml | grep providerID
providerID: vsphere://42137ce8-ca56-xxx-3f81-xxxx
  1. Also, it is possible to check the cloud provider config as per following:
oc get cm cloud-provider-config -o yaml

apiVersion: v1
data:
 config: |
   [Global]
   secret-name = \"vsphere-creds\"
   secret-namespace = \"kube-system\"
   insecure-flag = \"1\"    [Workspace]
   server = \"xxx\"
   datacenter = \"xx\"
   default-datastore = \"xx\"
   folder = \"/xxx\"    [VirtualCenter \"xxx.xxx.redhat.com\"]
   datacenters = \"xxx\"

Diagnostic Steps

kube-controller-manager hosts the in-tree storage driver and communicates with the vCenter API. For any issue, it will be needed to debug the logs in in KCM:

oc adm inspect ns/openshift-kube-controller-manager-operator

If CSI is used, then vmware-vsphere-csi-driver-operator should be checked instead:

oc adm inspect ns/openshift-cluster-csi-drivers
SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.