@@ -1377,8 +1377,8 @@ public boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfi
13771377 return false ;
13781378 }
13791379 String extensionIp = ensureExtensionIp (network );
1380- logger .debug ("addDhcpEntry: network={} mac={} ip={}" , network ,
1381- nic .getMacAddress (), nic .getIPv4Address ());
1380+ logger .debug ("addDhcpEntry: network={} mac={} ip={} ipv6={} " , network ,
1381+ nic .getMacAddress (), nic .getIPv4Address (), nic . getIPv6Address () );
13821382 JsonObject payload = new JsonObject ();
13831383 payload .addProperty ("network_id" , String .valueOf (network .getId ()));
13841384 payload .addProperty ("mac" , safeStr (nic .getMacAddress ()));
@@ -1476,8 +1476,8 @@ public boolean removeDhcpEntry(Network network, NicProfile nic, VirtualMachinePr
14761476 if (!canHandle (network , Service .Dhcp )) {
14771477 return false ;
14781478 }
1479- logger .debug ("removeDhcpEntry: network={} mac={} ip={}" , network ,
1480- nic .getMacAddress (), nic .getIPv4Address ());
1479+ logger .debug ("removeDhcpEntry: network={} mac={} ip={} ipv6={} " , network ,
1480+ nic .getMacAddress (), nic .getIPv4Address (), nic . getIPv6Address () );
14811481 String extensionIp = ensureExtensionIp (network );
14821482 JsonObject payload = new JsonObject ();
14831483 payload .addProperty ("network_id" , String .valueOf (network .getId ()));
@@ -1500,8 +1500,8 @@ public boolean addDnsEntry(Network network, NicProfile nic, VirtualMachineProfil
15001500 return false ;
15011501 }
15021502 String hostname = vm .getHostName ();
1503- logger .debug ("addDnsEntry: network={} hostname={} ip={}" , network ,
1504- hostname , nic .getIPv4Address ());
1503+ logger .debug ("addDnsEntry: network={} hostname={} ip={} ipv6={} " , network ,
1504+ hostname , nic .getIPv4Address (), nic . getIPv6Address () );
15051505 String extensionIp = ensureExtensionIp (network );
15061506 JsonObject payload = new JsonObject ();
15071507 payload .addProperty ("network_id" , String .valueOf (network .getId ()));
@@ -1614,8 +1614,8 @@ public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMa
16141614 // default NIC IP), so we always key metadata by the NIC's IP on this network.
16151615 String nicIpAddress = nic .getIPv4Address ();
16161616
1617- logger .debug ("addPasswordAndUserdata: network={} ip={} hasPassword={} hasSshKey={}" ,
1618- network .getId (), nicIpAddress ,
1617+ logger .debug ("addPasswordAndUserdata: network={} ip={} ipv6={} hasPassword={} hasSshKey={}" ,
1618+ network .getId (), nicIpAddress , nic . getIPv6Address (),
16191619 StringUtils .isNotEmpty (password ),
16201620 StringUtils .isNotEmpty (sshPublicKey ));
16211621
@@ -1641,7 +1641,7 @@ public boolean addPasswordAndUserdata(Network network, NicProfile nic, VirtualMa
16411641 destHostname );
16421642
16431643 if (CollectionUtils .isEmpty (vmData )) {
1644- logger .debug ("addPasswordAndUserdata: no VM data generated for network={} ip={}" , network , nicIpAddress );
1644+ logger .debug ("addPasswordAndUserdata: no VM data generated for network={} ip={} ipv6={} " , network , nicIpAddress , nic . getIPv6Address () );
16451645 return true ;
16461646 }
16471647
@@ -1707,7 +1707,7 @@ public boolean savePassword(Network network, NicProfile nic, VirtualMachineProfi
17071707 if (StringUtils .isEmpty (password )) {
17081708 return true ;
17091709 }
1710- logger .debug ("savePassword: network={} ip={}" , network , nic .getIPv4Address ());
1710+ logger .debug ("savePassword: network={} ip={} ipv6={} " , network , nic .getIPv4Address (), nic . getIPv6Address ());
17111711 String extensionIp = ensureExtensionIp (network );
17121712 JsonObject payload = new JsonObject ();
17131713 payload .addProperty ("network_id" , String .valueOf (network .getId ()));
@@ -1734,7 +1734,7 @@ public boolean saveUserData(Network network, NicProfile nic, VirtualMachineProfi
17341734 if (StringUtils .isEmpty (userData )) {
17351735 return true ;
17361736 }
1737- logger .debug ("saveUserData: network={} ip={}" , network , nic .getIPv4Address ());
1737+ logger .debug ("saveUserData: network={} ip={} ipv6={} " , network , nic .getIPv4Address (), nic . getIPv6Address ());
17381738 // userData is stored as base64; pass it directly so the script can decode it
17391739 String extensionIp = ensureExtensionIp (network );
17401740 JsonObject payload = new JsonObject ();
@@ -1758,7 +1758,7 @@ public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile
17581758 if (StringUtils .isEmpty (sshPublicKey )) {
17591759 return true ;
17601760 }
1761- logger .debug ("saveSSHKey: network={} ip={}" , network , nic .getIPv4Address ());
1761+ logger .debug ("saveSSHKey: network={} ip={} ipv6={} " , network , nic .getIPv4Address (), nic . getIPv6Address ());
17621762 // Encode SSH key as base64 to safely pass via CLI
17631763 String sshKeyBase64 = Base64 .getEncoder ().encodeToString (sshPublicKey .getBytes (java .nio .charset .StandardCharsets .UTF_8 ));
17641764 String extensionIp = ensureExtensionIp (network );
@@ -1784,8 +1784,8 @@ public boolean saveHypervisorHostname(NicProfile nic, Network network, VirtualMa
17841784 if (StringUtils .isBlank (hostname )) {
17851785 return true ;
17861786 }
1787- logger .debug ("saveHypervisorHostname: network={} ip={} host={}" , network ,
1788- nic .getIPv4Address (), hostname );
1787+ logger .debug ("saveHypervisorHostname: network={} ip={} ipv6={} host={}" , network ,
1788+ nic .getIPv4Address (), nic . getIPv6Address (), hostname );
17891789 String extensionIp = ensureExtensionIp (network );
17901790 JsonObject payload = new JsonObject ();
17911791 payload .addProperty ("network_id" , String .valueOf (network .getId ()));
@@ -2259,6 +2259,7 @@ private String buildRestoreNetworkData(Network network, List<NicVO> nics,
22592259
22602260 json .append ("{" );
22612261 json .append ("\" ip\" :\" " ).append (jsonEscape (nic .getIPv4Address ())).append ("\" ," );
2262+ json .append ("\" ip6_address\" :\" " ).append (jsonEscape (nic .getIPv6Address ())).append ("\" ," );
22622263 json .append ("\" mac\" :\" " ).append (jsonEscape (nic .getMacAddress ())).append ("\" ," );
22632264 json .append ("\" hostname\" :\" " ).append (jsonEscape (safeStr (userVm .getHostName ()))).append ("\" ," );
22642265 json .append ("\" default_nic\" :" ).append (nic .isDefaultNic ()).append ("," );
0 commit comments