WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / How to deploy the vCenter Server Appliance (VCSA) with a custom MAC Address?

How to deploy the vCenter Server Appliance (VCSA) with a custom MAC Address?

02.20.2020 by William Lam // 2 Comments

I recently had a question that came in from our field where a customer needed to deploy the vCenter Server Appliance (VCSA) with a specific MAC Address which was a requirement to ensure property connectivity within their network. This type of network requirement is not really new or unique, it is a common practice used to ensure only valid VMs with a static DHCP reservation can actually connect to a specific network but it certainly was the first time I had heard of this request for the VCSA.

With the default VCSA installer workflow, there is currently not a way to modify the network MAC Address which is automatically generated after the deployment of the OVA. Having said that, I have spent quite a bit of time exploring the various non-standard methods of deploying the VCSA in the past (see here, here and here) and with that information, you definitely can affect the MAC Address while still maintaining a valid VCSA deployment. With a bit of trial/error, there are two options depending if you are deploying the VCSA directly to an ESXi host (for initial setup) or to an existing vCenter Server. To demonstrate how this works, I have created a basic shell script called VCSAStaticMACAddress.sh which you can easily adapt to for a Windows-based environment.

The trick is that when you deploy to a vCenter Server endpoint, the required OVF properties are persisted which would allow you to only deploy the VCSA but not actually power it on and there you can easily augment a number of settings including the MAC Address. In the case of deploying directly to an ESXi host, OVF properties are not persisted and hence a challenge if you wish to make changes prior to powering on the VM. In earlier versions, it was possible to set these OVF properties by way of using the extraConfig property of the VM but it looks like this trick no longer works and requires a slight variation of the workflow which is described in the instructions below.

vCenter

Step 1 - Edit the VCSAStaticMACAddress.sh script to include the path to the VCSA OVA (in my example, I am using the latest 6.7 Update 3 release) and uncomment the vCenter deployment section along with the specific values for your VCSA deployment

Step 2 - Run the script which will deploy the VCSA to an existing vCenter Server and set the respective OVF properties but not actually power on the VM

Step 3 - Use the vSphere UI to update the desired MAC Address of the VM and then power it on and wait for the installation to complete (can take up to 30min). If everything was configured correctly, during the installation, you should be able to open a browser to https://[VCSA]:5480 and watch the progress of installation.

ESXi

Step 1 - We need to first convert the VCSA OVA (in my example, I am using the latest 6.7 Update 3 release) to an OVF. To do so, you will need OVFTool and here is the command to run:

ovftool --allowExtraConfig VMware-vCenter-Server-Appliance-6.7.0.42000-15132721_OVF10.ova VMware-vCenter-Server-Appliance-6.7.0.42000-15132721_OVF10.ovf

Step 2 - We need to add an additional line to the network section of the OVF with the desired MAC Address as shown in the example below.

<Item>
   <rasd:Address>00:50:56:ab:cd:ef</rasd:Address>
   <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
   <rasd:Connection>Network 1</rasd:Connection>
   <rasd:ElementName xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">Ethernet adapter on &quot;Network 1&quot;</rasd:ElementName>
   <rasd:InstanceID xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</rasd:InstanceID>
   <rasd:ResourceSubType>vmxnet3</rasd:ResourceSubType>
   <rasd:ResourceType>10</rasd:ResourceType>
</Item>

Step 3 - Edit the VCSAStaticMACAddress.sh script to include the path to the modified VCSA OVF and update the ESXi section along with the specific values for your VCSA deployment

Step 4 - Run the script which will deploy the VCSA to an ESXi host and automatically power on the VM and using the --injectOvfEnv option to inject the required OVF properties to properly configure the VCSA. If everything was configured correctly, during the installation, you should be able to open a browser to https://[VCSA]:5480 and watch the progress of installation.

Regardless if you are deploying the VCSA to a vCenter Server or ESXi endpoint, the results will be the same and you will now have a VCSA with a customized MAC Address as I have shown below 🙂

If you do not want Stage 2 to automatically run which would allow you to make further changes to the networking configuration (such as IP Address, hostname, etc), simply change VCSA_STAGE1ANDSTAGE2 variable to False. Once the VCSA is on the network, you will need to connect to the VAMI interface https://[VCSA]:5480 to finish the configuration as shown in the screenshot below.

More from my site

  • Can you really deploy the vCenter Server Appliance (VCSA) without DNS and NTP?
  • Using PowerCLI to automate the retrieval of VCSA Identity Sources
  • How to exclude VCSA UI/CLI Installer from MacOS Catalina Security Gatekeeper?
  • Using PowerCLI to automate the retrieval of VCSA Password Policies
  • Is a DNS server still required when using a Static IP for VCSA?
Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Categories // Automation, VCSA Tags // mac address, vcenter server appliance, vcsa

Comments

  1. Gert van den Berg says

    07/02/2021 at 1:32 pm

    I also had to edit VMware-vCenter-Server-Appliance-6.7.0.48000-18010531_OVF10.mf to update the hash for the modified OVF file

    Reply
  2. anon user says

    11/07/2021 at 6:41 pm

    i think this is a design defect of vcsa installation process. many companies uses MAC addresses for DHCP registration, and the lack of capability to specify MAC address creates a loop for the process - one cannot get a MAC address until a the vcenter is deployed and the deployment process gets stuck without a valid MAC address registration.

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Support

Recent

  • Quick Tip - Prepare VMware Photon OS for use with vSphere Guest OS Customization and cloud-init 06/29/2022
  • Using the new vSphere Guest OS Customization with cloud-init in vSphere 7.0 Update 3 06/27/2022
  • How to forcefully disconnect a vSphere VM Console session? 06/24/2022
  • Quick Tip - Using ESXi Scripted Installation (kickstart) to configure IPv6 networking 06/21/2022
  • Hiking Trails 06/04/2022

Advertisment

Copyright WilliamLam.com © 2022

 

Loading Comments...