Network right = _networkService.getNetwork(rightNetworkId);
if (right == null) {
throw new InvalidParameterValueException("Invalid ID for right network " + rightNetworkId);
}
ServiceVirtualMachine svm = _vrouterService.createServiceInstance(zone, owner, template, serviceOffering,
name, left, right);
if (svm == null) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Unable to create service instance");
}
setEntityId(svm.getId());
setEntityUuid(svm.getUuid());
} catch (Exception ex) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
}
}