Can not get mac address of a provision vm


#1

can not get mac address of a provision vm macaddr = prov.get_option(:mac_address) is not working get null


#2

Try prov.vm.mac_addresses.first


#3

i am using

when ‘miq_provision’
prov = $evm.root[‘miq_provision’]
log(:info, “Provision: #{prov.id} Request: #{prov.miq_provision_request.id} Type: #{prov.type}”)
macaddr = prov.get_option(:mac_address)
vmname = prov.get_option(:vm_target_name)
dns_domain = nil || $evm.object[‘dns_domain’]
view = nil || $evm.object[‘view’]

vmname works but macaddr is not


#4

It is not a provision option, but a vm attribute. Did you try the code I suggested?


#5

yes it did not work !