diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java index 3dd7d2adf378..c8feaaa21b62 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java @@ -103,7 +103,7 @@ public Long getApiResourceId() { @Override public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { - CallContext.current().setEventDetails("Internal Lb Vm Id: " + getId()); + CallContext.current().setEventDetails("Internal Lb VM ID: " + getId()); VirtualRouter result = null; VirtualRouter router = _routerService.findRouter(getId()); if (router == null || router.getRole() != Role.INTERNAL_LB_VM) { diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java index a746e5d906d6..9ea6ed0f2860 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java @@ -105,7 +105,7 @@ public boolean isForced() { @Override public void execute() throws ConcurrentOperationException, ResourceUnavailableException { - CallContext.current().setEventDetails("Internal lb vm Id: " + getId()); + CallContext.current().setEventDetails("Internal lb VM Id: " + getId()); VirtualRouter result = null; VirtualRouter vm = _routerService.findRouter(getId()); if (vm == null || vm.getRole() != Role.INTERNAL_LB_VM) { diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java index 7e0faab2fb50..3ed06a044f41 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java @@ -91,7 +91,7 @@ public Long getApiResourceId() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); VirtualMachine instance = _mgr.destroySystemVM(this); if (instance != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java index 30bd51184ac3..38df7560a973 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java @@ -105,7 +105,7 @@ public boolean isForced() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); VirtualMachine result = _mgr.rebootSystemVM(this); if (result != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(result); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java index d822d4fc26ef..a74289e68d9e 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java @@ -98,7 +98,7 @@ public long getEntityOwnerId() { @Override public void execute() { - CallContext.current().setEventDetails("SystemVm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("SystemVM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); ServiceOffering serviceOffering = _entityMgr.findById(ServiceOffering.class, serviceOfferingId); if (serviceOffering == null) { diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java index eac3d64ab59e..64eddba849c0 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java @@ -102,7 +102,7 @@ public Long getApiResourceId() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); VirtualMachine instance = _mgr.startSystemVM(getId()); if (instance != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java index 1d84382f5d22..4d4bb68e8e82 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java @@ -108,7 +108,7 @@ public boolean isForced() { @Override public void execute() throws ResourceUnavailableException, ConcurrentOperationException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); VirtualMachine result = _mgr.stopSystemVM(this); if (result != null) { SystemVmResponse response = _responseGenerator.createSystemVmResponse(result); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java index a42f00522496..1fb624411401 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java @@ -87,7 +87,7 @@ public long getEntityOwnerId() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); ServiceOffering serviceOffering = _entityMgr.findById(ServiceOffering.class, serviceOfferingId); if (serviceOffering == null) { diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java index a964e873bad1..393e85a4ae0b 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java @@ -96,7 +96,7 @@ public Long getApiResourceId() { @Override public void execute() throws ResourceUnavailableException, ConcurrentOperationException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); try { UserVm result = _userVmService.expungeVm(this.getId()); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java index d795fbabb528..ea485a15b86f 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java @@ -114,7 +114,7 @@ public ApiCommandResourceType getApiResourceType() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + getVirtualMachineId() + " ISO ID: " + getId()); + CallContext.current().setEventDetails("VM Id: " + getVirtualMachineId() + " ISO ID: " + getId()); boolean result = _templateService.attachIso(id, virtualMachineId, isForced()); if (result) { UserVm userVm = _responseGenerator.findUserVmById(virtualMachineId); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java index ecd066d98cd5..2141126d54e9 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java @@ -167,7 +167,7 @@ public ApiCommandResourceType getApiResourceType() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Network Id: " + this._uuidMgr.getUuid(Network.class, getNetworkId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Network Id: " + this._uuidMgr.getUuid(Network.class, getNetworkId())); UserVm result = _userVmService.addNicToVirtualMachine(this); ArrayList dc = new ArrayList(); dc.add(VMDetails.valueOf("nics")); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index dc1ca3583cc3..d61bbedf8536 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -91,7 +91,7 @@ public boolean isVolumeOrSnapshotProvided() { public void execute() { UserVm result; - CallContext.current().setEventDetails("Vm Id: " + getEntityUuid()); + CallContext.current().setEventDetails("VM Id: " + getEntityUuid()); if (getStartVm()) { try { result = _userVmService.startVirtualMachine(this); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java index 18a9d2058a62..79ea122a6ff1 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java @@ -131,7 +131,7 @@ public Long getApiResourceId() { @Override public void execute() throws ResourceUnavailableException, ConcurrentOperationException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); UserVm result = _userVmService.destroyVm(this); UserVmResponse response = new UserVmResponse(); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java index 153f5ea65636..145cd1774a6b 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java @@ -115,7 +115,7 @@ public Long getApiResourceId() { @Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); UserVm result; result = _userVmService.rebootVirtualMachine(this); if (result !=null){ diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java index d9024f340228..0cbf9f173d5a 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java @@ -103,7 +103,7 @@ public long getEntityOwnerId() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId())); UserVm result = _userVmService.removeNicFromVirtualMachine(this); ArrayList dc = new ArrayList(); dc.add(VMDetails.valueOf("nics")); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java index 7270004aeed8..622d35857e6f 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java @@ -124,7 +124,7 @@ public void execute() throws ResourceUnavailableException, InsufficientCapacityE } else { logger.debug(String.format("Resetting VM [%s] password to password defined by user.", vm.getUuid())); } - CallContext.current().setEventDetails("Vm Id: " + getId()); + CallContext.current().setEventDetails("VM Id: " + getId()); UserVm result = _userVmService.resetVMPassword(this, password); if (result != null){ UserVmResponse response = _responseGenerator.createUserVmResponse(getResponseView(), "virtualmachine", result).get(0); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java index a4019411e1d2..e311de71ef0e 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java @@ -152,7 +152,7 @@ public Long getApiResourceId() { @Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException { - CallContext.current().setEventDetails("Vm Id: " + getId()); + CallContext.current().setEventDetails("VM Id: " + getId()); UserVm result = _userVmService.resetVMSSHKey(this); if (result != null) { diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMUserDataCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMUserDataCmd.java index 0ecf4ff13845..7889a812676e 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMUserDataCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/ResetVMUserDataCmd.java @@ -143,7 +143,7 @@ public Long getApiResourceId() { @Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException { - CallContext.current().setEventDetails("Vm Id: " + getId()); + CallContext.current().setEventDetails("VM Id: " + getId()); UserVm result = _userVmService.resetVMUserData(this); if (result != null) { diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java index 3839049eee5e..014651158f02 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java @@ -97,7 +97,7 @@ public String getEventDescription() { public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { UserVm result; - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId())); result = _userVmService.restoreVM(this); if (result != null) { UserVmResponse response = _responseGenerator.createUserVmResponse(getResponseView(), "virtualmachine", result).get(0); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java index c0311d599974..b851b1334c22 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java @@ -177,7 +177,7 @@ public Long getApiResourceId() { @Override public void execute() { try { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); UserVm result; result = _userVmService.startVirtualMachine(this); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java index bfd5d8d07f61..6bfa3cf05b25 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java @@ -115,7 +115,7 @@ public boolean isForced() { @Override public void execute() throws ServerApiException, ConcurrentOperationException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); UserVm result; result = _userVmService.stopVirtualMachine(getId(), isForced()); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java index 837bde06a6ca..ed0f6514e869 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java @@ -104,7 +104,7 @@ public long getEntityOwnerId() { @Override public void execute() { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId())); UserVm result = _userVmService.updateDefaultNicForVirtualMachine(this); ArrayList dc = new ArrayList(); dc.add(VMDetails.valueOf("nics")); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java index 7906ec632a49..9e25c857ba7d 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java @@ -300,7 +300,7 @@ public long getEntityOwnerId() { @Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); UserVm result = null; try { result = _userVmService.updateVirtualMachine(this); diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java index 6a7422e70bbb..5e8840adcc30 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java @@ -139,7 +139,7 @@ public long getEntityOwnerId() { @Override public void execute() throws ResourceAllocationException { - CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); + CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId())); ServiceOffering serviceOffering = _entityMgr.findById(ServiceOffering.class, serviceOfferingId); if (serviceOffering == null) { diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 2b759235ac81..d4a541d714f9 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -1126,7 +1126,7 @@ private void updateRootDiskVolumeEventDetails(Type type, VirtualMachine vm, List callContext.setEventResourceId(volumeIds.get(0)); } String volumeUuids = volumeIds.stream().map(volumeId -> this._uuidMgr.getUuid(Volume.class, volumeId)).collect(Collectors.joining(", ")); - callContext.setEventDetails("Volume Type: " + type + "Volume Id: " + volumeUuids + " Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, vm.getId())); + callContext.setEventDetails("Volume Type: " + type + "Volume Id: " + volumeUuids + " VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, vm.getId())); } } @@ -1366,7 +1366,7 @@ private void destroyVolumeInContext(Volume volume) { // Create new context and inject correct event resource type, id and details, // otherwise VOLUME.DESTROY event will be associated with VirtualMachine and contain VM id and other information. CallContext volumeContext = CallContext.register(CallContext.current(), ApiCommandResourceType.Volume); - volumeContext.setEventDetails("Volume Type: " + volume.getVolumeType() + " Volume Id: " + volume.getUuid() + " Vm Id: " + _uuidMgr.getUuid(VirtualMachine.class, volume.getInstanceId())); + volumeContext.setEventDetails("Volume Type: " + volume.getVolumeType() + " Volume Id: " + volume.getUuid() + " VM Id: " + _uuidMgr.getUuid(VirtualMachine.class, volume.getInstanceId())); volumeContext.setEventResourceType(ApiCommandResourceType.Volume); volumeContext.setEventResourceId(volume.getId()); try { diff --git a/framework/db/src/main/java/com/cloud/utils/db/EcInfo.java b/framework/db/src/main/java/com/cloud/utils/db/EcInfo.java index dcda5bc33d55..08993c4de7e5 100644 --- a/framework/db/src/main/java/com/cloud/utils/db/EcInfo.java +++ b/framework/db/src/main/java/com/cloud/utils/db/EcInfo.java @@ -68,7 +68,7 @@ public EcInfo(Attribute attr, Attribute idAttr) { } CollectionTable ct = attr.field.getAnnotation(CollectionTable.class); - assert (ct.name().length() > 0) : "Please sepcify the table for " + attr.field.getName(); + assert (ct.name().length() > 0) : "Please specify the table for " + attr.field.getName(); StringBuilder selectBuf = new StringBuilder("SELECT "); StringBuilder insertBuf = new StringBuilder("INSERT INTO "); StringBuilder clearBuf = new StringBuilder("DELETE FROM "); diff --git a/plugins/network-elements/juniper-contrail/src/main/java/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java b/plugins/network-elements/juniper-contrail/src/main/java/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java index ce30b2281181..2488e1271643 100644 --- a/plugins/network-elements/juniper-contrail/src/main/java/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java +++ b/plugins/network-elements/juniper-contrail/src/main/java/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java @@ -134,7 +134,7 @@ private ServiceVirtualMachine createServiceVM(DataCenter zone, Account owner, Vi } catch (InsufficientCapacityException ex) { throw new CloudRuntimeException("Insufficient capacity", ex); } - CallContext.current().setEventDetails("Vm Id: " + svm.getId()); + CallContext.current().setEventDetails("VM ID: " + svm.getId()); return svm; } diff --git a/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java b/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java index b4771b57b508..47740d9c994b 100644 --- a/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java +++ b/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java @@ -110,7 +110,7 @@ public boolean isForced() { @Override public void execute() throws ConcurrentOperationException, ResourceUnavailableException { - CallContext.current().setEventDetails("NetScaler vm Id: " + getId()); + CallContext.current().setEventDetails("NetScaler VM ID: " + getId()); VirtualRouter result = null; VirtualRouter vm = _routerService.findRouter(getId()); if (vm == null || vm.getRole() != Role.NETSCALER_VM) { diff --git a/plugins/network-elements/stratosphere-ssp/src/test/java/org/apache/cloudstack/network/element/SspElementTest.java b/plugins/network-elements/stratosphere-ssp/src/test/java/org/apache/cloudstack/network/element/SspElementTest.java index d0aaffada7f0..6c3477f1199c 100644 --- a/plugins/network-elements/stratosphere-ssp/src/test/java/org/apache/cloudstack/network/element/SspElementTest.java +++ b/plugins/network-elements/stratosphere-ssp/src/test/java/org/apache/cloudstack/network/element/SspElementTest.java @@ -90,7 +90,7 @@ public void fullyConfigured() { when(_element._physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetworkId, "StratosphereSsp")).thenReturn(nspvo); - // and zone api server, credentail is configured + // and zone API server, credential is configured when(credential.getUsername()).thenReturn("foo"); when(credential.getPassword()).thenReturn("bar"); @@ -120,7 +120,7 @@ public void isReadyTest() { // ssp is ready assertTrue(_element.isReady(nspvo)); - // If you don't call addstratospheressp api, ssp won't be ready + // If you don't call addstratospheressp API, ssp won't be ready when(_element._sspCredentialDao.findByZone(dataCenterId.longValue())).thenReturn(null); when(_element._resourceMgr.listAllHostsInOneZoneByType(Host.Type.L2Networking, dataCenterId)).thenReturn(Arrays. asList()); assertFalse(_element.isReady(nspvo)); @@ -133,7 +133,7 @@ public void canHandleTest() { // ssp is active assertTrue(_element.canHandle(psvo)); - // You can disable ssp temporary by truning the state disabled + // You can disable ssp temporary by turning the state disabled when(nspvo.getState()).thenReturn(PhysicalNetworkServiceProvider.State.Disabled); assertFalse(_element.canHandle(psvo)); @@ -146,7 +146,7 @@ public void canHandleTest() { when(nspvo.getState()).thenReturn(PhysicalNetworkServiceProvider.State.Enabled); when(_element._physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetworkId, "StratosphereSsp")).thenReturn(nspvo); - // If you don't call addstratospheressp api, ssp won't be active + // If you don't call addstratospheressp API, ssp won't be active when(_element._sspCredentialDao.findByZone(dataCenterId.longValue())).thenReturn(null); when(_element._resourceMgr.listAllHostsInOneZoneByType(Host.Type.L2Networking, dataCenterId)).thenReturn(Arrays. asList()); assertFalse(_element.canHandle(psvo)); diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java index 58c56134560c..d0b746b11ed4 100644 --- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java @@ -3548,7 +3548,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { long vmId = nic.getInstanceId(); VMInstanceVO vm = _vmDao.findById(vmId); if (vm == null) { - logger.error("Vm for nic {} not found with Vm Id: {}", nic, vmId); + logger.error("VM for NIC {} not found with VM ID: {}", nic, vmId); continue; } long isDefault = (nic.isDefaultNic()) ? 1 : 0; diff --git a/server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java index 90380b77e440..09f51b175cb7 100644 --- a/server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java @@ -1992,7 +1992,7 @@ public void checkAutoScaleVmGroupName(String groupName) { private UserVmVO startNewVM(long vmId) { try { - CallContext.current().setEventDetails("Vm Id: " + vmId); + CallContext.current().setEventDetails("VM ID: " + vmId); return userVmMgr.startVirtualMachine(vmId, null, new HashMap<>(), null).first(); } catch (final ResourceUnavailableException ex) { logger.warn("Exception: ", ex); diff --git a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java index 06ec17d48efa..9bf0adbe8ff2 100755 --- a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java @@ -1188,7 +1188,7 @@ public boolean detachIso(long vmId, Long isoParamId, Boolean... extraParams) { if (isoId == null) { throw new InvalidParameterValueException("The specified VM has no ISO attached to it."); } - CallContext.current().setEventDetails("Vm Id: " + virtualMachine.getUuid() + " ISO Id: " + isoId); + CallContext.current().setEventDetails("VM ID: " + virtualMachine.getUuid() + " ISO ID: " + isoId); State vmState = virtualMachine.getState(); if (vmState != State.Running && vmState != State.Stopped) { diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index 96c87c5376d8..bdfd308ee0dc 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@ -683,19 +683,19 @@ public void setKubernetesServiceHelpers(final List kube VnfTemplateManager vnfTemplateManager; private static final ConfigKey VmIpFetchWaitInterval = new ConfigKey("Advanced", Integer.class, "externaldhcp.vmip.retrieval.interval", "180", - "Wait Interval (in seconds) for shared network vm dhcp ip addr fetch for next iteration ", true); + "Wait Interval (in seconds) for shared network VM DHCP IP addr fetch for next iteration", true); private static final ConfigKey VmIpFetchTrialMax = new ConfigKey("Advanced", Integer.class, "externaldhcp.vmip.max.retry", "10", - "The max number of retrieval times for shared network vm dhcp ip fetch, in case of failures", true); + "The max number of retrieval times for shared network VM DHCP IP fetch, in case of failures", true); private static final ConfigKey VmIpFetchThreadPoolMax = new ConfigKey("Advanced", Integer.class, "externaldhcp.vmipFetch.threadPool.max", "10", - "number of threads for fetching vms ip address", true); + "number of threads for fetching VMs IP address", true); private static final ConfigKey VmIpFetchTaskWorkers = new ConfigKey("Advanced", Integer.class, "externaldhcp.vmipfetchtask.workers", "10", - "number of worker threads for vm ip fetch task ", true); + "number of worker threads for VM IP fetch task", true); private static final ConfigKey AllowDeployVmIfGivenHostFails = new ConfigKey("Advanced", Boolean.class, "allow.deploy.vm.if.deploy.on.given.host.fails", "false", - "allow vm to deploy on different host if vm fails to deploy on the given host ", true); + "allow VM to deploy on different host if VM fails to deploy on the given host", true); private static final ConfigKey KvmAdditionalConfigAllowList = new ConfigKey<>(String.class, "allow.additional.vm.configuration.list.kvm", "Advanced", "", "Comma separated list of allowed additional configuration options.", true, ConfigKey.Scope.Account, null, null, EnableAdditionalVmConfig.key(), null, null, ConfigKey.Kind.CSV, null); @@ -798,7 +798,7 @@ protected void runInContext() { NicVO nic = _nicDao.findById(nicId); try { - logger.debug("Trying IP retrieval for VM [id: {}, uuid: {}, name: {}], nic {}", vmId, vmUuid, vmName, nic); + logger.debug("Trying IP retrieval for VM [ID: {}, uuid: {}, name: {}], NIC {}", vmId, vmUuid, vmName, nic); Answer answer = _agentMgr.send(hostId, cmd); if (answer.getResult()) { String vmIp = answer.getDetails(); @@ -813,12 +813,12 @@ protected void runInContext() { if (nic != null) { nic.setIPv4Address(vmIp); _nicDao.update(nicId, nic); - logger.debug("Vm [id: {}, uuid: {}, name: {}] - IP {} retrieved successfully", vmId, vmUuid, vmName, vmIp); + logger.debug("VM [ID: {}, uuid: {}, name: {}] - IP {} retrieved successfully", vmId, vmUuid, vmName, vmIp); vmIdCountMap.remove(nicId); decrementCount = false; ActionEventUtils.onActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, Domain.ROOT_DOMAIN, EventTypes.EVENT_NETWORK_EXTERNAL_DHCP_VM_IPFETCH, - String.format("VM [id: %d, uuid: %s, name: %s], nic %s, IP address %s got fetched successfully", + String.format("VM [ID: %d, uuid: %s, name: %s], NIC %s, IP address %s got fetched successfully", vmId, vmUuid, vmName, nic, vmIp), vmId, ApiCommandResourceType.VirtualMachine.toString()); } } @@ -826,7 +826,7 @@ protected void runInContext() { // since no changes are being done, we should not decrement IP usage decrementCount = false; if (answer.getDetails() != null) { - logger.debug("Failed to get vm ip for Vm [id: {}, uuid: {}, name: {}], details: {}", + logger.debug("Failed to get VM IP for VM [ID: {}, uuid: {}, name: {}], details: {}", vmId, vmUuid, vmName, answer.getDetails()); } } @@ -838,7 +838,7 @@ protected void runInContext() { if (decrementCount) { VmAndCountDetails vmAndCount = vmIdCountMap.get(nicId); vmAndCount.decrementCount(); - logger.debug("Ip is not retrieved for VM [id: {}, uuid: {}, name: {}] nic {} ... decremented count to {}", + logger.debug("IP is not retrieved for VM [ID: {}, uuid: {}, name: {}] NIC {} ... decremented count to {}", vmId, vmUuid, vmName, nic, vmAndCount.getRetrievalCount()); vmIdCountMap.put(nicId, vmAndCount); } @@ -861,7 +861,7 @@ private void addVmUefiBootOptionsToParams(Map names = cmd.getNames(); @@ -1077,7 +1077,7 @@ private UserVmVO resetVMSSHKeyInternal(UserVmVO userVm, Account owner, List vmNetworks = _vmNetworkMapDao.getNetworks(vmId); List routers = new ArrayList(); //List the stopped routers @@ -1198,11 +1198,11 @@ private UserVm rebootVirtualMachine(long userId, long vmId, boolean enterSetup, List router = _routerDao.listStopped(vmNetworkId); routers.addAll(router); } - //A vm may not have many nics attached and even fewer routers might be stopped (only in exceptional cases) - //Safe to start the stopped router serially, this is consistent with the way how multiple networks are added to vm during deploy - //and routers are started serially ,may revisit to make this process parallel + //A VM may not have many NICs attached and even fewer routers might be stopped (only in exceptional cases) + //Safe to start the stopped router serially, this is consistent with the way how multiple networks are added to VM during deploy + //and routers are started serially, may revisit to make this process parallel for(DomainRouterVO routerToStart : routers) { - logger.warn("Trying to start router {} as part of vm: {} reboot", routerToStart, vm); + logger.warn("Trying to start router {} as part of VM: {} reboot", routerToStart, vm); _virtualNetAppliance.startRouter(routerToStart.getId(),true); } } @@ -1212,7 +1212,7 @@ private UserVm rebootVirtualMachine(long userId, long vmId, boolean enterSetup, throw new CloudRuntimeException("Router start failed due to" + ex); } finally { if (logger.isInfoEnabled()) { - logger.info("Rebooting vm {}{}.", vm, enterSetup ? " entering hardware setup menu" : " as is"); + logger.info("Rebooting VM {}{}.", vm, enterSetup ? " entering hardware setup menu" : " as is"); } Map params = null; if (enterSetup) { @@ -1226,7 +1226,7 @@ private UserVm rebootVirtualMachine(long userId, long vmId, boolean enterSetup, } return _vmDao.findById(vmId); } else { - logger.error("Vm {} is not in Running state, failed to reboot", vm); + logger.error("VM {} is not in Running state, failed to reboot", vm); return null; } } @@ -1247,7 +1247,7 @@ private UserVm forceRebootVirtualMachine(UserVmVO vm, long hostId, boolean enter } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_UPGRADE, eventDescription = "upgrading Vm") + @ActionEvent(eventType = EventTypes.EVENT_VM_UPGRADE, eventDescription = "upgrading VM") /* * TODO: cleanup eventually - Refactored API call */ @@ -1261,7 +1261,7 @@ public UserVm upgradeVirtualMachine(UpgradeVMCmd cmd) throws ResourceAllocationE //UserVmVO vmInstance = _vmDao.findById(vmId); VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId); if (vmInstance == null) { - throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); + throw new InvalidParameterValueException("unable to find a virtual machine with ID " + vmId); } else if (!(vmInstance.getState().equals(State.Stopped))) { throw new InvalidParameterValueException("Unable to upgrade virtual machine " + vmInstance.toString() + " " + " in state " + vmInstance.getState() + "; make sure the virtual machine is stopped"); @@ -1315,7 +1315,7 @@ protected void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifie private void validateOfferingMaxResource(ServiceOfferingVO offering) { Integer maxCPUCores = ConfigurationManagerImpl.VM_SERVICE_OFFERING_MAX_CPU_CORES.value() == 0 ? Integer.MAX_VALUE: ConfigurationManagerImpl.VM_SERVICE_OFFERING_MAX_CPU_CORES.value(); if (offering.getCpu() > maxCPUCores) { - throw new InvalidParameterValueException("Invalid cpu cores value, please choose another service offering with cpu cores between 1 and " + maxCPUCores); + throw new InvalidParameterValueException("Invalid CPU cores value, please choose another service offering with CPU cores between 1 and " + maxCPUCores); } Integer maxRAMSize = ConfigurationManagerImpl.VM_SERVICE_OFFERING_MAX_RAM_SIZE.value() == 0 ? Integer.MAX_VALUE: ConfigurationManagerImpl.VM_SERVICE_OFFERING_MAX_RAM_SIZE.value(); if (offering.getRamSize() > maxRAMSize) { @@ -1325,7 +1325,7 @@ private void validateOfferingMaxResource(ServiceOfferingVO offering) { @Override public void validateCustomParameters(ServiceOfferingVO serviceOffering, Map customParameters) { - //TODO need to validate custom cpu, and memory against min/max CPU/Memory ranges from service_offering_details table + //TODO need to validate custom CPU, and memory against min/max CPU/Memory ranges from service_offering_details table if (customParameters.size() != 0) { Map offeringDetails = serviceOfferingDetailsDao.listDetailsKeyPairs(serviceOffering.getId()); if (serviceOffering.getCpu() == null) { @@ -1334,20 +1334,20 @@ public void validateCustomParameters(ServiceOfferingVO serviceOffering, Map maxCPU || cpuNumber > maxCPUCores) { - throw new InvalidParameterValueException(String.format("Invalid cpu cores value, specify a value between %d and %d", minCPU, Math.min(maxCPUCores, maxCPU))); + throw new InvalidParameterValueException(String.format("Invalid CPU cores value, specify a value between %d and %d", minCPU, Math.min(maxCPUCores, maxCPU))); } } else if (customParameters.containsKey(UsageEventVO.DynamicParameters.cpuNumber.name())) { - throw new InvalidParameterValueException("The cpu cores of this offering id:" + serviceOffering.getUuid() + throw new InvalidParameterValueException("The CPU cores of this offering id:" + serviceOffering.getUuid() + " is not customizable. This is predefined in the template."); } if (serviceOffering.getSpeed() == null) { String cpuSpeed = customParameters.get(UsageEventVO.DynamicParameters.cpuSpeed.name()); if ((cpuSpeed == null) || (NumbersUtil.parseInt(cpuSpeed, -1) <= 0)) { - throw new InvalidParameterValueException("Invalid cpu speed value, specify a value between 1 and " + Integer.MAX_VALUE); + throw new InvalidParameterValueException("Invalid CPU speed value, specify a value between 1 and " + Integer.MAX_VALUE); } } else if (!serviceOffering.isCustomCpuSpeedSupported() && customParameters.containsKey(UsageEventVO.DynamicParameters.cpuSpeed.name())) { - throw new InvalidParameterValueException("The cpu speed of this offering id:" + serviceOffering.getUuid() + throw new InvalidParameterValueException("The CPU speed of this offering id:" + serviceOffering.getUuid() + " is not customizable. This is predefined in the template."); } @@ -1360,10 +1360,10 @@ public void validateCustomParameters(ServiceOfferingVO serviceOffering, Map 0) { throw new InvalidParameterValueException("NIC cannot be added to VM with VM Snapshots"); } NetworkVO network = _networkDao.findById(networkId); if (network == null) { - throw new InvalidParameterValueException("unable to find a network with id " + networkId); + throw new InvalidParameterValueException("unable to find a network with ID " + networkId); } if (UserVmManager.SHAREDFSVM.equals(vmInstance.getUserVmType()) && network.getGuestType() == Network.GuestType.Shared) { @@ -1522,11 +1522,11 @@ public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) throws InvalidParameterV if(_networkModel.getNicInNetwork(vmInstance.getId(),network.getId()) != null){ logger.debug("VM {} already in network {} going to add another NIC", vmInstance, network); } else { - //* get all vms hostNames in the network + //* get all VMs hostNames in the network List hostNames = _vmInstanceDao.listDistinctHostNames(network.getId()); //* verify that there are no duplicates if (hostNames.contains(vmInstance.getHostName())) { - throw new CloudRuntimeException("Network " + network.getName() + " already has a vm with host name: " + vmInstance.getHostName()); + throw new CloudRuntimeException("Network " + network.getName() + " already has a VM with host name: " + vmInstance.getHostName()); } } @@ -1609,7 +1609,7 @@ private void saveExtraDhcpOptions(long nicId, Map dhcpOptions) } @Override - @ActionEvent(eventType = EventTypes.EVENT_NIC_DELETE, eventDescription = "Removing Nic", async = true) + @ActionEvent(eventType = EventTypes.EVENT_NIC_DELETE, eventDescription = "Removing NIC", async = true) public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws InvalidParameterValueException, PermissionDeniedException, CloudRuntimeException { Long vmId = cmd.getVmId(); Long nicId = cmd.getNicId(); @@ -1617,7 +1617,7 @@ public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws Invalid UserVmVO vmInstance = _vmDao.findById(vmId); if (vmInstance == null) { - throw new InvalidParameterValueException("Unable to find a virtual machine with id " + vmId); + throw new InvalidParameterValueException("Unable to find a virtual machine with ID " + vmId); } // Check that Vm does not have VM Snapshots @@ -1627,12 +1627,12 @@ public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws Invalid NicVO nic = _nicDao.findById(nicId); if (nic == null) { - throw new InvalidParameterValueException("Unable to find a nic with id " + nicId); + throw new InvalidParameterValueException("Unable to find a NIC with ID " + nicId); } NetworkVO network = _networkDao.findById(nic.getNetworkId()); if (network == null) { - throw new InvalidParameterValueException("Unable to find a network with id " + nic.getNetworkId()); + throw new InvalidParameterValueException("Unable to find a network with ID " + nic.getNetworkId()); } // Perform permission check on VM @@ -1644,19 +1644,19 @@ public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws Invalid throw new InvalidParameterValueException(String.format("Zone %s, has a NetworkType of Basic. Can't remove a NIC from a VM on a Basic Network", dc)); } - // check to see if nic is attached to VM + // check to see if NIC is attached to VM if (nic.getInstanceId() != vmId) { - throw new InvalidParameterValueException(nic + " is not a nic on " + vmInstance); + throw new InvalidParameterValueException(nic + " is not a NIC on " + vmInstance); } // don't delete default NIC on a user VM if (nic.isDefaultNic() && vmInstance.getType() == VirtualMachine.Type.User) { - throw new InvalidParameterValueException("Unable to remove nic from " + vmInstance + " in " + network + ", nic is default."); + throw new InvalidParameterValueException("Unable to remove NIC from " + vmInstance + " in " + network + ", NIC is default."); } - // if specified nic is associated with PF/LB/Static NAT + // if specified NIC is associated with PF/LB/Static NAT if (_rulesMgr.listAssociatedRulesForGuestNic(nic).size() > 0) { - throw new InvalidParameterValueException("Unable to remove nic from " + vmInstance + " in " + network + ", nic has associated Port forwarding or Load balancer or Static NAT rules."); + throw new InvalidParameterValueException("Unable to remove NIC from " + vmInstance + " in " + network + ", NIC has associated Port forwarding or Load balancer or Static NAT rules."); } boolean nicremoved = false; @@ -1678,7 +1678,7 @@ public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws Invalid } @Override - @ActionEvent(eventType = EventTypes.EVENT_NIC_UPDATE, eventDescription = "Creating Nic", async = true) + @ActionEvent(eventType = EventTypes.EVENT_NIC_UPDATE, eventDescription = "Creating NIC", async = true) public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) throws InvalidParameterValueException, CloudRuntimeException { Long vmId = cmd.getVmId(); Long nicId = cmd.getNicId(); @@ -1686,21 +1686,21 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th UserVmVO vmInstance = _vmDao.findById(vmId); if (vmInstance == null) { - throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); + throw new InvalidParameterValueException("unable to find a virtual machine with ID " + vmId); } - // Check that Vm does not have VM Snapshots + // Check that VM does not have VM Snapshots if (_vmSnapshotDao.findByVm(vmId).size() > 0) { throw new InvalidParameterValueException("NIC cannot be updated for VM with VM Snapshots"); } NicVO nic = _nicDao.findById(nicId); if (nic == null) { - throw new InvalidParameterValueException("unable to find a nic with id " + nicId); + throw new InvalidParameterValueException("unable to find a NIC with ID " + nicId); } NetworkVO network = _networkDao.findById(nic.getNetworkId()); if (network == null) { - throw new InvalidParameterValueException("unable to find a network with id " + nic.getNetworkId()); + throw new InvalidParameterValueException("unable to find a network with ID " + nic.getNetworkId()); } // Perform permission check on VM @@ -1715,13 +1715,13 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th // no need to check permissions for network, we'll enumerate the ones they already have access to Network existingdefaultnet = _networkModel.getDefaultNetworkForVm(vmId); - //check to see if nic is attached to VM + //check to see if NIC is attached to VM if (nic.getInstanceId() != vmId) { - throw new InvalidParameterValueException(nic + " is not a nic on " + vmInstance); + throw new InvalidParameterValueException(nic + " is not a NIC on " + vmInstance); } - // if current default equals chosen new default, Throw an exception + // if current default equals chosen new default, throw an exception if (nic.isDefaultNic()) { - throw new CloudRuntimeException("refusing to set default nic because chosen nic is already the default"); + throw new CloudRuntimeException("refusing to set default NIC because chosen NIC is already the default"); } //make sure the VM is Running or Stopped @@ -1738,8 +1738,8 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th } if (existing == null) { - logger.warn("Failed to update default nic, no nic profile found for existing default network"); - throw new CloudRuntimeException("Failed to find a nic profile for the existing default network. This is bad and probably means some sort of configuration corruption"); + logger.warn("Failed to update default NIC, no NIC profile found for existing default network"); + throw new CloudRuntimeException("Failed to find a NIC profile for the existing default network. This is bad and probably means some sort of configuration corruption"); } Network oldDefaultNetwork = null; @@ -1770,9 +1770,9 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th newdefault = _networkModel.getDefaultNetworkForVm(vmId); if (newdefault.getId() == existingdefaultnet.getId()) { - throw new CloudRuntimeException("Setting a default nic failed, and we had no default nic, but we were able to set it back to the original"); + throw new CloudRuntimeException("Setting a default NIC failed, and we had no default NIC, but we were able to set it back to the original"); } - throw new CloudRuntimeException("Failed to change default nic to " + nic + " and now we have no default"); + throw new CloudRuntimeException("Failed to change default NIC to " + nic + " and now we have no default"); } else if (newdefault.getId() == nic.getNetworkId()) { logger.debug("successfully set default network to " + network + " for " + vmInstance); String nicIdString = Long.toString(nic.getId()); @@ -1801,7 +1801,7 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th return _vmDao.findById(vmInstance.getId()); } - throw new CloudRuntimeException(String.format("something strange happened, new default network(%s) is not null, and is not equal to the network(%d) of the chosen nic", newdefault, nic.getNetworkId())); + throw new CloudRuntimeException(String.format("something strange happened, new default network(%s) is not null, and is not equal to the network(%d) of the chosen NIC", newdefault, nic.getNetworkId())); } @Override @@ -1810,28 +1810,28 @@ public UserVm updateNicIpForVirtualMachine(UpdateVmNicIpCmd cmd) { String ipaddr = cmd.getIpaddress(); Account caller = CallContext.current().getCallingAccount(); - //check whether the nic belongs to user vm. + //check whether the NIC belongs to user VM. NicVO nicVO = _nicDao.findById(nicId); if (nicVO == null) { - throw new InvalidParameterValueException("There is no nic for the " + nicId); + throw new InvalidParameterValueException("There is no NIC for the " + nicId); } if (nicVO.getVmType() != VirtualMachine.Type.User) { - throw new InvalidParameterValueException("The nic is not belongs to user vm"); + throw new InvalidParameterValueException("The NIC is not belongs to user VM"); } UserVm vm = _vmDao.findById(nicVO.getInstanceId()); if (vm == null) { - throw new InvalidParameterValueException("There is no vm with the nic"); + throw new InvalidParameterValueException("There is no VM with the NIC"); } Network network = _networkDao.findById(nicVO.getNetworkId()); if (network == null) { - throw new InvalidParameterValueException("There is no network with the nic"); + throw new InvalidParameterValueException("There is no network with the NIC"); } - // Don't allow to update vm nic ip if network is not in Implemented/Setup/Allocated state + // Don't allow to update VM NIC IP if network is not in Implemented/Setup/Allocated state if (!(network.getState() == Network.State.Allocated || network.getState() == Network.State.Implemented || network.getState() == Network.State.Setup)) { - throw new InvalidParameterValueException("Network is not in the right state to update vm nic ip. Correct states are: " + Network.State.Allocated + ", " + Network.State.Implemented + ", " + throw new InvalidParameterValueException("Network is not in the right state to update VM NIC IP. Correct states are: " + Network.State.Allocated + ", " + Network.State.Implemented + ", " + Network.State.Setup); } @@ -1841,7 +1841,7 @@ public UserVm updateNicIpForVirtualMachine(UpdateVmNicIpCmd cmd) { } if (!_networkModel.listNetworkOfferingServices(offering.getId()).isEmpty() && vm.getState() != State.Stopped) { InvalidParameterValueException ex = new InvalidParameterValueException( - "VM is not Stopped, unable to update the vm nic having the specified id"); + "VM is not Stopped, unable to update the VM NIC having the specified ID"); ex.addProxyObject(vm.getUuid(), "vmId"); throw ex; } @@ -1850,20 +1850,20 @@ public UserVm updateNicIpForVirtualMachine(UpdateVmNicIpCmd cmd) { _accountMgr.checkAccess(caller, null, true, vm); Account ipOwner = _accountDao.findByIdIncludingRemoved(vm.getAccountId()); - // verify ip address - logger.debug("Calling the ip allocation ..."); + // verify IP address + logger.debug("Calling the IP allocation ..."); DataCenter dc = _dcDao.findById(network.getDataCenterId()); if (dc == null) { - throw new InvalidParameterValueException("There is no dc with the nic"); + throw new InvalidParameterValueException("There is no dc with the NIC"); } if (dc.getNetworkType() == NetworkType.Advanced && network.getGuestType() == Network.GuestType.Isolated) { try { ipaddr = _ipAddrMgr.allocateGuestIP(network, ipaddr); } catch (InsufficientAddressCapacityException e) { - throw new InvalidParameterValueException(String.format("Allocating ip to guest nic %s failed, for insufficient address capacity", nicVO)); + throw new InvalidParameterValueException(String.format("Allocating IP to guest NIC %s failed, for insufficient address capacity", nicVO)); } if (ipaddr == null) { - throw new InvalidParameterValueException(String.format("Allocating ip to guest nic %s failed, please choose another ip", nicVO)); + throw new InvalidParameterValueException(String.format("Allocating IP to guest NIC %s failed, please choose another IP", nicVO)); } if (nicVO.getIPv4Address() != null) { @@ -1874,19 +1874,19 @@ public UserVm updateNicIpForVirtualMachine(UpdateVmNicIpCmd cmd) { } else if (dc.getNetworkType() == NetworkType.Basic || network.getGuestType() == Network.GuestType.Shared) { //handle the basic networks here - //for basic zone, need to provide the podId to ensure proper ip alloation + //for basic zone, need to provide the podId to ensure proper IP allocation Long podId = null; if (dc.getNetworkType() == NetworkType.Basic) { podId = vm.getPodIdToDeployIn(); if (podId == null) { - throw new InvalidParameterValueException("vm pod id is null in Basic zone; can't decide the range for ip allocation"); + throw new InvalidParameterValueException("VM pod ID is null in Basic zone; can't decide the range for IP allocation"); } } try { ipaddr = _ipAddrMgr.allocatePublicIpForGuestNic(network, podId, ipOwner, ipaddr); if (ipaddr == null) { - throw new InvalidParameterValueException("Allocating ip to guest nic " + nicVO.getUuid() + " failed, please choose another ip"); + throw new InvalidParameterValueException("Allocating IP to guest NIC " + nicVO.getUuid() + " failed, please choose another IP"); } final IPAddressVO newIp = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), ipaddr); @@ -1905,7 +1905,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { }); } } catch (InsufficientAddressCapacityException e) { - logger.error("Allocating ip to guest nic {} failed, for insufficient address capacity", nicVO); + logger.error("Allocating IP to guest NIC {} failed, for insufficient address capacity", nicVO); return null; } } else { @@ -1978,7 +1978,7 @@ public UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableEx throw new InvalidParameterValueException(String.format("Operation not supported for instance: %s", vm.getName())); } - CallContext.current().setEventDetails("Vm Id: " + vm.getUuid()); + CallContext.current().setEventDetails("VM ID: " + vm.getUuid()); Map cmdDetails = cmd.getDetails(); @@ -2006,7 +2006,7 @@ public boolean upgradeVirtualMachine(Long vmId, Long newServiceOfferingId, Map() { @@ -2380,11 +2380,11 @@ public UserVm recoverVirtualMachine(RecoverVMCmd cmd) throws ResourceAllocationE try { if (!_itMgr.stateTransitTo(vm, VirtualMachine.Event.RecoveryRequested, null)) { - logger.debug("Unable to recover the vm {} because it is not in the correct state. current state: {}", vm, vm.getState()); - throw new InvalidParameterValueException(String.format("Unable to recover the vm %s because it is not in the correct state. current state: %s", vm, vm.getState())); + logger.debug("Unable to recover the VM {} because it is not in the correct state. current state: {}", vm, vm.getState()); + throw new InvalidParameterValueException(String.format("Unable to recover the VM %s because it is not in the correct state. current state: %s", vm, vm.getState())); } } catch (NoTransitionException e) { - throw new InvalidParameterValueException(String.format("Unable to recover the vm %s because it is not in the correct state. current state: %s", vm, vm.getState())); + throw new InvalidParameterValueException(String.format("Unable to recover the VM %s because it is not in the correct state. current state: %s", vm, vm.getState())); } // Recover the VM's disks @@ -2500,7 +2500,7 @@ private void loadVmDetailsInMapForExternalDhcpIp() { long vmId = nic.getInstanceId(); VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId); - // only load running vms. For stopped vms get loaded on starting + // only load running VMs. For stopped VMs get loaded on starting if (vmInstance != null && vmInstance.getState() == State.Running) { VmAndCountDetails vmAndCount = new VmAndCountDetails(vmId, VmIpFetchTrialMax.value()); vmIdCountMap.put(nicId, vmAndCount); @@ -2537,18 +2537,18 @@ public boolean expunge(UserVmVO vm) { releaseNetworkResourcesOnExpunge(vm.getId()); List rootVol = _volsDao.findByInstanceAndType(vm.getId(), Volume.Type.ROOT); - // expunge the vm + // expunge the VM _itMgr.advanceExpunge(vm.getUuid()); - // Only if vm is not expunged already, cleanup it's resources + // Only if VM is not expunged already, cleanup it's resources if (vm.getRemoved() == null) { - // Cleanup vm resources - all the PF/LB/StaticNat rules - // associated with vm - logger.debug("Starting cleaning up vm " + vm + " resources..."); + // Cleanup VM resources - all the PF/LB/StaticNat rules + // associated with VM + logger.debug("Starting cleaning up VM " + vm + " resources..."); if (cleanupVmResources(vm)) { - logger.debug("Successfully cleaned up vm " + vm + " resources as a part of expunge process"); + logger.debug("Successfully cleaned up VM " + vm + " resources as a part of expunge process"); } else { - logger.warn("Failed to cleanup resources as a part of vm " + vm + " expunge"); + logger.warn("Failed to cleanup resources as a part of VM " + vm + " expunge"); return false; } @@ -2577,8 +2577,8 @@ public boolean expunge(UserVmVO vm) { } /** - * Release network resources, it was done on vm stop previously. - * @param id vm id + * Release network resources, it was done on VM stop previously. + * @param id VM id * @throws ConcurrentOperationException * @throws ResourceUnavailableException */ @@ -2589,25 +2589,25 @@ private void releaseNetworkResourcesOnExpunge(long id) throws ConcurrentOperatio _networkMgr.release(profile, false); } else { - logger.error("Couldn't find vm with id = " + id + ", unable to release network resources"); + logger.error("Couldn't find VM with ID = " + id + ", unable to release network resources"); } } private boolean cleanupVmResources(UserVmVO vm) { long vmId = vm.getId(); boolean success = true; - // Remove vm from security groups + // Remove VM from security groups _securityGroupMgr.removeInstanceFromGroups(vm); - // Remove vm from instance group + // Remove VM from instance group removeInstanceFromInstanceGroup(vmId); // cleanup firewall rules if (_firewallMgr.revokeFirewallRulesForVm(vmId)) { - logger.debug("Firewall rules are removed successfully as a part of vm {} expunge", vm); + logger.debug("Firewall rules are removed successfully as a part of VM {} expunge", vm); } else { success = false; - logger.warn("Fail to remove firewall rules as a part of vm {} expunge", vm); + logger.warn("Fail to remove firewall rules as a part of VM {} expunge", vm); } // cleanup port forwarding rules @@ -2615,36 +2615,36 @@ private boolean cleanupVmResources(UserVmVO vm) { NsxProviderVO nsx = nsxProviderDao.findByZoneId(vmInstanceVO.getDataCenterId()); if (Objects.isNull(nsx) || Objects.isNull(kubernetesServiceHelpers.get(0).findByVmId(vmId))) { if (_rulesMgr.revokePortForwardingRulesForVm(vmId)) { - logger.debug("Port forwarding rules are removed successfully as a part of vm {} expunge", vm); + logger.debug("Port forwarding rules are removed successfully as a part of VM {} expunge", vm); } else { success = false; - logger.warn("Fail to remove port forwarding rules as a part of vm {} expunge", vm); + logger.warn("Fail to remove port forwarding rules as a part of VM {} expunge", vm); } } // cleanup load balancer rules if (_lbMgr.removeVmFromLoadBalancers(vmId)) { - logger.debug("Removed vm {} from all load balancers as a part of expunge process", vm); + logger.debug("Removed VM {} from all load balancers as a part of expunge process", vm); } else { success = false; - logger.warn("Fail to remove vm {} from load balancers as a part of expunge process", vm); + logger.warn("Fail to remove VM {} from load balancers as a part of expunge process", vm); } - // If vm is assigned to static nat, disable static nat for the ip - // address and disassociate ip if elasticIP is enabled + // If VM is assigned to static NAT, disable static NAT for the IP + // address and disassociate IP if elasticIP is enabled List ips = _ipAddressDao.findAllByAssociatedVmId(vmId); for (IPAddressVO ip : ips) { try { if (_rulesMgr.disableStaticNat(ip.getId(), _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM), User.UID_SYSTEM, true)) { - logger.debug("Disabled 1-1 nat for ip address {} as a part of vm {} expunge", ip, vm); + logger.debug("Disabled 1-1 NAT for IP address {} as a part of VM {} expunge", ip, vm); } else { - logger.warn("Failed to disable static nat for ip address {} as a part of vm {} expunge", ip, vm); + logger.warn("Failed to disable static NAT for IP address {} as a part of VM {} expunge", ip, vm); success = false; } } catch (ResourceUnavailableException e) { success = false; - logger.warn("Failed to disable static nat for ip address {} as a part of vm {} expunge because resource is unavailable", ip, vm, e); + logger.warn("Failed to disable static NAT for IP address {} as a part of VM {} expunge because resource is unavailable", ip, vm, e); } } @@ -2658,7 +2658,7 @@ public void deletePrivateTemplateRecord(Long templateId) { } } - // used for vm transitioning to error state + // used for VM transitioning to error state private void updateVmStateForFailedVmCreation(Long vmId, Long hostId) { UserVmVO vm = _vmDao.findById(vmId); @@ -2666,13 +2666,13 @@ private void updateVmStateForFailedVmCreation(Long vmId, Long hostId) { if (vm != null) { if (vm.getState().equals(State.Stopped)) { HostVO host = _hostDao.findById(hostId); - logger.debug("Destroying vm {} as it failed to create on Host: {} with id {}", vm, host, hostId); + logger.debug("Destroying VM {} as it failed to create on Host: {} with ID {}", vm, host, hostId); try { _itMgr.stateTransitTo(vm, VirtualMachine.Event.OperationFailedToError, null); } catch (NoTransitionException e1) { logger.warn(e1.getMessage()); } - // destroy associated volumes for vm in error state + // destroy associated volumes for VM in error state // get all volumes in non destroyed state List volumesForThisVm = _volsDao.findUsableVolumesForInstance(vm.getId()); for (VolumeVO volume : volumesForThisVm) { @@ -2680,7 +2680,7 @@ private void updateVmStateForFailedVmCreation(Long vmId, Long hostId) { volumeMgr.destroyVolume(volume); } } - String msg = String.format("Failed to deploy Vm %s, on Host %s with Id: %d", vm, host, hostId); + String msg = String.format("Failed to deploy VM %s, on Host %s with ID: %d", vm, host, hostId); _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_USERVM, vm.getDataCenterId(), vm.getPodIdToDeployIn(), msg, msg); // Get serviceOffering and template for Virtual Machine @@ -2711,11 +2711,11 @@ protected void runInContext() { if (vmIdAndCount.getRetrievalCount() <= 0) { vmIdCountMap.remove(nicId); - logger.debug("Vm {} nic {} count is zero .. removing vm nic from map ", vmId, nicId); + logger.debug("VM {} NIC {} count is zero .. removing VM NIC from map ", vmId, nicId); ActionEventUtils.onActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, Domain.ROOT_DOMAIN, EventTypes.EVENT_NETWORK_EXTERNAL_DHCP_VM_IPFETCH, - "VM " + vmId + " nic id "+ nicId + " ip addr fetch failed ", vmId, ApiCommandResourceType.VirtualMachine.toString()); + "VM " + vmId + " NIC ID "+ nicId + " IP addr fetch failed ", vmId, ApiCommandResourceType.VirtualMachine.toString()); continue; } @@ -2764,9 +2764,9 @@ protected void runInContext() { List vms = _vmDao.findDestroyedVms(new Date(System.currentTimeMillis() - ((long)_expungeDelay << 10))); if (logger.isInfoEnabled()) { if (vms.size() == 0) { - logger.trace("Found " + vms.size() + " vms to expunge."); + logger.trace("Found " + vms.size() + " VMs to expunge."); } else { - logger.info("Found " + vms.size() + " vms to expunge."); + logger.info("Found " + vms.size() + " VMs to expunge."); } } for (UserVmVO vm : vms) { @@ -2865,7 +2865,7 @@ private void adjustVmLimits(Account owner, UserVmVO vmInstance, ServiceOfferingV } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_UPDATE, eventDescription = "updating Vm") + @ActionEvent(eventType = EventTypes.EVENT_VM_UPDATE, eventDescription = "updating VM") public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException { validateInputsAndPermissionForUpdateVirtualMachineCommand(cmd); @@ -2982,7 +2982,7 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx } if (StringUtils.isNotBlank(extraConfig)) { if (EnableAdditionalVmConfig.valueIn(accountId)) { - logger.info("Adding extra configuration to user vm: " + vmInstance.getUuid()); + logger.info("Adding extra configuration to user VM: " + vmInstance.getUuid()); addExtraConfig(vmInstance, extraConfig); } else { throw new InvalidParameterValueException("attempted setting extraconfig but enable.additional.vm.configuration is disabled"); @@ -3036,7 +3036,7 @@ protected void updateDisplayVmFlag(Boolean isDisplayVm, Long id, UserVmVO vmInst protected void validateInputsAndPermissionForUpdateVirtualMachineCommand(UpdateVMCmd cmd) { UserVmVO vmInstance = _vmDao.findById(cmd.getId()); if (vmInstance == null) { - throw new InvalidParameterValueException("unable to find virtual machine with id: " + cmd.getId()); + throw new InvalidParameterValueException("unable to find virtual machine with ID: " + cmd.getId()); } validateGuestOsIdForUpdateVirtualMachineCommand(cmd); Account caller = CallContext.current().getCallingAccount(); @@ -3055,7 +3055,7 @@ protected void validateGuestOsIdForUpdateVirtualMachineCommand(UpdateVMCmd cmd) private void saveUsageEvent(UserVmVO vm) { - // If vm not destroyed + // If VM not destroyed if( vm.getState() != State.Destroyed && vm.getState() != State.Expunging && vm.getState() != State.Error){ if(vm.isDisplayVm()){ @@ -3120,8 +3120,8 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo } if (vm.getState() == State.Error || vm.getState() == State.Expunging) { - logger.error("vm {} is not in the correct state. current state: {}", vm, vm.getState()); - throw new InvalidParameterValueException(String.format("Vm %s is not in the right state", vm)); + logger.error("VM {} is not in the correct state. current state: {}", vm, vm.getState()); + throw new InvalidParameterValueException(String.format("VM %s is not in the right state", vm)); } if (displayName == null) { @@ -3134,7 +3134,7 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo ServiceOffering offering = serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); if (!offering.isOfferHA() && ha) { - throw new InvalidParameterValueException("Can't enable ha for the vm as it's created from the Service offering having HA disabled"); + throw new InvalidParameterValueException("Can't enable HA for the VM as it's created from the Service offering having HA disabled"); } if (isDisplayVmEnabled == null) { @@ -3196,11 +3196,11 @@ public UserVm updateVirtualMachine(long id, String displayName, String group, Bo checkNameForRFCCompliance(hostName); if (vm.getHostName().equals(hostName)) { - logger.debug("Vm " + vm + " is already set with the hostName specified: " + hostName); + logger.debug("VM " + vm + " is already set with the hostName specified: " + hostName); hostName = null; } - // Verify that vm's hostName is unique + // Verify that VM's hostName is unique List vmNtwks = new ArrayList(nics.size()); for (Nic nic : nics) { @@ -3284,7 +3284,7 @@ private void updateSecurityGroup(UserVmVO vm, List securityGroupIdList) { protected void updateUserData(UserVm vm) throws ResourceUnavailableException, InsufficientCapacityException { boolean result = updateUserDataInternal(vm); if (result) { - logger.debug("User data successfully updated for vm id: {}", vm); + logger.debug("User data successfully updated for VM ID: {}", vm); } else { throw new CloudRuntimeException("Failed to reset userdata for the virtual machine "); } @@ -3325,7 +3325,7 @@ private boolean updateUserDataInternal(UserVm vm) throws ResourceUnavailableExce List nics = _nicDao.listByVmId(vm.getId()); if (nics == null || nics.isEmpty()) { - logger.error("unable to find any nics for vm {}", vm); + logger.error("unable to find any NICs for VM {}", vm); return false; } @@ -3349,18 +3349,18 @@ protected boolean applyUserData(HypervisorType hyperVisorType, UserVm vm, Nic ni } boolean result = element.saveUserData(network, nicProfile, vmProfile); if (!result) { - logger.error("Failed to update userdata for vm " + vm + " and nic " + nic); + logger.error("Failed to update userdata for VM " + vm + " and NIC " + nic); } else { return true; } } else { - logger.debug("Not applying userdata for nic {} in vm {} because it is not supported in network {}", nic, vmProfile, network); + logger.debug("Not applying userdata for NIC {} in VM {} because it is not supported in network {}", nic, vmProfile, network); } return false; } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_START, eventDescription = "starting Vm", async = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_START, eventDescription = "starting VM", async = true) public UserVm startVirtualMachine(StartVMCmd cmd) throws ExecutionException, ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException { Map additonalParams = new HashMap<>(); if (cmd.getBootIntoSetup() != null) { @@ -3381,7 +3381,7 @@ public UserVm startVirtualMachine(StartVMCmd cmd) throws ExecutionException, Con } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_START, eventDescription = "starting Vm", async = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_START, eventDescription = "starting VM", async = true) public void startVirtualMachine(UserVm vm, DeploymentPlan plan) throws OperationTimedoutException, ResourceUnavailableException, InsufficientCapacityException { _itMgr.advanceStart(vm.getUuid(), null, plan, null); } @@ -3395,7 +3395,7 @@ public void startVirtualMachineForHA(VirtualMachine vm, Map nics = _nicDao.listByVmId(vmId); for (NicVO nic : nics) { Network network = _networkModel.getNetwork(nic.getNetworkId()); if (GuestType.L2.equals(network.getGuestType()) || _networkModel.isSharedNetworkWithoutServices(network.getId())) { - logger.debug("Adding vm " +vmId +" nic id "+ nic.getId() +" into vmIdCountMap as part of vm " + - "reboot for vm ip fetch "); + logger.debug("Adding VM " +vmId +" NIC ID "+ nic.getId() +" into vmIdCountMap as part of VM " + + "reboot for VM IP fetch "); vmIdCountMap.put(nic.getId(), new VmAndCountDetails(nic.getInstanceId(), VmIpFetchTrialMax.value())); } } @@ -3480,7 +3480,7 @@ protected void checkPluginsIfVmCanBeDestroyed(UserVm vm) { } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_DESTROY, eventDescription = "destroying Vm", async = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_DESTROY, eventDescription = "destroying VM", async = true) public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException { CallContext ctx = CallContext.current(); long vmId = cmd.getId(); @@ -3494,35 +3494,35 @@ public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, C UserVmVO vm = _vmDao.findById(vmId); if (vm == null || vm.getRemoved() != null) { - throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); + throw new InvalidParameterValueException("unable to find a virtual machine with ID " + vmId); } if (UserVmManager.SHAREDFSVM.equals(vm.getUserVmType())) { throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance"); } if (Arrays.asList(State.Destroyed, State.Expunging).contains(vm.getState()) && !expunge) { - logger.debug("Vm {} is already destroyed", vm); + logger.debug("VM {} is already destroyed", vm); return vm; } if (vm.isDeleteProtection()) { throw new InvalidParameterValueException(String.format( - "Instance [id = %s, name = %s] has delete protection enabled and cannot be deleted.", + "Instance [ID = %s, name = %s] has delete protection enabled and cannot be deleted.", vm.getUuid(), vm.getName())); } - // check if vm belongs to AutoScale vm group in Disabled state + // check if VM belongs to AutoScale VM group in Disabled state autoScaleManager.checkIfVmActionAllowed(vmId); - // check if vm belongs to any plugin resources + // check if VM belongs to any plugin resources checkPluginsIfVmCanBeDestroyed(vm); // check if there are active volume snapshots tasks logger.debug("Checking if there are any ongoing snapshots on the ROOT volumes associated with VM {}", vm); if (checkStatusOfVolumeSnapshots(vm, Volume.Type.ROOT)) { - throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, vm destroy is not permitted, please try again later."); + throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, VM destroy is not permitted, please try again later."); } - logger.debug("Found no ongoing snapshots on volume of type ROOT, for the vm {}", vm); + logger.debug("Found no ongoing snapshots on volume of type ROOT, for the VM {}", vm); List volumesToBeDeleted = getVolumesFromIds(cmd); @@ -3544,7 +3544,7 @@ public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, C UserVm destroyedVm = destroyVm(vmId, expunge); if (expunge && !expunge(vm)) { - throw new CloudRuntimeException("Failed to expunge vm " + destroyedVm); + throw new CloudRuntimeException("Failed to expunge VM " + destroyedVm); } autoScaleManager.removeVmFromVmGroup(vmId); @@ -3594,7 +3594,7 @@ public InstanceGroupVO createVmGroup(CreateVMGroupCmd cmd) { boolean isNameInUse = _vmGroupDao.isNameInUse(accountId, groupName); if (isNameInUse) { - throw new InvalidParameterValueException(String.format("Unable to create vm group, a group with name %s already exists for account %s", groupName, owner)); + throw new InvalidParameterValueException(String.format("Unable to create VM group, a group with name %s already exists for account %s", groupName, owner)); } return createVmGroup(groupName, accountId); @@ -3606,7 +3606,7 @@ private InstanceGroupVO createVmGroup(String groupName, long accountId) { try { account = _accountDao.acquireInLockTable(accountId); // to ensure // duplicate - // vm group + // VM group // names are // not // created. @@ -3635,7 +3635,7 @@ public boolean deleteVmGroup(DeleteVMGroupCmd cmd) { // Verify input parameters InstanceGroupVO group = _vmGroupDao.findById(groupId); if ((group == null) || (group.getRemoved() != null)) { - throw new InvalidParameterValueException("unable to find a vm group with id " + groupId); + throw new InvalidParameterValueException("unable to find a VM group with ID " + groupId); } _accountMgr.checkAccess(caller, null, true, group); @@ -3668,7 +3668,7 @@ public boolean addInstanceToGroup(final long userVmId, String groupName) { UserVmVO vm = _vmDao.findById(userVmId); InstanceGroupVO group = _vmGroupDao.findByAccountAndName(vm.getAccountId(), groupName); - // Create vm group if the group doesn't exist for this account + // Create VM group if the group doesn't exist for this account if (group == null) { group = createVmGroup(groupName, vm.getAccountId()); } @@ -3676,22 +3676,22 @@ public boolean addInstanceToGroup(final long userVmId, String groupName) { if (group != null) { UserVm userVm = _vmDao.acquireInLockTable(userVmId); if (userVm == null) { - logger.warn("Failed to acquire lock on user vm {} with id {}", vm, userVmId); + logger.warn("Failed to acquire lock on user VM {} with ID {}", vm, userVmId); } try { final InstanceGroupVO groupFinal = group; Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { - // don't let the group be deleted when we are assigning vm to + // don't let the group be deleted when we are assigning VM to // it. InstanceGroupVO ngrpLock = _vmGroupDao.lockRow(groupFinal.getId(), false); if (ngrpLock == null) { - logger.warn("Failed to acquire lock on vm group {}", groupFinal); - throw new CloudRuntimeException(String.format("Failed to acquire lock on vm group %s", groupFinal)); + logger.warn("Failed to acquire lock on VM group {}", groupFinal); + throw new CloudRuntimeException(String.format("Failed to acquire lock on VM group %s", groupFinal)); } - // Currently don't allow to assign a vm to more than one group + // Currently don't allow to assign a VM to more than one group if (_groupVMMapDao.listByInstanceId(userVmId) != null) { // Delete all mappings from group_vm_map table List groupVmMaps = _groupVMMapDao.listByInstanceId(userVmId); @@ -3719,8 +3719,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { @Override public InstanceGroupVO getGroupForVm(long vmId) { - // TODO - in future releases vm can be assigned to multiple groups; but - // currently return just one group per vm + // TODO - in future releases VM can be assigned to multiple groups; but + // currently return just one group per VM try { List groupsToVmMap = _groupVMMapDao.listByInstanceId(vmId); @@ -3731,7 +3731,7 @@ public InstanceGroupVO getGroupForVm(long vmId) { return null; } } catch (Exception e) { - logger.warn("Error trying to get group for a vm: ", e); + logger.warn("Error trying to get group for a VM: ", e); return null; } } @@ -3746,7 +3746,7 @@ public void removeInstanceFromInstanceGroup(long vmId) { _groupVMMapDao.expunge(sc); } } catch (Exception e) { - logger.warn("Error trying to remove vm from group: ", e); + logger.warn("Error trying to remove VM from group: ", e); } } @@ -3763,7 +3763,7 @@ private boolean validPassword(String password) { } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying VM", create = true) public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, List dataDiskInfoList, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, Long userDataId, String userDataDetails, List sshKeyPairs, Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List affinityGroupIdList, @@ -3774,7 +3774,7 @@ public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOff Account caller = CallContext.current().getCallingAccount(); List networkList = new ArrayList(); - // Verify that caller can perform actions in behalf of vm owner + // Verify that caller can perform actions in behalf of VM owner _accountMgr.checkAccess(caller, null, true, owner); // Verify that owner can use the service offering @@ -3785,7 +3785,7 @@ public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOff Network defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId()); if (defaultNetwork == null) { - throw new InvalidParameterValueException("Unable to find a default network to start a vm"); + throw new InvalidParameterValueException("Unable to find a default network to start a VM"); } else { networkList.add(_networkDao.findById(defaultNetwork.getId())); } @@ -3822,7 +3822,7 @@ public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOff } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying VM", create = true) public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, List securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, List dataDiskInfoList, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, Long userDataId, String userDataDetails, List sshKeyPairs, Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, @@ -3834,7 +3834,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service boolean isSecurityGroupEnabledNetworkUsed = false; boolean isVmWare = (template.getHypervisorType() == HypervisorType.VMware || (hypervisor != null && hypervisor == HypervisorType.VMware)); - // Verify that caller can perform actions in behalf of vm owner + // Verify that caller can perform actions in behalf of VM owner _accountMgr.checkAccess(caller, null, true, owner); // Verify that owner can use the service offering @@ -3845,7 +3845,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service if (networkIdList == null || networkIdList.isEmpty()) { Network networkWithSecurityGroup = _networkModel.getNetworkWithSGWithFreeIPs(owner, zone.getId()); if (networkWithSecurityGroup == null) { - throw new InvalidParameterValueException("No network with security enabled is found in zone id=" + zone.getUuid()); + throw new InvalidParameterValueException("No network with security enabled is found in zone ID=" + zone.getUuid()); } networkList.add(_networkDao.findById(networkWithSecurityGroup.getId())); @@ -3865,7 +3865,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service NetworkOffering ntwkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId()); if (network == null) { - throw new InvalidParameterValueException("Unable to find network by id " + networkId); + throw new InvalidParameterValueException("Unable to find network by ID " + networkId); } if (!_networkModel.isSecurityGroupSupportedInNetwork(network) && (ntwkOffering.getGuestType() != GuestType.L2)) { @@ -3884,7 +3884,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service NetworkVO network = _networkDao.findById(networkId); if (network == null) { - throw new InvalidParameterValueException("Unable to find network by id " + networkIdList.get(0).longValue()); + throw new InvalidParameterValueException("Unable to find network by ID " + networkIdList.get(0).longValue()); } boolean isSecurityGroupEnabled = _networkModel.isSecurityGroupSupportedInNetwork(network); @@ -3893,7 +3893,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service } if (network.getTrafficType() != TrafficType.Guest || !Arrays.asList(GuestType.Shared, GuestType.L2).contains(network.getGuestType())) { - throw new InvalidParameterValueException("Can specify only Shared or L2 Guest networks when deploy vm in Advance Security Group enabled zone"); + throw new InvalidParameterValueException("Can specify only Shared or L2 Guest networks when deploy VM in Advance Security Group enabled zone"); } _accountMgr.checkAccess(owner, AccessType.UseEntry, false, network); @@ -3934,7 +3934,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying VM", create = true) public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, List dataDiskInfoList, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, Long userDataId, String userDataDetails, List sshKeyPairs, Map requestedIps, IpAddresses defaultIps, Boolean displayvm, String keyboard, List affinityGroupIdList, @@ -3945,7 +3945,7 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv Account caller = CallContext.current().getCallingAccount(); List networkList = new ArrayList(); - // Verify that caller can perform actions in behalf of vm owner + // Verify that caller can perform actions in behalf of VM owner _accountMgr.checkAccess(caller, null, true, owner); // Verify that owner can use the service offering @@ -3964,17 +3964,17 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv for (Long networkId : networkIdList) { NetworkVO network = _networkDao.findById(networkId); if (network == null) { - throw new InvalidParameterValueException("Unable to find network by id " + networkIdList.get(0).longValue()); + throw new InvalidParameterValueException("Unable to find network by ID " + networkIdList.get(0).longValue()); } if (network.getVpcId() != null) { // Only ISOs, XenServer, KVM, and VmWare template types are - // supported for vpc networks + // supported for VPC networks if (template.getFormat() != ImageFormat.ISO && !vpcSupportedHTypes.contains(template.getHypervisorType())) { - throw new InvalidParameterValueException("Can't create vm from template with hypervisor " + template.getHypervisorType() + " in vpc network " + network); + throw new InvalidParameterValueException("Can't create VM from template with hypervisor " + template.getHypervisorType() + " in VPC network " + network); } else if (template.getFormat() == ImageFormat.ISO && !vpcSupportedHTypes.contains(hypervisor)) { // Only XenServer, KVM, and VMware hypervisors are supported - // for vpc networks - throw new InvalidParameterValueException("Can't create vm of hypervisor type " + hypervisor + " in vpc network"); + // for VPC networks + throw new InvalidParameterValueException("Can't create VM of hypervisor type " + hypervisor + " in VPC network"); } } @@ -3984,7 +3984,7 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv // don't allow to use system networks NetworkOffering networkOffering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); if (networkOffering.isSystemOnly()) { - throw new InvalidParameterValueException(String.format("Network id=%s is system only and can't be used for vm deployment", network.getUuid())); + throw new InvalidParameterValueException(String.format("Network ID=%s is system only and can't be used for VM deployment", network.getUuid())); } networkList.add(network); } @@ -3996,7 +3996,7 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm") + @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying VM") public UserVm finalizeCreateVirtualMachine(long vmId) { logger.info("Loading UserVm " + vmId + " from DB"); UserVm userVm = getUserVm(vmId); @@ -4012,17 +4012,17 @@ private NetworkVO getNetworkToAddToNetworkList(VirtualMachineTemplate template, List vpcSupportedHTypes, Long networkId) { NetworkVO network = _networkDao.findById(networkId); if (network == null) { - throw new InvalidParameterValueException("Unable to find network by id " + networkId); + throw new InvalidParameterValueException("Unable to find network by ID " + networkId); } if (network.getVpcId() != null) { // Only ISOs, XenServer, KVM, and VmWare template types are - // supported for vpc networks + // supported for VPC networks if (template.getFormat() != ImageFormat.ISO && !vpcSupportedHTypes.contains(template.getHypervisorType())) { - throw new InvalidParameterValueException("Can't create vm from template with hypervisor " + template.getHypervisorType() + " in vpc network " + network); + throw new InvalidParameterValueException("Can't create VM from template with hypervisor " + template.getHypervisorType() + " in VPC network " + network); } else if (template.getFormat() == ImageFormat.ISO && !vpcSupportedHTypes.contains(hypervisor)) { // Only XenServer, KVM, and VMware hypervisors are supported - // for vpc networks - throw new InvalidParameterValueException("Can't create vm of hypervisor type " + hypervisor + " in vpc network"); + // for VPC networks + throw new InvalidParameterValueException("Can't create VM of hypervisor type " + hypervisor + " in VPC network"); } } @@ -4031,7 +4031,7 @@ private NetworkVO getNetworkToAddToNetworkList(VirtualMachineTemplate template, // don't allow to use system networks NetworkOffering networkOffering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); if (networkOffering.isSystemOnly()) { - throw new InvalidParameterValueException(String.format("Network id=%s is system only and can't be used for vm deployment", network.getUuid())); + throw new InvalidParameterValueException(String.format("Network ID=%s is system only and can't be used for VM deployment", network.getUuid())); } return network; } @@ -4050,7 +4050,7 @@ private NetworkVO getDefaultNetwork(DataCenter zone, Account owner, boolean sele List requiredOfferings = _networkOfferingDao.listByAvailability(Availability.Required, false); if (requiredOfferings.size() < 1) { throw new InvalidParameterValueException("Unable to find network offering with availability=" + Availability.Required - + " to automatically create the network as a part of vm creation"); + + " to automatically create the network as a part of VM creation"); } if (requiredOfferings.get(0).getState() == NetworkOffering.State.Enabled) { @@ -4080,7 +4080,7 @@ private NetworkVO createDefaultNetworkForAccount(DataCenter zone, Account owner, // Validate physical network PhysicalNetwork physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId); if (physicalNetwork == null) { - throw new InvalidParameterValueException("Unable to find physical network with id: " + physicalNetworkId + " and tag: " + throw new InvalidParameterValueException("Unable to find physical network with ID: " + physicalNetworkId + " and tag: " + requiredOfferings.get(0).getTags()); } logger.debug("Creating network for account {} from the network offering {} as a part of deployVM process", owner, requiredOfferings.get(0)); @@ -4105,7 +4105,7 @@ private void verifyExtraDhcpOptionsNetwork(Map> dhc } if (!networkFound) { - throw new InvalidParameterValueException("VM does not has a nic in the Network (" + networkUuid + ") that is specified in the extra dhcp options."); + throw new InvalidParameterValueException("VM does not have a NIC in the Network (" + networkUuid + ") that is specified in the extra DHCP options."); } } } @@ -4113,7 +4113,7 @@ private void verifyExtraDhcpOptionsNetwork(Map> dhc public void checkNameForRFCCompliance(String name) { if (!NetUtils.verifyDomainNameLabel(name, true)) { - throw new InvalidParameterValueException("Invalid name. Vm name can contain ASCII letters 'a' through 'z', the digits '0' through '9', " + throw new InvalidParameterValueException("Invalid name. VM name can contain ASCII letters 'a' through 'z', the digits '0' through '9', " + "and the hyphen ('-'), must be between 1 and 63 characters long, and can't start or end with \"-\" and can't start with digit"); } } @@ -4130,7 +4130,7 @@ private UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffe _accountMgr.checkAccess(caller, null, true, owner); if (owner.getState() == Account.State.DISABLED) { - throw new PermissionDeniedException("The owner of vm to deploy is disabled: " + owner); + throw new PermissionDeniedException("The owner of VM to deploy is disabled: " + owner); } VMTemplateVO template = _templateDao.findByIdIncludingRemoved(tmplt.getId()); if (template != null) { @@ -4169,7 +4169,7 @@ private UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffe } // check that caller can operate with domain _configMgr.checkZoneAccess(caller, zone); - // check that vm owner can create vm in the domain + // check that VM owner can create VM in the domain _configMgr.checkZoneAccess(owner, zone); } @@ -4182,7 +4182,7 @@ private UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffe } else { validateOfferingMaxResource(offering); } - // check if account/domain is with in resource limits to create a new vm + // check if account/domain is with in resource limits to create a new VM boolean isIso = Storage.ImageFormat.ISO == template.getFormat(); Long rootDiskOfferingId = offering.getDiskOfferingId(); @@ -4306,12 +4306,12 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri try { checkedReservations = reserveStorageResourcesForVm(owner, diskOfferingId, diskSize, dataDiskInfoList, rootDiskOfferingId, offering, volumesSize); - // verify security group ids + // verify security group IDs if (securityGroupIdList != null) { for (Long securityGroupId : securityGroupIdList) { SecurityGroup sg = _securityGroupDao.findById(securityGroupId); if (sg == null) { - throw new InvalidParameterValueException("Unable to find security group by id " + securityGroupId); + throw new InvalidParameterValueException("Unable to find security group by ID " + securityGroupId); } else { // verify permissions _accountMgr.checkAccess(caller, null, true, owner, sg); @@ -4326,7 +4326,7 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri if (dataDiskTemplate == null || (!dataDiskTemplate.getTemplateType().equals(TemplateType.DATADISK)) && (dataDiskTemplate.getState().equals(VirtualMachineTemplate.State.Active))) { - throw new InvalidParameterValueException("Invalid template id specified for Datadisk template" + datadiskTemplateToDiskOffering.getKey()); + throw new InvalidParameterValueException("Invalid template ID specified for Datadisk template" + datadiskTemplateToDiskOffering.getKey()); } long dataDiskTemplateId = datadiskTemplateToDiskOffering.getKey(); if (!dataDiskTemplate.getParentTemplateId().equals(template.getId())) { @@ -4383,15 +4383,15 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri } if (hypervisorType != HypervisorType.BareMetal && hypervisorType != HypervisorType.External) { - // check if we have available pools for vm deployment + // check if we have available pools for VM deployment long availablePools = _storagePoolDao.countPoolsByStatus(StoragePoolStatus.Up); if (availablePools < 1) { - throw new StorageUnavailableException("There are no available pools in the UP state for vm deployment", -1); + throw new StorageUnavailableException("There are no available pools in the UP state for VM deployment", -1); } } if (template.getTemplateType().equals(TemplateType.SYSTEM) && !CKS_NODE.equals(vmType) && !SHAREDFSVM.equals(vmType)) { - throw new InvalidParameterValueException(String.format("Unable to use system template %s to deploy a user vm", template)); + throw new InvalidParameterValueException(String.format("Unable to use system template %s to deploy a user VM", template)); } if (volume != null) { @@ -4472,7 +4472,7 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri profile.setOrderIndex(networkIndex); if (defaultNetworkNumber == 0) { defaultNetworkNumber++; - // if user requested specific ip for default network, add it + // if user requested specific IP for default network, add it if (defaultIps.getIp4Address() != null || defaultIps.getIp6Address() != null) { _networkModel.checkRequestedIpAddresses(network.getId(), defaultIps); profile = new NicProfile(defaultIps.getIp4Address(), defaultIps.getIp6Address()); @@ -4509,18 +4509,18 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri } if (securityGroupIdList != null && !securityGroupIdList.isEmpty() && !securityGroupEnabled) { - throw new InvalidParameterValueException("Unable to deploy vm with security groups as SecurityGroup service is not enabled for the vm's network"); + throw new InvalidParameterValueException("Unable to deploy VM with security groups as SecurityGroup service is not enabled for the VM's network"); } // Verify network information - network default network has to be set; - // and vm can't have more than one default network + // and VM can't have more than one default network // This is a part of business logic because default network is required // by Agent Manager in order to configure default - // gateway for the vm + // gateway for the VM if (defaultNetworkNumber == 0) { - throw new InvalidParameterValueException("At least 1 default network has to be specified for the vm"); + throw new InvalidParameterValueException("At least 1 default network has to be specified for the VM"); } else if (defaultNetworkNumber > 1) { - throw new InvalidParameterValueException("Only 1 default network per vm is supported"); + throw new InvalidParameterValueException("Only 1 default network per VM is supported"); } long id = _vmDao.getNextInSequence(Long.class, "id"); @@ -4613,11 +4613,11 @@ private void assignInstanceToGroup(String group, long id) { if (group != null) { boolean addToGroup = addInstanceToGroup(Long.valueOf(id), group); if (!addToGroup) { - throw new CloudRuntimeException("Unable to assign Vm to the group " + group); + throw new CloudRuntimeException("Unable to assign VM to the group " + group); } } } catch (Exception ex) { - throw new CloudRuntimeException("Unable to assign Vm to the group " + group); + throw new CloudRuntimeException("Unable to assign VM to the group " + group); } } @@ -4772,7 +4772,7 @@ private void checkIfHostNameUniqueInNtwkDomain(String hostName, List List hostNames = _vmInstanceDao.listDistinctHostNames(ntwkId); // * verify that there are no duplicates if (hostNames.contains(hostName)) { - throw new InvalidParameterValueException("The vm with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network=" + throw new InvalidParameterValueException("The VM with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network=" + ((_networkModel.getNetwork(ntwkId) != null) ? _networkModel.getNetwork(ntwkId).getName() : "")); } } @@ -4832,7 +4832,7 @@ private UserVmVO commitUserVm(final boolean isImport, final DataCenter zone, fin VMTemplateVO templateVO = _templateDao.findById(template.getId()); if (templateVO == null) { - InvalidParameterValueException ipve = new InvalidParameterValueException("Unable to look up template by id " + template.getId()); + InvalidParameterValueException ipve = new InvalidParameterValueException("Unable to look up template by ID " + template.getId()); ipve.add(VirtualMachine.class, vm.getUuid()); throw ipve; } @@ -4895,7 +4895,7 @@ private UserVmVO commitUserVm(final boolean isImport, final DataCenter zone, fin } _vmDao.saveDetails(vm, hiddenDetails); if (!isImport) { - logger.debug("Allocating in the DB for vm"); + logger.debug("Allocating in the DB for VM"); DataCenterDeployment plan = new DataCenterDeployment(zone.getId()); List computeTags = new ArrayList(); @@ -4910,7 +4910,7 @@ private UserVmVO commitUserVm(final boolean isImport, final DataCenter zone, fin rootDiskOfferingId, dataDiskInfoList, volume, snapshot); } - CallContext.current().setEventDetails("Vm Id: " + vm.getUuid()); + CallContext.current().setEventDetails("VM ID: " + vm.getUuid()); if (!isImport) { if (!offering.isDynamic()) { @@ -5032,7 +5032,7 @@ private void updateVMDiskController(UserVmVO vm, Map customParam } /** - * take the properties and set them on the vm. + * take the properties and set them on the VM. * consider should we be complete, and make sure all default values are copied as well if known? * I.E. iterate over the template details as well to copy any that are not defined yet. */ @@ -5130,7 +5130,7 @@ public void collectVmNetworkStatistics (final UserVm userVm) { if (!userVm.getHypervisorType().equals(HypervisorType.KVM)) { return; } - logger.debug("Collect vm network statistics from host before stopping Vm"); + logger.debug("Collect VM network statistics from host before stopping VM"); long hostId = userVm.getHostId(); List vmNames = new ArrayList(); vmNames.add(userVm.getInstanceName()); @@ -5141,12 +5141,12 @@ public void collectVmNetworkStatistics (final UserVm userVm) { try { networkStatsAnswer = (GetVmNetworkStatsAnswer) _agentMgr.easySend(hostId, new GetVmNetworkStatsCommand(vmNames, host.getGuid(), host.getName())); } catch (Exception e) { - logger.warn("Error while collecting network stats for vm: {} from host: {}", userVm, host, e); + logger.warn("Error while collecting network stats for VM: {} from host: {}", userVm, host, e); return; } if (networkStatsAnswer != null) { if (!networkStatsAnswer.getResult()) { - logger.warn("Error while collecting network stats vm: {} from host: {}; details: {}", userVm, host, networkStatsAnswer.getDetails()); + logger.warn("Error while collecting network stats VM: {} from host: {}; details: {}", userVm, host, networkStatsAnswer.getDetails()); return; } try { @@ -5185,14 +5185,14 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } if (vmNetworkStat_lock == null) { - logger.warn("unable to find vm network stats from host for account: {} with vm: {} and nic: {}", account, userVm, nic); + logger.warn("unable to find VM network stats from host for account: {} with VM: {} and NIC: {}", account, userVm, nic); continue; } if (previousvmNetworkStats != null && ((previousvmNetworkStats.getCurrentBytesSent() != vmNetworkStat_lock.getCurrentBytesSent()) || (previousvmNetworkStats.getCurrentBytesReceived() != vmNetworkStat_lock.getCurrentBytesReceived()))) { - logger.debug("vm network stats changed from the time GetNmNetworkStatsCommand was sent. " + + logger.debug("VM network stats changed from the time GetNmNetworkStatsCommand was sent. " + "Ignoring current answer. Host: " + host + " . VM: " + vmNetworkStat.getVmName() + " Sent(Bytes): " + toHumanReadableSize(vmNetworkStat.getBytesSent()) + " Received(Bytes): " + toHumanReadableSize(vmNetworkStat.getBytesReceived())); continue; @@ -5227,13 +5227,13 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } }); } catch (Exception e) { - logger.warn("Unable to update vm network statistics for vm: {} from host: {}", userVm, host, e); + logger.warn("Unable to update VM network statistics for VM: {} from host: {}", userVm, host, e); } } } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", async = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying VM", async = true) public UserVm startVirtualMachine(DeployVMCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException { long vmId = cmd.getEntityId(); if (!cmd.getStartVm()) { @@ -5295,7 +5295,7 @@ private UserVm startVirtualMachine(long vmId, Long podId, Long clusterId, Long h } } catch (Exception e) { - logger.fatal("Unable to resize the data disk for vm {} due to {}", vm, e.getMessage(), e); + logger.fatal("Unable to resize the data disk for VM {} due to {}", vm, e.getMessage(), e); } } finally { @@ -5305,7 +5305,7 @@ private UserVm startVirtualMachine(long vmId, Long podId, Long clusterId, Long h // Check that the password was passed in and is valid VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId()); if (template.isEnablePassword()) { - // this value is not being sent to the backend; need only for api + // this value is not being sent to the backend; need only for API // display purposes vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword)); } @@ -5361,7 +5361,7 @@ public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, Depl if (CKS_NODE.equals(vm.getUserVmType()) || SHAREDFSVM.equals(vm.getUserVmType())) { addUserVMCmdlineArgs(vm.getId(), profile, dest, buf); } - // add userdata info into vm profile + // add userdata info into VM profile Nic defaultNic = _networkModel.getDefaultNic(vm.getId()); if(defaultNic != null) { Network network = _networkModel.getNetwork(defaultNic.getNetworkId()); @@ -5392,7 +5392,7 @@ public boolean setupVmForPvlan(boolean add, Long hostId, NicProfile nic) { } String op = "add"; if (!add) { - // "delete" would remove all the rules(if using ovs) related to this vm + // "delete" would remove all the rules(if using ovs) related to this VM op = "delete"; } Network network = _networkDao.findById(nic.getNetworkId()); @@ -5527,17 +5527,17 @@ public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Command userVm.setPrivateIpAddress(guestNic.getIPv4Address()); _vmDao.update(userVm.getId(), userVm); - logger.info("Detected that ip changed in the answer, updated nic in the db with new ip " + returnedIp); + logger.info("Detected that IP changed in the answer, updated NIC in the DB with new IP " + returnedIp); } } updateVncPasswordIfItHasChanged(originalVncPassword, returnedVncPassword, profile); - // get system ip and create static nat rule for the vm + // get system IP and create static nat rule for the VM try { _rulesMgr.getSystemIpAndEnableStaticNatForVm(profile.getVirtualMachine(), false); } catch (Exception ex) { - logger.warn("Failed to get system ip and enable static nat for the vm " + profile.getVirtualMachine() + " due to exception ", ex); + logger.warn("Failed to get system IP and enable static NAT for the VM " + profile.getVirtualMachine() + " due to exception ", ex); return false; } @@ -5545,7 +5545,7 @@ public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Command if (answer != null && answer instanceof RestoreVMSnapshotAnswer) { RestoreVMSnapshotAnswer restoreVMSnapshotAnswer = (RestoreVMSnapshotAnswer) answer; if (restoreVMSnapshotAnswer == null || !restoreVMSnapshotAnswer.getResult()) { - logger.warn("Unable to restore the vm snapshot from image file to the VM: " + restoreVMSnapshotAnswer.getDetails()); + logger.warn("Unable to restore the VM snapshot from image file to the VM: " + restoreVMSnapshotAnswer.getDetails()); } } @@ -5582,12 +5582,12 @@ public void finalizeExpunge(VirtualMachine vm) { private void checkForceStopVmPermission(Account callingAccount) { if (!AllowUserForceStopVm.valueIn(callingAccount.getId())) { logger.error("Parameter [{}] can only be passed by Admin accounts or when the allow.user.force.stop.vm config is true for the account.", ApiConstants.FORCED); - throw new PermissionDeniedException("Account does not have the permission to force stop the vm."); + throw new PermissionDeniedException("Account does not have the permission to force stop the VM."); } } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_STOP, eventDescription = "stopping Vm", async = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_STOP, eventDescription = "stopping VM", async = true) public UserVm stopVirtualMachine(long vmId, boolean forced) throws ConcurrentOperationException { // Input validation Account caller = CallContext.current().getCallingAccount(); @@ -5600,14 +5600,14 @@ public UserVm stopVirtualMachine(long vmId, boolean forced) throws ConcurrentOpe UserVmVO vm = _vmDao.findById(vmId); if (vm == null) { - throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); + throw new InvalidParameterValueException("unable to find a virtual machine with ID " + vmId); } if (forced) { checkForceStopVmPermission(caller); } - // check if vm belongs to AutoScale vm group in Disabled state + // check if VM belongs to AutoScale VM group in Disabled state autoScaleManager.checkIfVmActionAllowed(vmId); boolean status = false; @@ -5645,7 +5645,7 @@ public void finalizeStop(VirtualMachineProfile profile, Answer answer) { assert (offering.isAssociatePublicIP() == true) : "User VM should not have system owned public IP associated with it when offering configured not to associate public IP."; _rulesMgr.disableStaticNat(ip.getId(), ctx.getCallingAccount(), ctx.getCallingUserId(), true); } catch (Exception ex) { - logger.warn("Failed to disable static nat and release system ip " + ip + " as a part of vm " + profile.getVirtualMachine() + " stop due to exception ", ex); + logger.warn("Failed to disable static nat and release system IP " + ip + " as a part of VM " + profile.getVirtualMachine() + " stop due to exception ", ex); } } @@ -5689,7 +5689,7 @@ public Pair> startVirtualMach UserVmVO vm = _vmDao.findById(vmId); if (vm == null) { - throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); + throw new InvalidParameterValueException("unable to find a virtual machine with ID " + vmId); } if (vm.getState() == State.Running) { @@ -5710,16 +5710,16 @@ public Pair> startVirtualMach } VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId()); if (VirtualMachineManager.ResourceCountRunningVMsonly.value()) { - // check if account/domain is with in resource limits to start a new vm + // check if account/domain is with in resource limits to start a new VM ServiceOfferingVO offering = serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); resourceLimitService.checkVmResourceLimit(owner, vm.isDisplayVm(), offering, template); } - // check if vm is security group enabled + // check if VM is security group enabled if (_securityGroupMgr.isVmSecurityGroupEnabled(vmId) && _securityGroupMgr.getSecurityGroupsForVm(vmId).isEmpty() && !_securityGroupMgr.isVmMappedToDefaultSecurityGroup(vmId) && _networkModel.canAddDefaultSecurityGroup()) { - // if vm is not mapped to security group, create a mapping + // if VM is not mapped to security group, create a mapping if (logger.isDebugEnabled()) { - logger.debug("Vm " + vm + " is security group enabled, but not mapped to default security group; creating the mapping automatically"); + logger.debug("VM " + vm + " is security group enabled, but not mapped to default security group; creating the mapping automatically"); } SecurityGroup defaultSecurityGroup = _securityGroupMgr.getDefaultSecurityGroup(vm.getAccountId()); @@ -5788,7 +5788,7 @@ public Pair> startVirtualMach } // Check if an SSH key pair was selected for the instance and if so - // use it to encrypt & save the vm password + // use it to encrypt & save the VM password encryptAndStorePassword(vm, password); params = createParameterInParameterMap(params, additionalParams, VirtualMachineProfile.Param.VmPassword, password); @@ -5823,7 +5823,7 @@ public Pair> startVirtualMach Pair> vmParamPair = new Pair(vm, params); if (vm != null && vm.isUpdateParameters()) { - // this value is not being sent to the backend; need only for api + // this value is not being sent to the backend; need only for API // display purposes if (template.isEnablePassword()) { if (vm.getDetail(VmDetailConstants.PASSWORD) != null) { @@ -5897,7 +5897,7 @@ private Pod getDestinationPod(Long podId, boolean isRootAdmin) { } destinationPod = _podDao.findById(podId); if (destinationPod == null) { - throw new InvalidParameterValueException("Unable to find the pod to deploy the VM, pod id=" + podId); + throw new InvalidParameterValueException("Unable to find the pod to deploy the VM, pod ID=" + podId); } } return destinationPod; @@ -5912,7 +5912,7 @@ private Cluster getDestinationCluster(Long clusterId, boolean isRootAdmin) { } destinationCluster = _clusterDao.findById(clusterId); if (destinationCluster == null) { - throw new InvalidParameterValueException("Unable to find the cluster to deploy the VM, cluster id=" + clusterId); + throw new InvalidParameterValueException("Unable to find the cluster to deploy the VM, cluster ID=" + clusterId); } } return destinationCluster; @@ -5927,7 +5927,7 @@ private HostVO getDestinationHost(Long hostId, boolean isRootAdmin, boolean isEx } destinationHost = _hostDao.findById(hostId); if (destinationHost == null) { - throw new InvalidParameterValueException("Unable to find the host to deploy the VM, host id=" + hostId); + throw new InvalidParameterValueException("Unable to find the host to deploy the VM, host ID=" + hostId); } else if (destinationHost.getResourceState() != ResourceState.Enabled || destinationHost.getStatus() != Status.Up ) { throw new InvalidParameterValueException("Unable to deploy the VM as the host: " + destinationHost.getName() + " is not in the right state"); } @@ -5945,7 +5945,7 @@ public UserVm destroyVm(long vmId, boolean expunge) throws ResourceUnavailableEx } if (vm.getState() == State.Destroyed || vm.getState() == State.Expunging) { - logger.trace("Vm {} is already destroyed", vm); + logger.trace("VM {} is already destroyed", vm); return vm; } @@ -5991,12 +5991,12 @@ public UserVm destroyVm(long vmId, boolean expunge) throws ResourceUnavailableEx } return _vmDao.findById(vmId); } else { - CloudRuntimeException ex = new CloudRuntimeException("Failed to destroy vm with specified vmId"); + CloudRuntimeException ex = new CloudRuntimeException("Failed to destroy VM with specified vmId"); ex.addProxyObject(vm.getUuid(), "vmId"); throw ex; } } catch (Exception e) { - throw new CloudRuntimeException("Failed to destroy vm with specified vmId", e); + throw new CloudRuntimeException("Failed to destroy VM with specified vmId", e); } } @@ -6007,9 +6007,9 @@ public void collectVmDiskStatistics(final UserVm userVm) { if (!(userVm.getHypervisorType().equals(HypervisorType.KVM) || userVm.getHypervisorType().equals(HypervisorType.VMware))) { return; } - logger.debug("Collect vm disk statistics from host before stopping VM"); + logger.debug("Collect VM disk statistics from host before stopping VM"); if (userVm.getHostId() == null) { - logger.error("Unable to collect vm disk statistics for VM as the host is null, skipping VM disk statistics collection"); + logger.error("Unable to collect VM disk statistics for VM as the host is null, skipping VM disk statistics collection"); return; } long hostId = userVm.getHostId(); @@ -6022,12 +6022,12 @@ public void collectVmDiskStatistics(final UserVm userVm) { try { diskStatsAnswer = (GetVmDiskStatsAnswer)_agentMgr.easySend(hostId, new GetVmDiskStatsCommand(vmNames, host.getGuid(), host.getName())); } catch (Exception e) { - logger.warn("Error while collecting disk stats for vm: {} from host: {}", userVm, host, e); + logger.warn("Error while collecting disk stats for VM: {} from host: {}", userVm, host, e); return; } if (diskStatsAnswer != null) { if (!diskStatsAnswer.getResult()) { - logger.warn("Error while collecting disk stats vm: {} from host: {}; details: {}", userVm, host, diskStatsAnswer.getDetails()); + logger.warn("Error while collecting disk stats VM: {} from host: {}; details: {}", userVm, host, diskStatsAnswer.getDetails()); return; } try { @@ -6061,7 +6061,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } if (vmDiskStat_lock == null) { - logger.warn("unable to find vm disk stats from host for account: {} with vm: {} and volume: {}", account, userVm, volume); + logger.warn("unable to find VM disk stats from host for account: {} with VM: {} and volume: {}", account, userVm, volume); continue; } @@ -6070,7 +6070,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { .getCurrentIOWrite()) || (previousVmDiskStats.getCurrentBytesRead() != vmDiskStat_lock.getCurrentBytesRead()) || (previousVmDiskStats .getCurrentBytesWrite() != vmDiskStat_lock.getCurrentBytesWrite())))) { - logger.debug("vm disk stats changed from the time" + + logger.debug("VM disk stats changed from the time" + " GetVmDiskStatsCommand was sent. Ignoring current " + "answer. Host: {} . VM: {} IO Read: {} IO Write: {} " + "Bytes Read: {} Bytes Write: {}", @@ -6141,7 +6141,7 @@ host, vmDiskStat, toHumanReadableSize(vmDiskStat.getBytesWrite()), } @Override - @ActionEvent(eventType = EventTypes.EVENT_VM_EXPUNGE, eventDescription = "expunging Vm", async = true) + @ActionEvent(eventType = EventTypes.EVENT_VM_EXPUNGE, eventDescription = "expunging VM", async = true) public UserVm expungeVm(long vmId) throws ResourceUnavailableException, ConcurrentOperationException { Account caller = CallContext.current().getCallingAccount(); Long callerId = caller.getId(); @@ -6158,22 +6158,22 @@ public UserVm expungeVm(long vmId) throws ResourceUnavailableException, Concurre } if (vm.getRemoved() != null) { - logger.trace("Vm {} is already expunged", vm); + logger.trace("VM {} is already expunged", vm); return vm; } if (!(vm.getState() == State.Destroyed || vm.getState() == State.Expunging || vm.getState() == State.Error)) { - CloudRuntimeException ex = new CloudRuntimeException("Please destroy vm with specified vmId before expunge"); + CloudRuntimeException ex = new CloudRuntimeException("Please destroy VM with specified vmId before expunge"); ex.addProxyObject(String.valueOf(vmId), "vmId"); throw ex; } // When trying to expunge, permission is denied when the caller is not an admin and the AllowUserExpungeRecoverVm is false for the caller. if (!_accountMgr.isAdmin(callerId) && !AllowUserExpungeRecoverVm.valueIn(callerId)) { - throw new PermissionDeniedException("Expunging a vm can only be done by an Admin. Or when the allow.user.expunge.recover.vm key is set."); + throw new PermissionDeniedException("Expunging a VM can only be done by an Admin. Or when the allow.user.expunge.recover.vm key is set."); } - // check if vm belongs to AutoScale vm group in Disabled state + // check if VM belongs to AutoScale VM group in Disabled state autoScaleManager.checkIfVmActionAllowed(vmId); _vmSnapshotMgr.deleteVMSnapshotsFromDB(vmId, false); @@ -6184,7 +6184,7 @@ public UserVm expungeVm(long vmId) throws ResourceUnavailableException, Concurre if (status) { return _vmDao.findByIdIncludingRemoved(vmId); } else { - CloudRuntimeException ex = new CloudRuntimeException("Failed to expunge vm with specified vmId"); + CloudRuntimeException ex = new CloudRuntimeException("Failed to expunge VM with specified vmId"); ex.addProxyObject(String.valueOf(vmId), "vmId"); throw ex; } @@ -6268,7 +6268,7 @@ private void verifyServiceOffering(BaseDeployVMCmd cmd, ServiceOffering serviceO Long overrideDiskOfferingId = cmd.getOverrideDiskOfferingId(); if (serviceOffering.getDiskOfferingStrictness() && overrideDiskOfferingId != null) { - throw new InvalidParameterValueException(String.format("Cannot override disk offering id %d since provided service offering is strictly mapped to its disk offering", overrideDiskOfferingId)); + throw new InvalidParameterValueException(String.format("Cannot override disk offering ID %d since provided service offering is strictly mapped to its disk offering", overrideDiskOfferingId)); } if (!serviceOffering.isDynamic()) { @@ -6479,7 +6479,7 @@ private UserVm createVirtualMachine(BaseDeployVMCmd cmd, DataCenter zone, Accoun } else { if (cmd.getSecurityGroupIdList() != null && !cmd.getSecurityGroupIdList().isEmpty()) { - throw new InvalidParameterValueException("Can't create vm with security groups; security group feature is not enabled per zone"); + throw new InvalidParameterValueException("Can't create VM with security groups; security group feature is not enabled per zone"); } vm = createAdvancedVirtualMachine(zone, serviceOffering, template, networkIds, owner, name, displayName, diskOfferingId, size, dataDiskInfoList, group, hypervisor, cmd.getHttpMethod(), userData, userDataId, userDataDetails, sshKeyPairNames, ipToNetworkMap, addrs, displayVm, keyboard, cmd.getAffinityGroupIdList(), cmd.getDetails(), @@ -6503,7 +6503,7 @@ private UserVm createVirtualMachine(BaseDeployVMCmd cmd, DataCenter zone, Accoun String extraConfig = cmd.getExtraConfig(); if (StringUtils.isNotBlank(extraConfig)) { if (EnableAdditionalVmConfig.valueIn(callerId)) { - logger.info("Adding extra configuration to user vm: {}", vm); + logger.info("Adding extra configuration to user VM: {}", vm); addExtraConfig(vm, extraConfig); } else { throw new InvalidParameterValueException("attempted setting extraconfig but enable.additional.vm.configuration is disabled"); @@ -6685,7 +6685,7 @@ protected void persistExtraConfigVmware(String decodedUrl, UserVm vm) { * persists config as key/value pair e.g key = extraconfig-1 , value="PV-bootloader=pygrub" and so on to extraconfig-N where * N denotes the number of extra configuration settings passed by user * - * @param decodedUrl A string containing extra configuration settings as key/value pairs seprated by newline escape character + * @param decodedUrl A string containing extra configuration settings as key/value pairs separated by newline escape character * e.x PV-bootloader=pygrub\nPV-args=console\nHV-Boot-policy="" */ protected void persistExtraConfigXenServer(String decodedUrl, UserVm vm) { @@ -6994,11 +6994,11 @@ private VMInstanceVO preVmStorageMigrationCheck(Long vmId) { VMInstanceVO vm = _vmInstanceDao.findById(vmId); if (vm == null) { - throw new InvalidParameterValueException("Unable to find the VM by id=" + vmId); + throw new InvalidParameterValueException("Unable to find the VM by ID=" + vmId); } if (vm.getState() != State.Stopped) { - InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Stopped, unable to migrate the vm having the specified id"); + InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Stopped, unable to migrate the vm having the specified ID"); ex.addProxyObject(vm.getUuid(), "vmId"); throw ex; } @@ -7015,10 +7015,10 @@ private VMInstanceVO preVmStorageMigrationCheck(Long vmId) { List vols = _volsDao.findByInstance(vm.getId()); if (vols.size() > 1 && !(HypervisorType.VMware.equals(hypervisorType) || HypervisorType.KVM.equals(hypervisorType))) { - throw new InvalidParameterValueException("Data disks attached to the vm, can not migrate. Need to detach data disks first"); + throw new InvalidParameterValueException("Data disks attached to the VM, can not migrate. Need to detach data disks first"); } - // Check that Vm does not have VM Snapshots + // Check that VM does not have VM Snapshots if (_vmSnapshotDao.findByVm(vmId).size() > 0) { throw new InvalidParameterValueException("VM's disk cannot be migrated, please remove all the VM Snapshots for this VM"); } @@ -7111,7 +7111,7 @@ private void checkDestinationHypervisorType(StoragePool destPool, VMInstanceVO v } if (vm.getHypervisorType() != destHypervisorType && destHypervisorType != HypervisorType.Any) { - throw new InvalidParameterValueException("hypervisor is not compatible: dest: " + destHypervisorType.toString() + ", vm: " + vm.getHypervisorType().toString()); + throw new InvalidParameterValueException("hypervisor is not compatible: dest: " + destHypervisorType.toString() + ", VM: " + vm.getHypervisorType().toString()); } } @@ -7136,14 +7136,14 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) thr VMInstanceVO vm = _vmInstanceDao.findById(vmId); if (vm == null) { - throw new InvalidParameterValueException("Unable to find the VM by id=" + vmId); + throw new InvalidParameterValueException("Unable to find the VM by ID=" + vmId); } // business logic if (vm.getState() != State.Running) { if (logger.isDebugEnabled()) { - logger.debug("VM is not Running, unable to migrate the vm " + vm); + logger.debug("VM is not Running, unable to migrate the VM " + vm); } - InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Running, unable to migrate the vm with specified id"); + InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Running, unable to migrate the vm with specified ID"); ex.addProxyObject(vm.getUuid(), "vmId"); throw ex; } @@ -7172,7 +7172,7 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) thr long srcHostId = vm.getHostId(); Host srcHost = _resourceMgr.getHost(srcHostId); if (srcHost == null) { - throw new InvalidParameterValueException("Cannot migrate VM, host with id: " + srcHostId + " for VM not found"); + throw new InvalidParameterValueException("Cannot migrate VM, host with ID: " + srcHostId + " for VM not found"); } DeployDestination dest = null; @@ -7193,7 +7193,7 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) thr } private DeployDestination chooseVmMigrationDestination(VMInstanceVO vm, Host srcHost, Long poolId) { - vm.setLastHostId(null); // Last host does not have higher priority in vm migration + vm.setLastHostId(null); // Last host does not have higher priority in VM migration final ServiceOfferingVO offering = serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm, null, offering, null, null); final Long srcHostId = srcHost.getId(); @@ -7207,7 +7207,7 @@ private DeployDestination chooseVmMigrationDestination(VMInstanceVO vm, Host src logger.warn("Unable to create deployment, affinity rules associated to the VM conflict", e2); throw new CloudRuntimeException("Unable to create deployment, affinity rules associated to the VM conflict"); } catch (final InsufficientServerCapacityException e3) { - throw new CloudRuntimeException("Unable to find a server to migrate the vm to"); + throw new CloudRuntimeException("Unable to find a server to migrate the VM to"); } } @@ -7294,7 +7294,7 @@ private DeployDestination checkVmMigrationDestination(VMInstanceVO vm, Host srcH Cluster cluster = _clusterDao.findById(destinationHost.getClusterId()); DeployDestination dest = new DeployDestination(dcVO, pod, cluster, destinationHost); - // check max guest vm limit for the destinationHost + // check max guest VM limit for the destinationHost if (_capacityMgr.checkIfHostReachMaxGuestLimit(destinationHostVO)) { if (logger.isDebugEnabled()) { logger.debug("Host: {} already has max Running VMs(count includes system VMs), cannot migrate to this host", destinationHost); @@ -7307,7 +7307,7 @@ private DeployDestination checkVmMigrationDestination(VMInstanceVO vm, Host srcH if (checkStatusOfVolumeSnapshots(vm, null)) { throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on volume(s) attached to this VM, VM Migration is not permitted, please try again later."); } - logger.debug("Found no ongoing snapshots on volumes associated with the vm {}", vm); + logger.debug("Found no ongoing snapshots on volumes associated with the VM {}", vm); return dest; } @@ -7430,19 +7430,19 @@ public void checkHostsDedication(VMInstanceVO vm, long srcHostId, long destHostI } if (!emptyDestination) { - //Check if vm is deployed using strict implicit planner + //Check if VM is deployed using strict implicit planner if (!isServiceOfferingUsingPlannerInPreferredMode(vm.getServiceOfferingId())) { - //Check if all vms on destination host are created using strict implicit mode + //Check if all VMs on destination host are created using strict implicit mode if (!checkIfAllVmsCreatedInStrictMode(accountOfVm, vmsOnDest)) { - msg = String.format("VM of account %d with strict implicit deployment planner being migrated to host %s not having all vms strict implicitly dedicated to account %d", accountOfVm, destHost, accountOfVm); + msg = String.format("VM of account %d with strict implicit deployment planner being migrated to host %s not having all VMs strict implicitly dedicated to account %d", accountOfVm, destHost, accountOfVm); } } else { - //If vm is deployed using preferred implicit planner, check if all vms on destination host must be + //If VM is deployed using preferred implicit planner, check if all VMs on destination host must be //using implicit planner and must belong to same account for (VMInstanceVO vmsDest : vmsOnDest) { ServiceOfferingVO destPlanner = serviceOfferingDao.findById(vm.getId(), vmsDest.getServiceOfferingId()); if (!((destPlanner.getDeploymentPlanner() != null && destPlanner.getDeploymentPlanner().equals("ImplicitDedicationPlanner")) && vmsDest.getAccountId() == accountOfVm)) { - msg = String.format("VM of account %d with preffered implicit deployment planner being migrated to host %s not having all vms implicitly dedicated to account %d", accountOfVm, destHost, accountOfVm); + msg = String.format("VM of account %d with preffered implicit deployment planner being migrated to host %s not having all VMs implicitly dedicated to account %d", accountOfVm, destHost, accountOfVm); } } } @@ -7517,12 +7517,12 @@ private boolean checkIfAllVmsCreatedInStrictMode(Long accountId, List getHostsForMigrateVmWithStorage(VMInstanceVO vm, Host d destinationHost.getName(), destinationHost.getUuid(), destinationHost.getState(), destinationHost.getResourceState())); } - // Check max guest vm limit for the destinationHost. + // Check max guest VM limit for the destinationHost. if (_capacityMgr.checkIfHostReachMaxGuestLimit(destinationHost)) { - throw new VirtualMachineMigrationException(String.format("Cannot migrate VM as destination host %s (ID: %s) already has max running vms (count includes system VMs)", + throw new VirtualMachineMigrationException(String.format("Cannot migrate VM as destination host %s (ID: %s) already has max running VMs (count includes system VMs)", destinationHost.getName(), destinationHost.getUuid())); } @@ -7671,14 +7671,14 @@ private Map getVolumePoolMappingForMigrateVmWithStorage(VMInstanceVO VolumeVO volume = _volsDao.findByUuid(entry.getKey()); StoragePoolVO pool = _storagePoolDao.findByUuid(entry.getValue()); if (volume == null) { - throw new InvalidParameterValueException("There is no volume present with the given id " + entry.getKey()); + throw new InvalidParameterValueException("There is no volume present with the given ID " + entry.getKey()); } else if (pool == null) { - throw new InvalidParameterValueException("There is no storage pool present with the given id " + entry.getValue()); + throw new InvalidParameterValueException("There is no storage pool present with the given ID " + entry.getValue()); } else if (pool.isInMaintenance()) { throw new InvalidParameterValueException("Cannot migrate volume " + volume + "to the destination storage pool " + pool.getName() + " as the storage pool is in maintenance mode."); } else { - // Verify the volume given belongs to the vm. + // Verify the volume given belongs to the VM. if (!vmVolumes.contains(volume)) { throw new InvalidParameterValueException(String.format("Volume " + volume + " doesn't belong to the VM %s (ID: %s) that has to be migrated", vm.getInstanceName(), vm.getUuid())); } @@ -7756,7 +7756,7 @@ public VirtualMachine migrateVirtualMachineWithVolume(Long vmId, Host destinatio if (vm.getState() != State.Running) { // OfflineVmwareMigration: and not vmware if (logger.isDebugEnabled()) { - logger.debug("VM is not Running, unable to migrate the vm " + vm); + logger.debug("VM is not Running, unable to migrate the VM " + vm); } CloudRuntimeException ex = new CloudRuntimeException(String.format("Unable to migrate the VM %s (ID: %s) as it is not in Running state", vm.getInstanceName(), vm.getUuid())); ex.addProxyObject(vm.getUuid(), "vmId"); @@ -7871,7 +7871,6 @@ public UserVm moveVmToUser(final AssignVMCmd cmd) throws ResourceAllocationExcep } validateIfVmHasNoRules(vm, vmId); - final List volumes = _volsDao.findByInstance(vmId); validateIfVolumesHaveNoSnapshots(volumes); @@ -7946,7 +7945,7 @@ protected void validateIfVmHasNoRules(UserVmVO vm, Long vmId) throws InvalidPara List ips = _ipAddressDao.findAllByAssociatedVmId(vmId); for (IPAddressVO ip : ips) { if (ip.isOneToOneNat()) { - throw new InvalidParameterValueException(String.format("Remove the One to One Nat rule for VM [%s] for IP [%s].", vm, ip)); + throw new InvalidParameterValueException(String.format("Remove the One to One NAT rule for VM [%s] for IP [%s].", vm, ip)); } } } @@ -8643,7 +8642,6 @@ protected NetworkVO createApplicableNetworkToCreateVm(Account newAccount, DataCe long requiredOfferingId = requiredOffering.getId(); logger.debug("Creating network for account [{}] from the network offering [{}] as a part of VM deployment process.", newAccount, requiredOfferingId); - String networkName = String.format("%s-network", newAccount.getAccountName()); Network newNetwork = _networkMgr.createGuestNetwork(requiredOfferingId, networkName, networkName, null, null, null, false, null, newAccount, null, physicalNetwork, zoneId, ACLType.Account, null, null, null, null, true, null, @@ -8776,7 +8774,7 @@ public UserVm restoreVM(RestoreVMCmd cmd) throws InsufficientCapacityException, if (checkStatusOfVolumeSnapshots(vm, Volume.Type.ROOT)) { throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, Re-install VM is not permitted, please try again later."); } - logger.debug("Found no ongoing snapshots on volume of type ROOT, for the vm {}", vm); + logger.debug("Found no ongoing snapshots on volume of type ROOT, for the VM {}", vm); return restoreVMInternal(caller, vm, newTemplateId, rootDiskOfferingId, expunge, details); } @@ -8796,11 +8794,11 @@ private VMTemplateVO getRestoreVirtualMachineTemplate(Account caller, Long newTe Long templateId = root.getTemplateId(); boolean isISO = false; if (templateId == null) { - // Assuming that for a vm deployed using ISO, template ID is set to NULL + // Assuming that for a VM deployed using ISO, template ID is set to NULL isISO = true; templateId = vm.getIsoId(); } - //newTemplateId can be either template or ISO id. In the following snippet based on the vm deployment (from template or ISO) it is handled accordingly + //newTemplateId can be either template or ISO ID. In the following snippet based on the VM deployment (from template or ISO) it is handled accordingly if (newTemplateId != null) { template = _templateDao.findById(newTemplateId); _accountMgr.checkAccess(caller, null, true, template); @@ -8810,7 +8808,7 @@ private VMTemplateVO getRestoreVirtualMachineTemplate(Account caller, Long newTe } } else { if (template.getFormat().equals(ImageFormat.ISO)) { - throw new InvalidParameterValueException("Invalid template id provided to restore the VM "); + throw new InvalidParameterValueException("Invalid template ID provided to restore the VM "); } } } else { @@ -8850,7 +8848,7 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final } if (vm.getState() != VirtualMachine.State.Running && vm.getState() != VirtualMachine.State.Stopped) { - throw new CloudRuntimeException("Vm " + vm.getUuid() + " currently in " + vm.getState() + " state, restore vm can only execute when VM in Running or Stopped"); + throw new CloudRuntimeException("VM " + vm.getUuid() + " currently in " + vm.getState() + " state, restore VM can only execute when VM in Running or Stopped"); } if (vm.getState() == VirtualMachine.State.Running) { @@ -8890,7 +8888,7 @@ public UserVm restoreVirtualMachine(final Account caller, final long vmId, final _itMgr.stop(vm.getUuid()); } catch (ResourceUnavailableException e) { logger.debug("Stop vm {} failed", vm, e); - CloudRuntimeException ex = new CloudRuntimeException("Stop vm failed for specified vmId"); + CloudRuntimeException ex = new CloudRuntimeException("Stop VM failed for specified vmId"); ex.addProxyObject(vm.getUuid(), "vmId"); throw ex; } @@ -8906,7 +8904,7 @@ public Pair doInTransaction(final TransactionStatus status) th Long templateId = root.getTemplateId(); boolean isISO = false; if (templateId == null) { - // Assuming that for a vm deployed using ISO, template ID is set to NULL + // Assuming that for a VM deployed using ISO, template ID is set to NULL isISO = true; templateId = userVm.getIsoId(); } @@ -8934,7 +8932,7 @@ public Pair doInTransaction(final TransactionStatus status) th volumeMgr.saveVolumeDetails(newVol.getDiskOfferingId(), newVol.getId()); newVol = _volsDao.findById(newVol.getId()); - // 1. Save usage event and update resource count for user vm volumes + // 1. Save usage event and update resource count for user VM volumes try { _resourceLimitMgr.incrementVolumeResourceCount(userVm.getAccountId(), newVol.isDisplay(), newVol.getSize(), diskOffering != null ? diskOffering : _diskOfferingDao.findById(newVol.getDiskOfferingId())); @@ -9005,7 +9003,7 @@ public Pair doInTransaction(final TransactionStatus status) th _itMgr.start(vm.getUuid(), params); vm = _vmDao.findById(vmId); if (template.isEnablePassword()) { - // this value is not being sent to the backend; need only for api + // this value is not being sent to the backend; need only for API // display purposes vm.setPassword(password); if (vm.isUpdateParameters()) { @@ -9019,7 +9017,7 @@ public Pair doInTransaction(final TransactionStatus status) th } } catch (Exception e) { logger.debug("Unable to start VM " + vm.getUuid(), e); - CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM with specified id" + e.getMessage()); + CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM with specified ID" + e.getMessage()); ex.addProxyObject(vm.getUuid(), "vmId"); throw ex; } @@ -9132,12 +9130,12 @@ private void checkRestoreVmFromTemplate(UserVmVO vm, VMTemplateVO template, List if (!template.isDirectDownload()) { tmplStore = _templateStoreDao.findByTemplateZoneReady(template.getId(), vm.getDataCenterId()); if (tmplStore == null) { - throw new InvalidParameterValueException("Cannot restore the vm as the template " + template.getUuid() + " isn't available in the zone"); + throw new InvalidParameterValueException("Cannot restore the VM as the template " + template.getUuid() + " isn't available in the zone"); } } else { tmplStore = _templateStoreDao.findByTemplate(template.getId(), DataStoreRole.Image); if (tmplStore == null || (tmplStore != null && !tmplStore.getDownloadState().equals(VMTemplateStorageResourceAssoc.Status.BYPASSED))) { - throw new InvalidParameterValueException("Cannot restore the vm as the bypassed template " + template.getUuid() + " isn't available in the zone"); + throw new InvalidParameterValueException("Cannot restore the VM as the bypassed template " + template.getUuid() + " isn't available in the zone"); } } @@ -9228,7 +9226,7 @@ else if (host.getHypervisorType() == HypervisorType.KVM) { if (!cmds.isSuccessful()) { for (Answer answer : cmds.getAnswers()) { if (!answer.getResult()) { - logger.warn("Failed to reset vm {} due to: {}", vm, answer.getDetails()); + logger.warn("Failed to reset VM {} due to: {}", vm, answer.getDetails()); throw new CloudRuntimeException("Unable to reset " + vm + " due to " + answer.getDetails()); } @@ -9301,7 +9299,7 @@ private void encryptAndStorePassword(UserVmVO vm, String password) { String sshPublicKeys = vm.getDetail(VmDetailConstants.SSH_PUBLIC_KEY); if (sshPublicKeys != null && !sshPublicKeys.equals("") && password != null && !password.equals("saved_password")) { if (!sshPublicKeys.startsWith("ssh-rsa")) { - logger.warn("Only RSA public keys can be used to encrypt a vm password."); + logger.warn("Only RSA public keys can be used to encrypt a VM password."); return; } String encryptedPasswd = RSAHelper.encryptWithSSHPublicKey(sshPublicKeys, password); @@ -9321,7 +9319,7 @@ public void persistDeviceBusInfo(UserVmVO vm, String rootDiskController) { vm.setDetail(VmDetailConstants.ROOT_DISK_CONTROLLER, rootDiskController); _vmDao.saveDetails(vm); if (logger.isDebugEnabled()) { - logger.debug("Persisted device bus information rootDiskController={} for vm: {}", rootDiskController, vm); + logger.debug("Persisted device bus information rootDiskController={} for VM: {}", rootDiskController, vm); } } } @@ -9343,7 +9341,7 @@ public ConfigKey[] getConfigKeys() { public String getVmUserData(long vmId) { UserVmVO vm = _vmDao.findById(vmId); if (vm == null) { - throw new InvalidParameterValueException("Unable to find virtual machine with id " + vmId); + throw new InvalidParameterValueException("Unable to find virtual machine with ID " + vmId); } _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, vm); @@ -9370,7 +9368,7 @@ private boolean checkStatusOfVolumeSnapshots(VirtualMachine vm, Volume.Type type } else { listVolumes = _volsDao.findByInstance(vmId); } - logger.debug("Found {} no. of volumes of type {} for vm with VM ID {}", listVolumes.size(), type, vm); + logger.debug("Found {} no. of volumes of type {} for VM with VM ID {}", listVolumes.size(), type, vm); for (VolumeVO volume : listVolumes) { Long volumeId = volume.getId(); logger.debug("Checking status of snapshots for Volume: {}", volume); @@ -9408,7 +9406,7 @@ private void validateVolumes(List volumes) { } if (volume.isDeleteProtection()) { throw new InvalidParameterValueException(String.format( - "Volume [id = %s, name = %s] has delete protection enabled and cannot be deleted", + "Volume [ID = %s, name = %s] has delete protection enabled and cannot be deleted", volume.getUuid(), volume.getName())); } } @@ -9420,7 +9418,7 @@ private void detachVolumesFromVm(UserVm vm, List volumes) { // Create new context and inject correct event resource type, id and details, // otherwise VOLUME.DETACH event will be associated with VirtualMachine and contain VM id and other information. CallContext volumeContext = CallContext.register(CallContext.current(), ApiCommandResourceType.Volume); - volumeContext.setEventDetails("Volume Type: " + volume.getVolumeType() + " Volume Id: " + this._uuidMgr.getUuid(Volume.class, volume.getId()) + " Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, volume.getInstanceId())); + volumeContext.setEventDetails("Volume Type: " + volume.getVolumeType() + " Volume ID: " + this._uuidMgr.getUuid(Volume.class, volume.getId()) + " VM ID: " + this._uuidMgr.getUuid(VirtualMachine.class, volume.getInstanceId())); volumeContext.setEventResourceType(ApiCommandResourceType.Volume); volumeContext.setEventResourceId(volume.getId()); @@ -9449,7 +9447,7 @@ private void destroyVolumeInContext(UserVmVO vm, boolean expunge, VolumeVO volum // Create new context and inject correct event resource type, id and details, // otherwise VOLUME.DESTROY event will be associated with VirtualMachine and contain VM id and other information. CallContext volumeContext = CallContext.register(CallContext.current(), ApiCommandResourceType.Volume); - volumeContext.setEventDetails("Volume Type: " + volume.getVolumeType() + " Volume Id: " + this._uuidMgr.getUuid(Volume.class, volume.getId()) + " Vm Id: " + vm.getUuid()); + volumeContext.setEventDetails("Volume Type: " + volume.getVolumeType() + " Volume ID: " + this._uuidMgr.getUuid(Volume.class, volume.getId()) + " VM ID: " + vm.getUuid()); volumeContext.setEventResourceType(ApiCommandResourceType.Volume); volumeContext.setEventResourceId(volume.getId()); try { @@ -9857,9 +9855,9 @@ private void postProcessingUnmanageVMVolumes(List volumes, UserVmVO vm void checkUnmanagingVMOngoingVolumeSnapshots(UserVmVO vm) { logger.debug("Checking if there are any ongoing snapshots on the ROOT volumes associated with VM {}", vm); if (checkStatusOfVolumeSnapshots(vm, Volume.Type.ROOT)) { - throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, vm unmanage is not permitted, please try again later."); + throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, VM unmanage is not permitted, please try again later."); } - logger.debug("Found no ongoing snapshots on volume of type ROOT, for the vm {}", vm); + logger.debug("Found no ongoing snapshots on volume of type ROOT, for the VM {}", vm); } void checkUnmanagingVMVolumes(UserVmVO vm, List volumes) { @@ -9915,7 +9913,7 @@ private void collectVmDiskAndNetworkStatistics(Long vmId, State expectedState) { if (uservm != null) { collectVmDiskAndNetworkStatistics(uservm, expectedState); } else { - logger.info("Skip collecting vmId {} disk and network statistics as it is not user vm", vmId); + logger.info("Skip collecting vmId {} disk and network statistics as it is not user VM", vmId); } } @@ -9924,7 +9922,7 @@ private void collectVmDiskAndNetworkStatistics(UserVm vm, State expectedState) { collectVmDiskStatistics(vm); collectVmNetworkStatistics(vm); } else { - logger.warn(String.format("Skip collecting vm %s disk and network statistics as the expected vm state is %s but actual state is %s", vm, expectedState, vm.getState())); + logger.warn(String.format("Skip collecting VM %s disk and network statistics as the expected VM state is %s but actual state is %s", vm, expectedState, vm.getState())); } } diff --git a/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java b/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java index a21477aeb80e..248a8b87779b 100644 --- a/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java +++ b/server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java @@ -1981,7 +1981,7 @@ public void validateIfVmHasNoRulesTestLoadBalancingRulesExistThrowsInvalidParame @Test public void validateIfVmHasNoRulesTestOneToOneNatRulesExistThrowsInvalidParameterValueException() { - String expectedMessage = String.format("Remove the One to One Nat rule for VM [%s] for IP [%s].", userVmVoMock, ipAddressVoMock.toString()); + String expectedMessage = String.format("Remove the One to One NAT rule for VM [%s] for IP [%s].", userVmVoMock, ipAddressVoMock.toString()); LinkedList ipAddressVoList = new LinkedList(); diff --git a/server/src/test/java/com/cloud/vm/UserVmManagerTest.java b/server/src/test/java/com/cloud/vm/UserVmManagerTest.java index b5d904bd2775..6396b884bfc9 100644 --- a/server/src/test/java/com/cloud/vm/UserVmManagerTest.java +++ b/server/src/test/java/com/cloud/vm/UserVmManagerTest.java @@ -292,7 +292,7 @@ public void testScaleVMF1() throws Exception { lenient().when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance); - // UserContext.current().setEventDetails("Vm Id: "+getId()); + // UserContext.current().setEventDetails("VM ID: "+getId()); Account account = new AccountVO("testaccount", 1L, "networkdomain", Account.Type.NORMAL, "uuid"); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString(), User.Source.UNKNOWN); //AccountVO(String accountName, long domainId, String networkDomain, short type, int regionId) @@ -402,7 +402,7 @@ public void testScaleVMF4() throws Exception { serviceOfferingIdField.setAccessible(true); serviceOfferingIdField.set(cmd, 1L); - //UserContext.current().setEventDetails("Vm Id: "+getId()); + //UserContext.current().setEventDetails("VM ID: "+getId()); //Account account = (Account) new AccountVO("testaccount", 1L, "networkdomain", (short) 0, 1); //AccountVO(String accountName, long domainId, String networkDomain, short type, int regionId) //UserContext.registerContext(1, account, null, true); diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index 85b78ee16aee..7a01295d1311 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -481,7 +481,7 @@ setup_dnsmasq() { then sed -i -e "/^[#]*dhcp-option.*=119.*$/d" /etc/dnsmasq.conf echo "dhcp-option-force=119,$DNS_SEARCH_ORDER" >> /etc/dnsmasq.conf - # set the domain search order as a space seprated list for option 15 + # set the domain search order as a space separated list for option 15 DNS_SEARCH_ORDER=$(echo $DNS_SEARCH_ORDER | sed 's/,/ /g') #send domain name to dhcp clients sed -i s/[#]*dhcp-option=15.*$/dhcp-option=15,\""$DNS_SEARCH_ORDER"\"/ /etc/dnsmasq.conf @@ -542,7 +542,7 @@ setup_dnsmasq() { [ $ETH0_IP ] && echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf [ $ETH0_IP6 ] && echo "dhcp-option=option6:dns-server,$NS6" >> /etc/dnsmasq.conf #adding the name data-server to the /etc/hosts for allowing the access to user-data service and ssh-key reset in every subnet. - #removing the existing entires to avoid duplicates on restarts. + #removing the existing entries to avoid duplicates on restarts. sed -i '/data-server/d' /etc/hosts if [ -n "$ETH0_IP" ] then @@ -734,7 +734,7 @@ parse_cmd_line() { KEY=$(echo $i | cut -d= -f1) VALUE=$(echo $i | cut -d= -f2) echo -en ${COMMA} >> ${CHEF_TMP_FILE} - # Two lines so values do not accidentally interpretted as escapes!! + # Two lines so values do not accidentally interpreted as escapes!! echo -n \"${KEY}\"': '\"${VALUE}\" >> ${CHEF_TMP_FILE} COMMA=",\n\t" case $KEY in diff --git a/test/integration/component/maint/test_host_high_availability.py b/test/integration/component/maint/test_host_high_availability.py index c335c66b481f..609eb0c6c551 100644 --- a/test/integration/component/maint/test_host_high_availability.py +++ b/test/integration/component/maint/test_host_high_availability.py @@ -159,7 +159,7 @@ def tearDownClass(cls): try: # Remove the host from HA Host.update(cls.api_client, id=cls.hosts[2].id, hosttags="") - #Cleanup resources used + # Cleanup resources used cleanup_resources(cls.api_client, cls._cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) @@ -179,7 +179,7 @@ def setUp(self): def tearDown(self): try: - #Clean up, terminate the created accounts, domains etc + # Clean up, terminate the created accounts, domains etc cleanup_resources(self.apiclient, self.cleanup) except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) @@ -220,7 +220,7 @@ def test_01_vm_deployment_with_compute_offering_with_ha_enabled(self): "The service offering is not HA enabled" ) - #create virtual machine with the service offering with Ha enabled + # create virtual machine with the service offering with Ha enabled virtual_machine = VirtualMachine.create( self.apiclient, self.services["virtual_machine"], @@ -253,7 +253,7 @@ def test_01_vm_deployment_with_compute_offering_with_ha_enabled(self): @attr(configuration="ha.tag") @attr(tags=["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_02_no_vm_creation_on_host_with_haenabled(self): - """ Verify you can not create new VMs on hosts with an ha.tag """ + """ Verify you cannot create new VMs on hosts with an ha.tag """ # Steps, #1. Fresh install CS (Bonita) that supports this feature @@ -296,7 +296,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self): self.debug("Deployed VM on host: %s" % vm.hostid) - #validate the virtual machine created is host Ha enabled + # validate the virtual machine created is host Ha enabled list_hosts_response = list_hosts( self.apiclient, id=vm.hostid @@ -310,7 +310,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self): self.assertNotEqual( len(list_hosts_response), 0, - "listHosts retuned empty list in response." + "listHosts returned empty list in response." ) self.assertEqual( @@ -319,7 +319,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self): "VM created on HA enabled host." ) - #create and verify virtual machine with Ha disabled service offering + # create and verify virtual machine with Ha disabled service offering virtual_machine_without_ha = VirtualMachine.create( self.apiclient, self.services["virtual_machine"], @@ -350,7 +350,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self): self.debug("Deployed VM on host: %s" % vm.hostid) - #verify that the virtual machine created on the host is Ha disabled + # verify that the virtual machine created on the host is Ha disabled list_hosts_response = list_hosts( self.apiclient, id=vm.hostid @@ -378,7 +378,7 @@ def test_02_no_vm_creation_on_host_with_haenabled(self): @attr(configuration="ha.tag") @attr(tags=["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_03_cant_migrate_vm_to_host_with_ha_positive(self): - """ Verify you can not migrate VMs to hosts with an ha.tag (positive) """ + """ Verify you cannot migrate VMs to hosts with an ha.tag (positive) """ # Steps, # 1. Create a Compute service offering with the 'Offer HA' option selected. @@ -495,7 +495,7 @@ def test_03_cant_migrate_vm_to_host_with_ha_positive(self): @attr(configuration="ha.tag") @attr(tags=["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_04_cant_migrate_vm_to_host_with_ha_negative(self): - """ Verify you can not migrate VMs to hosts with an ha.tag (negative) """ + """ Verify you cannot migrate VMs to hosts with an ha.tag (negative) """ # Steps, #1. Create a Compute service offering with the 'Offer HA' option selected. @@ -539,7 +539,7 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self): self.debug("Deployed VM on host: %s" % vm.hostid) - #Find out Non-Suitable host for VM migration + # Find out Non-Suitable host for VM migration list_hosts_response = list_hosts( self.apiclient, type="Routing" @@ -564,7 +564,7 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self): self.assertTrue(notSuitableHost is not None, "notsuitablehost should not be None") - #Migrate VM to Non-Suitable host + # Migrate VM to Non-Suitable host self.debug("Migrating VM-ID: %s to Host: %s" % (vm.id, notSuitableHost.id)) cmd = migrateVirtualMachine.migrateVirtualMachineCmd() @@ -572,7 +572,7 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self): cmd.virtualmachineid = vm.id self.apiclient.migrateVirtualMachine(cmd) - #Verify that the virtual machine got migrated to targeted Non-Suitable host + # Verify that the virtual machine got migrated to targeted Non-Suitable host list_vm_response = list_virtual_machines( self.apiclient, id=vm.id @@ -598,7 +598,7 @@ def test_04_cant_migrate_vm_to_host_with_ha_negative(self): self.assertEqual( list_vm_response[0].hostid, notSuitableHost.id, - "The detination host id of migrated VM is not matching." + "The destination host id of migrated VM is not matching." ) @attr(configuration="ha.tag") @@ -650,7 +650,7 @@ def test_05_no_vm_with_ha_gets_migrated_to_ha_host_in_live_migration(self): vm_with_ha_enabled = vms[0] - #Verify the virtual machine got created on non HA host + # Verify the virtual machine got created on non HA host list_hosts_response = list_hosts( self.apiclient, id=vm_with_ha_enabled.hostid @@ -673,7 +673,7 @@ def test_05_no_vm_with_ha_gets_migrated_to_ha_host_in_live_migration(self): "The virtual machine is not ha enabled so check if VM is created on host which is also not ha enabled" ) - #put the Host in maintenance mode + # put the Host in maintenance mode self.debug("Enabling maintenance mode for host %s" % vm_with_ha_enabled.hostid) cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() cmd.id = vm_with_ha_enabled.hostid @@ -681,7 +681,7 @@ def test_05_no_vm_with_ha_gets_migrated_to_ha_host_in_live_migration(self): timeout = self.services["timeout"] - #verify the VM live migration happened to another running host + # verify the VM live migration happened to another running host self.debug("Waiting for VM to come up") time.sleep(timeout) @@ -781,7 +781,7 @@ def test_06_no_vm_without_ha_gets_migrated_to_ha_host_in_live_migration(self): vm_with_ha_disabled = vms[0] - #Verify the virtual machine got created on non HA host + # Verify the virtual machine got created on non HA host list_hosts_response = list_hosts( self.apiclient, id=vm_with_ha_disabled.hostid @@ -804,7 +804,7 @@ def test_06_no_vm_without_ha_gets_migrated_to_ha_host_in_live_migration(self): "The virtual machine is not ha enabled so check if VM is created on host which is also not ha enabled" ) - #put the Host in maintenance mode + # put the Host in maintenance mode self.debug("Enabling maintenance mode for host %s" % vm_with_ha_disabled.hostid) cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() cmd.id = vm_with_ha_disabled.hostid @@ -812,7 +812,7 @@ def test_06_no_vm_without_ha_gets_migrated_to_ha_host_in_live_migration(self): timeout = self.services["timeout"] - #verify the VM live migration happened to another running host + # verify the VM live migration happened to another running host self.debug("Waiting for VM to come up") time.sleep(timeout) diff --git a/test/integration/component/test_netscaler_lb.py b/test/integration/component/test_netscaler_lb.py index 66425d6765c1..e3c6abc2b1db 100644 --- a/test/integration/component/test_netscaler_lb.py +++ b/test/integration/component/test_netscaler_lb.py @@ -327,8 +327,8 @@ def test_lb_on_ip_with_pf(self): # 1. Deploy the first VM using a network from the above created # Network offering. # 2. Deploy another VM. - # 3. Create LB rule on Ip with PF rule. User should NOT be - # allowed to create an LB rule on Ip with PF + # 3. Create LB rule on IP with PF rule. User should NOT be + # allowed to create an LB rule on IP with PF # Creating network using the network offering created self.debug("Creating network with network offering: %s" % @@ -537,7 +537,7 @@ def test_pf_on_ip_with_lb(self): # Network offering. # 2. Deploy another VM. # 3. Create PF rule on Ip with LB rule. User should NOT be - # allowed to create an LB rule on Ip with LB + # allowed to create an LB rule on IP with LB # Creating network using the network offering created self.debug("Creating network with network offering: %s" % @@ -745,7 +745,7 @@ def test_lb_on_non_source_nat(self): # 1. Deploy the first VM using a network from the above created # Network offering. # 2. Deploy another VM. - # 3. Acquire Ip address and create LB rule on it. LB rule should be + # 3. Acquire IP address and create LB rule on it. LB rule should be # created successfully # Creating network using the network offering created @@ -957,12 +957,12 @@ def test_add_multiple_vms_lb(self): # 1. Deploy the first VM using a network from the above created # Network offering. # 2. Deploy another VM. - # 3. Acquire Ip address and create LB rule on it. Add multiple VMs to + # 3. Acquire IP address and create LB rule on it. Add multiple VMs to # this rule. LB rule should be - # In Netscaler: For every Vm added to the LB rule: + # In Netscaler: For every VM added to the LB rule: # 1. A server and service instance is created using guest VMs IP and # port number on the Netscaler LB device, - # 2. This service is bound to lb virtual server corresponding to lb + # 2. This service is bound to the LB virtual server corresponding to LB # rule. # Creating network using the network offering created @@ -1233,7 +1233,7 @@ def test_multiple_lb_publicip(self): # 1. Deploy the first VM using a network from the above created # Network offering. # 2. Deploy few more VMs. - # 3. Acquire an Ipaddress and create an LB rule for multiple Vms. + # 3. Acquire an IP address and create an LB rule for multiple VMs. # Repeat step2 for few times Requests to all these LB rules should # be serviced correctly. @@ -1545,8 +1545,8 @@ def test_multiple_lb_same_publicip(self): # 1. Deploy the first VM using a network from the above created # Network offering. # 2. Deploy few more VMs. - # 3. Acquire an Ipaddress and create an LB rule for multiple Vms. - # Create another Lb rule on the same Ipaddress pointing to + # 3. Acquire an IP address and create an LB rule for multiple VMs. + # Create another LB rule on the same IP address pointing to # different public port. Requests to all these LB rules should be # serviced correctly. @@ -1892,9 +1892,9 @@ def test_01_edit_name_lb_rule(self): """ # Validate the following - # 1. Create an Lb rule for couple of Vms . + # 1. Create an LB rule for a couple of VMs. # 2. Edit the name of the existing LB rule. When all the existing - # Lbrules are listed , we should see the edited name. + # LB rules are listed, we should see the edited name. self.debug("Assigning VMs to LB rule: %s" % self.lb_rule.name) self.lb_rule.assign(self.apiclient, [self.virtual_machine]) @@ -1903,7 +1903,7 @@ def test_01_edit_name_lb_rule(self): new_name = random_gen() self.lb_rule.update(self.apiclient, name=new_name) - self.debug("Verifing the name change in list Lb rules call") + self.debug("Verifying the name change in list LB rules call") lb_rules = LoadBalancerRule.list(self.apiclient, id=self.lb_rule.id) self.assertEqual( @@ -1925,9 +1925,9 @@ def test_02_edit_lb_ports(self): """ # Validate the following - # 1. Create an Lb rule for couple of Vms . + # 1. Create an LB rule for a couple of VMs. # 2. Edit the public/private of the existing LB rule. When all the - # existing Lbrules are listed, this should not be allowed. + # existing LB rules are listed, this should not be allowed. self.debug( "Editing public port of the LB rule: %s" % @@ -2259,15 +2259,15 @@ def tearDown(self): @attr(tags=["advancedns"]) def test_01_delete_public_ip(self): - """Test delete one public Ip with LB rules""" + """Test delete one public IP with LB rules""" # Validate the following - # 1. Associate 2 public Ips and create load balancing rules in it - # 2. Delete one of the public Ip - # 3. All the LB rules should be removed from that public Ip + # 1. Associate 2 public IPs and create load balancing rules in it + # 2. Delete one of the public IP + # 3. All the LB rules should be removed from that public IP # 4. In netscaler, make sure that all LB rules associated with that - # public Ip should get removed. - # 5. All servers and testdata service to that public Ip get deleted + # public IP should get removed. + # 5. All servers and testdata service to that public IP get deleted self.debug("Deleting public IP: %s from network: %s" % ( self.public_ip_2.ipaddress.ipaddress, @@ -2275,7 +2275,7 @@ def test_01_delete_public_ip(self): )) self.public_ip_2.delete(self.apiclient) self.debug( - "Public Ip: %s is deleted!" % + "Public IP: %s is deleted!" % self.public_ip_2.ipaddress.ipaddress) lb_rules = LoadBalancerRule.list( self.apiclient, @@ -2285,7 +2285,7 @@ def test_01_delete_public_ip(self): self.assertEqual( lb_rules, None, - "LB rules associated with the public Ip should get deleted" + "LB rules associated with the public IP should get deleted" ) self.debug("SSH into Netscaler to verify other resources are deleted") try: @@ -2333,7 +2333,7 @@ def test_02_stop_user_vm(self): # 1. Create 2 instances and add these two for load balancing # 2. Stop one of the user VM # 3. Test whether the request are not sent to stopped user VM - # 4. In netscaler, LB rules for this VM still remain configured.But + # 4. In netscaler, LB rules for this VM still remain configured. But # it will be marked as being down try: @@ -2405,7 +2405,7 @@ def test_03_start_user_vm(self): # 1. Create 2 instances and add these two for load balancing # 2. Stop one of the user VM # 3. Test whether the request are not sent to stopped user VM - # 4. In netscaler, LB rules for this VM still remain configured.But + # 4. In netscaler, LB rules for this VM still remain configured. But # it will be marked as being down self.debug("Starting VM instance: %s" % self.vm_2.name) @@ -2475,7 +2475,7 @@ def test_04_migrate_user_vm(self): # Validate the following # 1. Create 2 instances and add these two for load balancing - # 2. migrate one Vm to another host. + # 2. migrate one VM to another host. # 3. Test whether the request are sent to stopped user VM after migrate # 4. In netscaler, the LB rules are still configured. self.hypervisor = self.testClient.getHypervisorInfo() @@ -2496,7 +2496,7 @@ def test_04_migrate_user_vm(self): self.assertGreaterEqual( len(hosts), 2, - "Atleast 2 hosts should be present in a zone for VM migration" + "At least 2 hosts should be present in a zone for VM migration" ) # Remove the host of current VM from the hosts list @@ -2592,7 +2592,7 @@ def test_05_reboot_user_vm(self): # 1. Create 2 instances and add these two for load balancing # 2. Reboot one of the user VM # 3. Test whether the request are sent to both VMs after reboot - # 4. In netscaler, LB rules for this VM still remain configured. + # 4. In netscaler, LB rules for this VM still remain configured. self.debug("Rebooting VM instance: %s" % self.vm_2.name) self.vm_2.reboot(self.apiclient) @@ -2678,11 +2678,11 @@ def test_06_destroy_user_vm(self): # Validate the following # 1. Create 2 instances and add these two for load balancing # 2. Destroy one of the user VM - # 3. Until the time the Vm is in "Destroyed" state, the servies - # relating to this Vm will be marked as "Down". - # 4. Once the Vm gets expunged, then the servers and testdata + # 3. Until the time the VM is in "Destroyed" state, the services + # relating to this VM will be marked as "Down". + # 4. Once the VM gets expunged, then the servers and testdata # associated with this VM should get deleted and the LB rules - # should not be pointing to this Vm anymore. + # should not be pointing to this VM anymore. self.debug("Destroying VM instance: %s" % self.vm_2.name) self.vm_2.delete(self.apiclient) @@ -2758,12 +2758,12 @@ def test_07_delete_all_public_ip(self): """Test delete all public Ip with LB rules""" # Validate the following - # 1. Associate 2 public Ips and create load balancing rules in it + # 1. Associate 2 public IPs and create load balancing rules in it # 2. Delete all of the public Ip - # 3. All the LB rules should be removed from that public Ip + # 3. All the LB rules should be removed from that public IP # 4. In netscaler, make sure that all LB rules associated with that - # public Ip should get removed. - # 5. All servers and testdata service to that public Ip get deleted + # public IP should get removed. + # 5. All servers and testdata service to that public IP get deleted self.debug("Deleting public IP: %s from network: %s" % ( self.public_ip_1.ipaddress.ipaddress, diff --git a/test/integration/smoke/test_vm_strict_host_tags.py b/test/integration/smoke/test_vm_strict_host_tags.py index 2377e9a76185..e360e64c1ff8 100644 --- a/test/integration/smoke/test_vm_strict_host_tags.py +++ b/test/integration/smoke/test_vm_strict_host_tags.py @@ -423,7 +423,7 @@ def test_02_restore_vm_strict_tags_failure(self): vm.restore(self.apiclient, templateid=self.template_t2.id, expunge=True) self.fail("VM should not be restored") except Exception as e: - self.assertTrue("Unable to start VM with specified id" in str(e)) + self.assertTrue("Unable to start VM with specified ID" in str(e)) class TestMigrateVMStrictTags(cloudstackTestCase):