After you create the content library and populate it with VM templates, use the vSphere Client to add the library to the namespace. By adding the library to the namespace, you give your DevOps users access to the library. In addition, you can use the Data Center CLI (DCLI) commands to add a writable or read-only content library to the namespace, or assign a read-only library at a cluster level.
Add a VM Content Library to a Namespace Using the vSphere Client
The content library that you add with the vSphere Client is read-only. The DevOps users can access images from this content library, but cannot publish VM images to this library.
Prerequisites
Procedure
- In the vSphere Client, go to the namespace.
- From the vSphere Client home menu, select Workload Management.
- Click the Namespaces tab and click the namespace.
- Add a content library.
- On the VM Service card, click Add Content Library.
- Select one or several content libraries and click OK.
Manage VM Content Libraries on a Namespace Using the vSphere Client
After you associate the library with the namespace, you can use the vSphere Client to remove it from the namespace. You can also add more libraries.
Prerequisites
Procedure
- In the vSphere Client, go to the namespace.
- From the vSphere Client home menu, select Workload Management.
- Click the Namespaces tab and click the namespace.
- Add or remove a content library.
- On the VM Service card, click Manage Content Library.
- Perform one of the following operations.
Option Description Remove a content library Deselect the content library and click OK. Add a content library Select one or several content libraries and click OK.
What to do next
Add a VM Content Library to a Namespace Using Data Center CLI
As a vSphere administrator, you can use the Data Center CLI (DCLI) command to assign the content library to a namespace. When assigning the library, you can make the library associated with the namespace writable. When the library is writable, in addition to viewing the library and the images in the library, DevOps users can publish new VM images to it.
Procedure
Results
kubectl get cl -n lb-edit-ns NAMESPACE NAME VSPHERENAME TYPE WRITABLE STORAGETYPE AGE lb-edit-ns cl-b585915ddxxxxxxxx Test-ns-cl Local true Datastore 3m9s kubectl describe cl cl-b585915ddxxxxxxxx -n lb-edit-ns kubectl get clitem -n lb-edit-ns
Add a VM Content Library to Supervisor Using Data Center CLI
In addition to assigning the content library at a namespace level, the vSphere administrator can use the Data Center CLI (DCLI) command to associate the library with a Supervisor cluster. The content library becomes available to all namespaces in the Supervisor.
You can associate all types of libraries, including local, published, and subscribed.
Prerequisites
Procedure
Results
- kubectl get ccl – List of all content libraries available at the cluster level. The output can look similar to the following.
NAME VSPHERENAME TYPE STORAGETYPE AGE cl-f28af8153fb849bd7 Kubernetes Service Content Library Subscribed Datastore 6d5h cl-knounwp7xxxxxxxxx Image Registry Content Library Local Datastore 6d4h
- kubectl get cclitem – List of all items in the content libraries at the cluster level.
- kubectl describe ccl NAME – Detailed information for a specific content library at the cluster level.