Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b28eccb
Fix grammar, spelling, word casing, whitespace
jbampton May 28, 2024
3574cdc
Update api/src/main/java/org/apache/cloudstack/api/command/user/vm/De…
jbampton Jul 10, 2024
fba6bf5
Update api/src/main/java/org/apache/cloudstack/api/command/user/vm/De…
jbampton Jul 10, 2024
287b40f
Update server/src/main/java/com/cloud/network/NetworkServiceImpl.java
jbampton Jul 10, 2024
79a8b92
Update server/src/test/java/com/cloud/vm/UserVmManagerTest.java
jbampton Jul 10, 2024
8ac51b7
Update plugins/network-elements/juniper-contrail/src/main/java/org/ap…
jbampton Jul 10, 2024
0c81a31
Update plugins/network-elements/netscaler/src/main/java/com/cloud/api…
jbampton Jul 10, 2024
177d355
Update server/src/test/java/com/cloud/vm/UserVmManagerTest.java
jbampton Jul 10, 2024
f104bd5
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Oct 14, 2024
403b87d
Merge branch 'main' into fix-spelling-grammar-case-whitespace
DaanHoogland Dec 20, 2024
e9b5c9d
Update tools/git/git-pr
jbampton Dec 20, 2024
02d59c0
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Dec 20, 2024
1dba0f8
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Jun 5, 2025
6d95003
Fix up test failure
jbampton Jun 5, 2025
cfcc791
Fix up test
jbampton Jun 5, 2025
c7fb37f
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Jun 20, 2025
eea90fc
Update api/src/main/java/org/apache/cloudstack/api/command/admin/inte…
jbampton Jun 20, 2025
a4368eb
Fix up conflicts
jbampton Sep 17, 2025
3e90ab6
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Oct 13, 2025
c76a7f4
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Oct 24, 2025
b1f1816
Merge branch 'main' into fix-spelling-grammar-case-whitespace
jbampton Nov 13, 2025
c7b4698
Merge branch 'main' into fix-spelling-grammar-case-whitespace
DaanHoogland Dec 12, 2025
25603ee
Apply suggestions from code review
DaanHoogland Dec 12, 2025
8493f5f
Apply batched suggestions from code review
andrijapanicsb Nov 15, 2026
8ceaa7b
Merge branch 'main' into fix-spelling-grammar-case-whitespace
andrijapanicsb Nov 15, 2026
35e1dd2
Fix formatting of exception message in UserVmManagerImpl
andrijapanicsb Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework/db/src/main/java/com/cloud/utils/db/EcInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Comment thread
andrijapanicsb marked this conversation as resolved.
Resolved
return svm;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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.<HostVO> asList());
assertFalse(_element.isReady(nspvo));
Expand All @@ -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));

Expand All @@ -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.<HostVO> asList());
assertFalse(_element.canHandle(psvo));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4464,7 +4464,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
long vmId = nic.getInstanceId();
VMInstanceVO vm = _vmDao.findById(vmId);
if (vm == null) {
logger.error("Instance for NIC {} not found with Instance Id: {}", nic, vmId);
logger.error("Instance for NIC {} not found with Instance ID: {}", nic, vmId);
continue;
}
long isDefault = (nic.isDefaultNic()) ? 1 : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ public boolean detachIso(long vmId, Long isoParamId, Boolean... extraParams) {
if (isoId == null) {
throw new InvalidParameterValueException("The specified instance 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) {
Expand Down
475 changes: 237 additions & 238 deletions server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2577,7 +2577,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<IPAddressVO> ipAddressVoList = new LinkedList<>();

Expand Down
4 changes: 2 additions & 2 deletions server/src/test/java/com/cloud/vm/UserVmManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,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());
Comment thread
jbampton marked this conversation as resolved.
Resolved
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)
Expand Down Expand Up @@ -405,7 +405,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());
Comment thread
jbampton marked this conversation as resolved.
Resolved
//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);
Expand Down
6 changes: 3 additions & 3 deletions systemvm/debian/opt/cloud/bin/setup/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,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
Expand Down Expand Up @@ -544,7 +544,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
Expand Down Expand Up @@ -736,7 +736,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
Expand Down
40 changes: 20 additions & 20 deletions test/integration/component/maint/test_host_high_availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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"],
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand All @@ -564,15 +564,15 @@ 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()
cmd.hostid = notSuitableHost.id
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
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -673,15 +673,15 @@ 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
self.apiclient.prepareHostForMaintenance(cmd)

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)

Expand Down Expand Up @@ -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
Expand All @@ -804,15 +804,15 @@ 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
self.apiclient.prepareHostForMaintenance(cmd)

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)

Expand Down
Loading
Loading