SUSE Support

Here When You Need Us

How to configure custom attributes for a Rancher-provisioned vSphere cluster?

This document (000021878) is provided subject to the disclaimer at the end of this document.

Environment

  • SUSE Rancher Prime - All Versions.
  • Rancher-provisioned vSphere cluster.

Situation

  • Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
    Custom attributes in vSphere are user-defined fields that allow users to store metadata for objects like VMs, hosts,etc. 
  • Custom attributes are a legacy feature in vSphere for attaching metadata to objects, while tags are the modern alternative. A tag is a label that can be applied to an object in the vSphere inventory.
  • Users may need custom attributes for existing workflows or integrations that rely on this metadata for the vSphere clusters provisioned through Rancher. 

Resolution

  • Make sure the attributes are already created from vSphere client side: vSphere client >> Menu >> Tags & Custom Attributes. 

  • As custom attribute is stored in key-value format and each key has its own identifier as ID. To fetch the ID of the key, first verify that PowerCLI is installed. If not, run the command below from PowerShell to install:

    Install-Module -Name VMware.PowerCLI
  • Now, connect to the desired vSphere cluster using the below command in Power CLI:
    Connect-VIServer -Server server.example.com -User <username> -Password <password>
  • If it fails with SSL error, then you can try the workaround below & re-run the above command:
    Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
  • Now fetch the customAttributes from the environment, below is an example shown for custom attribute Owner:
    Get-CustomAttribute
  • Run the command below to get a specific attribute. Replace Owner with any custom attribute defined in your vSphere environment:
    Get-CustomAttribute -Name "Owner"
  • Note the ID mentioned in Key column for the attribute.
  • Edit the resource vmwarevsphereconfigs.rke-machine-config.cattle.io in the Rancher management cluster (local cluster) for the specific downstream cluster. Run the first command to get the resource name for the desired downstream cluster. Below is an example shown for a customAttribute Owner:
    kubectl -n fleet-default get vmwarevsphereconfigs.rke-machine-config.cattle.io
    kubectl -n fleet-default edit vmwarevsphereconfigs.rke-machine-config.cattle.io <downstream_cluster>
  • In the example YAML output given below 1234 is the id for the attribute Owner. Replace the id with the one defined in your vSphere environment for the desired attribute:
    customAttribute:
    - 1234=user1
  • Verify the custom attribute in the vSphere client under 'Tags & Custom Attributes' or run the below command from PowerCLI:
    Get-VM -Name "<VM_NAME>" | Get-Annotation

Cause

  • According to the documentation, Custom attributes are a legacy feature that will eventually be removed from vSphere. However, it can be configured through a custom resource definition vmwarevsphereconfigs.rke-machine-config.cattle.io on a Rancher-provisioned vsphere cluster. 
  • Since custom attributes will be removed in future vSphere versions, users should consider migrating to tags or other solutions for long-term use.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021878
  • Creation Date: 18-Jun-2025
  • Modified Date:26-Jun-2025
    • SUSE Rancher

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.