I believe I found a bug today, hopefully with an easy fix.
In client.go 125-131:
for _, nic := range nics {
card := nic.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard()
mapping, ok := networkMappings.Mappings[card.MacAddress]
if !ok {
return nil, errors.New("no network mapping found for MAC address")
}
card.MacAddress seems to be converted to lowercase characters, even if the user-provided mac field in network-mapping comes with uppercase letters, making networkMappings.Mappings[card.MacAddress] return nothing when the interface's MAC address in VMware has uppercase letters, causing a mapping mismatch and returning Error: no network mapping found for MAC address.
Example:
In Vcenter, the VM has the following MAC address: 00:50:56:A4:E2:53, as seen in the web GUI.
Trying to run a cutover (did not attempt running a migrate before, but I'd say the same thing would happen) with --network-mapping mac=00:50:56:A4:E2:53,network-id=<openstack-net-id>,subnet-id=<openstack-subnet-id> fails with Error: no network mapping found for MAC address. A mapping with lowercase letters also fails.
Logging some values here, I get:
card.MacAddress = 00:50:56:A4:E2:53
networkMappings.Mappings = map[00:50:56:a4:e2:53:{00:50:56:a4:e2:53 }]
mapping = { 00000000-0000-0000-0000-000000000000 00000000-0000-0000-0000-000000000000 }
The empty value of mapping makes me believe the uppercase letters are the problem here.
A workaround I tested was changing the interface's MAC address in VMware to have only lowercase letters.
Hello, folks! Hope you are doing well :-)
I believe I found a bug today, hopefully with an easy fix.
In
client.go
125-131:card.MacAddress
seems to be converted to lowercase characters, even if the user-providedmac
field innetwork-mapping
comes with uppercase letters, makingnetworkMappings.Mappings[card.MacAddress]
return nothing when the interface's MAC address in VMware has uppercase letters, causing a mapping mismatch and returningError: no network mapping found for MAC address
.Example:
00:50:56:A4:E2:53
, as seen in the web GUI.--network-mapping mac=00:50:56:A4:E2:53,network-id=<openstack-net-id>,subnet-id=<openstack-subnet-id>
fails withError: no network mapping found for MAC address
. A mapping with lowercase letters also fails.The empty value of
mapping
makes me believe the uppercase letters are the problem here.A workaround I tested was changing the interface's MAC address in VMware to have only lowercase letters.
Hope this makes sense. Thank you!