CreateLogicalSwitchPortCommand cmd = new CreateLogicalSwitchPortCommand(
network.getBroadcastUri().getSchemeSpecificPart(),
nicVO.getUuid(), context.getDomain().getName() + "-"
+ context.getAccount().getAccountName(), nic.getName());
CreateLogicalSwitchPortAnswer answer = (CreateLogicalSwitchPortAnswer) _agentMgr
.easySend(niciraNvpHost.getId(), cmd);
if (answer == null || !answer.getResult()) {
s_logger.error("CreateLogicalSwitchPortCommand failed");
return false;
}
NiciraNvpNicMappingVO nicMap = new NiciraNvpNicMappingVO(network
.getBroadcastUri().getSchemeSpecificPart(),
answer.getLogicalSwitchPortUuid(), nicVO.getUuid());
_niciraNvpNicMappingDao.persist(nicMap);
return true;
}