Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update 11811: automatically allocate IP address on non-L2 networks
  • Loading branch information
weizhouapache committed Oct 10, 2025
commit 49c449fd774f8096097455574d11abfaaf8ab2f0
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,9 @@ private UserVm importKvmVirtualMachineFromDisk(final ImportSource importSource,

String macAddress = networkModel.getNextAvailableMacAddressInNetwork(networkId);

Network.IpAddresses requestedIpPair = new Network.IpAddresses(null, null, macAddress);
String ipAddress = network.getGuestType() != Network.GuestType.L2 ? "auto" : null;

Network.IpAddresses requestedIpPair = new Network.IpAddresses(ipAddress, null, macAddress);

NicProfile nicProfile = new NicProfile(requestedIpPair.getIp4Address(), requestedIpPair.getIp6Address(), requestedIpPair.getMacAddress());
nicProfile.setOrderIndex(0);
Expand Down
Loading