How to create a virtual machine on a specific subnet in VMware Cloud Foundation Automation (VCFA)
search cancel

How to create a virtual machine on a specific subnet in VMware Cloud Foundation Automation (VCFA)

book

Article ID: 426105

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service VCF Automation

Issue/Introduction

When using blueprints in VCF Automation to create a standalone virtual machine (VM), existing techdocs advise on the following networking configuration:

networkInterfaces:
- networkType: <nsx-t or vsphere-distributed>
- networkName: <custom name>
spec.networkInterfaces
Specifies network-related settings for the VM.
 
networkType
. Values for this key can be
nsx-t
or
vsphere-distributed
.
 
networkName
. If needed, specify the name or leave the default name.

    Deploy a Virtual Machine on a Namespace in a Supervisor

     

    However, specifying the networkName above does not put the VM on the desired network.

    It may instead spin up on the default VPC network regardless of the above configuration.

    Environment

    vCenter 9

    vSphere Supervisor

    VCF Automation

    Cause

    Depending on the apiVersion used in creating the virtual machine, the YAML will need to be updated to use the appropriate parameters.

    Resolution

    The parameters used may vary between apiVersions used when creating the virtual machine YAML.

    See the below for an example of YAML using the v1alpha3 apiVersion where values in brackets <> should be replaced with values according to your environmental needs:

    spec:
        network:
            interfaces:
               - name: <eth#>
                 network:
                     name: <network name>
                     kind: <Subnet or SubnetSet>

    You can confirm if a network is a Subnet or SubnetSet in the Services -> Network section of the VMware Cloud Foundation Automation web UI.

    Additional Information