Sunday, October 18, 2020

Modify mac address of virtual machine by using govc on vsphere 6.7

 


Before update:

[root@lbint scripts]#  govc device.info -vm=/Datacenter/vm/data/control-plane-0 ethernet-*
Name:               ethernet-0
  Type:             VirtualVmxnet3
  Label:            Network adapter 1
  Summary:          ICC .3 - Openshift
  Key:              4000
  Controller:       pci-100
  Unit number:      7
  Connected:        true
  Start connected:  true
  Guest control:    true
  Status:           ok
  MAC Address:      00:50:56:b6:fc:a6
  Address type:     assigned



Update:

[root@lbint scripts]# govc vm.network.change -net.address 00:50:56:b6:70:af -net="ICC .3 - Openshift" -vm=/Datacenter/vm/data/control-plane-0 ethernet-0



After update:

[root@lbint scripts]#  govc device.info -vm=/Datacenter/vm/data/control-plane-0 ethernet-*                                           Name:               ethernet-0
  Type:             VirtualVmxnet3
  Label:            Network adapter 1
  Summary:          ICC .3 - Openshift
  Key:              4000
  Controller:       pci-100
  Unit number:      7
  Connected:        true
  Start connected:  true
  Guest control:    true
  Status:           ok
  MAC Address:      00:50:56:b6:70:af
  Address type:     manual


No comments:

Post a Comment