Dears,
I recently encountered this issue when first time create instance from
template or ISO.
Each time after domR created, the UI will pop up below message:
Resource [Host:1] is unreachable: Host 1: Unable to start instance due to null

Further analysis in CS log indicates the null exception in below location:
com.cloud.network.router.VirtualNetworkApplianceManagerImpl.findDefaultDnsIp(VirtualNetworkApplianceManagerImpl.java:2429)

I found the function call change from _nicDao.findByNetworkIdAndType
to _nicDao.findByNetworkIdTypeAndGateway, see below:

git diff a5248f1cfc20faab30c6a6b02f55d9b697ffbe1d
2bf5c99bc6f18c751944181e687429ce4e7e4686
server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
diff --git 
a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 5528f79..730ce28 100755
--- 
a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ 
b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2414,7 +2414,7 @@ public class VirtualNetworkApplianceManagerImpl
implements VirtualNetworkApplian
                }

                //find domR's nic in the network
-               NicVO domrDefaultNic =
_nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(),
VirtualMachine.Type.DomainRouter, defaultNic.getGateway());
+               NicVO domrDefaultNic =
_nicDao.findByNetworkIdAndType(defaultNic.getNetworkId(),
VirtualMachine.Type.DomainRouter);
                return domrDefaultNic.getIp4Address();
        }

When I change back to use function _nicDao.findByNetworkIdAndType,
issue resolved.

The commit log says the change to "Fix for dns issue in multiple pods";

I think the change caused a side-effect. If we are good to use
function findByNetworkIdAndType, I will submit a patch.

Thanks.

-- 
Gavin

Reply via email to