Skip to content

Commit 2d42b2d

Browse files
committed
Add logs in case ipassoccmd failed
1 parent 86736d6 commit 2d42b2d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,9 @@ public Answer execute(IpAssocCommand cmd) {
20482048
.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
20492049
String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);
20502050
String[] results = new String[cmd.getIpAddresses().length];
2051+
for (int i = 0; i < results.length; i++) {
2052+
results[i] = IpAssocAnswer.errorResult;
2053+
}
20512054
Connect conn;
20522055
try {
20532056
conn = LibvirtConnection.getConnectionByVmName(routerName);
@@ -2089,17 +2092,16 @@ public Answer execute(IpAssocCommand cmd) {
20892092
ip.isSourceNat(), ip.getBroadcastUri(), ip.getVlanGateway(),
20902093
ip.getVlanNetmask(), ip.getVifMacAddress(), nicNum, newNic);
20912094

2092-
if (result != null) {
2093-
results[i++] = IpAssocAnswer.errorResult;
2094-
} else {
2095+
if (result == null) {
20952096
results[i++] = ip.getPublicIp() + " - success";
2096-
;
20972097
}
20982098
}
20992099
return new IpAssocAnswer(cmd, results);
21002100
} catch (LibvirtException e) {
2101+
s_logger.error("ipassoccmd failed", e);
21012102
return new IpAssocAnswer(cmd, results);
21022103
} catch (InternalErrorException e) {
2104+
s_logger.error("ipassoccmd failed", e);
21032105
return new IpAssocAnswer(cmd, results);
21042106
}
21052107
}

setup/db/db/schema-421to430.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,4 +752,5 @@ CREATE VIEW `cloud`.`domain_router_view` AS
752752
and async_job.instance_type = 'DomainRouter'
753753
and async_job.job_status = 0;
754754
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Advanced", 'DEFAULT', 'management-server', "vmware.vcenter.session.timeout", "1200", "VMware client timeout in seconds", "1200", NULL,NULL,0);
755+
INSERT IGNORE INTO `cloud`.`configuration` VALUES ("Advanced", 'DEFAULT', 'management-server', "mgt.server.vendor", "ACS", "the vendor of management server", "ACS", NULL,NULL,0);
755756

0 commit comments

Comments
 (0)