Custom Mac Address on vCenter Provisioning

I had a platform tenant asking me today, if, or how, he could provision a static mac address on an NFV (virtualized network function). I started looking into this, and learned that VMWare accomodates this through the vCenter GUI (the VM needs to be powered off). It writes this to a “vmx” file which gets packaged up with the VM alongside the vmdk, ovf, nvram et al. So I advised them that this vmx file would be one possible way of automating this. But, I don’t have a clue on whether or how this could work in conjunction with Morpheus. Does Morpheus have a way for a user to override the 00:50:56:xx:xx:xx mac address that vCenter doles out on-demand when a VM is started up?

This ability is not native to the UI but you could create a poweshell/powercli task in Morpheus using the Set-NetworkAdapter. Something like this that you replace with Morpheus variables and inputs. Get-VM vmname | Get-NetworkAdapter | Set-NetworkAdapter -MacAddress 00:50:56:xx:xx:xx

You would need to have powershell and the powercli module installed on the Morpheus appliance nodes or a remote powershell host.

Thanks. I will relay this back to the folks interested in setting this custom mac address!

@Wittling_Mark_CCI-At I’ve been trying to spend some time to build out roles for common items I install on my Morpheus systems. PowerShell and VMware PowerCLI are a part of this and may help in your endeavors:

I am not a PowerShell or PowerCLI guy. This customer, they are launching a RHEL8 image. If you run this “Get-VM vmname | Get-NetworkAdapter | Set-NetworkAdapter -MacAddress 00:50:56:xx:xx:xx”, I presume this is a Morpheus script task, run on the appliance not the deployed target VM, right?

Correct.

We often install PowerShell Core on the Morpheus front ends. Then you can install PowerCLI (scope has to be set to allusers (or minimum morpheus-local). Then you can execute PowerCLI direct from Morpheus.

Do you have some instructions on how to set up Powershell and PowerCLI on the appliance nodes? See, we come from an OpenStack team, and we aren’t super familiar with Powershell and PowerCLI. There is a learning curve here. But, we’re willing to go in and set it up and see what we can accomplish with it.

Hi Chris,

I went ahead and installed Powershell and PowerCLI on a test Morpheus node today. I used your ansible as a basis (had to tweak the powershell role because of an error about a required description rule that wasn’t being satisfied).

But, I have it on there. I will start looking at what I can do with it now.