本文整理汇总了Java中org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit.getVm_image方法的典型用法代码示例。如果您正苦于以下问题:Java VirtualDeploymentUnit.getVm_image方法的具体用法?Java VirtualDeploymentUnit.getVm_image怎么用?Java VirtualDeploymentUnit.getVm_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit
的用法示例。
在下文中一共展示了VirtualDeploymentUnit.getVm_image方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNfvImage
import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入方法依赖的package包/类
private NFVImage addNfvImage(
VNFPackage vnfPackage,
NFVImage image,
List<String> vimInstances,
VirtualDeploymentUnit vdu,
BaseVimInstance vimInstance)
throws PluginException, VimException, IOException, BadRequestException,
AlreadyExistingException, InterruptedException, ExecutionException {
if (!vimInstances.contains(vimInstance.getId())) { // check if we didn't already upload it
Vim vim = vimBroker.getVim(vimInstance.getType());
log.debug(
"VNFPackageManagement: Uploading a new Image to VimInstance " + vimInstance.getName());
image = vim.add(vimInstance, image, vnfPackage.getImageLink());
if (vdu.getVm_image() == null) {
vdu.setVm_image(new HashSet<>());
}
vdu.getVm_image().add(image.getExtId());
vimInstances.add(vimInstance.getId());
vimInstance = vimManagement.refresh(vimInstance, true).get();
imageChecker.checkImageStatus(vimInstance);
}
return image;
}
示例2: checkIntegrityVDU
import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入方法依赖的package包/类
private void checkIntegrityVDU(VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor)
throws NetworkServiceIntegrityException {
int i = 1;
for (VirtualDeploymentUnit vdu : virtualNetworkFunctionDescriptor.getVdu()) {
if (vdu.getVnfc() == null || vdu.getVnfc().size() == 0) {
log.warn("Not found any VNFC in VDU of VNFD " + virtualNetworkFunctionDescriptor.getName());
}
if (vdu.getName() == null || vdu.getName().isEmpty()) {
vdu.setName(virtualNetworkFunctionDescriptor.getName() + "-" + i);
i++;
}
if (vdu.getVm_image() == null || vdu.getVm_image().isEmpty()) {
throw new NetworkServiceIntegrityException(
"At least one VDU in the VNFD "
+ virtualNetworkFunctionDescriptor.getName()
+ " does not contain an image.");
}
if (vdu.getName() == null || vdu.getName().equalsIgnoreCase("")) {
vdu.setName("vdu" + i);
}
vdu.setProjectId(virtualNetworkFunctionDescriptor.getProjectId());
}
}
示例3: checkIntegrity
import org.openbaton.catalogue.mano.descriptor.VirtualDeploymentUnit; //导入方法依赖的package包/类
public void checkIntegrity(
VirtualNetworkFunctionRecord vnfr,
VirtualDeploymentUnit vdu,
VNFComponent vnfComponent,
VNFCInstance vnfcInstance,
Server server)
throws VimException {
try {
if (vnfComponent.getConnection_point().size() != vnfcInstance.getIps().size()) {
throw new VimException(
"Not all (or too many) internal IPs were associated. Expected: "
+ vnfComponent.getConnection_point().size()
+ " Allocated: "
+ vnfcInstance.getIps().size());
}
int expectedFloatingIpCount = 0;
for (VNFDConnectionPoint cp : vnfComponent.getConnection_point()) {
if (cp.getFloatingIp() != null && !cp.getFloatingIp().isEmpty()) {
expectedFloatingIpCount++;
}
}
if (expectedFloatingIpCount != vnfcInstance.getFloatingIps().size()) {
throw new VimException(
"Not all (or too many) Floating IPs were associated. Expected: "
+ expectedFloatingIpCount
+ " Allocated: "
+ vnfcInstance.getFloatingIps().size());
}
if (!vdu.getVm_image().contains(server.getImage().getName())) {
throw new VimException(
"Server launched with incorrect image. Expected: "
+ vdu.getVm_image()
+ " Used: "
+ server.getImage().getName());
}
if (!server.getFlavor().getFlavour_key().equals(vnfr.getDeployment_flavour_key())) {
throw new VimException(
"Server launched with incorrect flavor. Expected: "
+ vnfr.getDeployment_flavour_key()
+ " Used: "
+ server.getFlavor().getFlavour_key());
}
} catch (Exception e) {
throw new VimException(
"VNFCInstance was not deployed correctly -> " + e.getMessage(), e, vdu, vnfcInstance);
}
}