Skip to content

Commit 44b6718

Browse files
committed
Merge branch 'main' into pre-commit-enable-markdownlint-MD018
2 parents 6dede89 + 3c9bc07 commit 44b6718

File tree

593 files changed

+20273
-4449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

593 files changed

+20273
-4449
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ jobs:
8787
smoke/test_multipleips_per_nic
8888
smoke/test_nested_virtualization
8989
smoke/test_set_sourcenat
90-
smoke/test_webhook_lifecycle",
90+
smoke/test_webhook_lifecycle
91+
smoke/test_purge_expunged_vms",
9192
"smoke/test_network
9293
smoke/test_network_acl
9394
smoke/test_network_ipv6
@@ -133,6 +134,7 @@ jobs:
133134
smoke/test_usage
134135
smoke/test_usage_events
135136
smoke/test_vm_deployment_planner
137+
smoke/test_vm_strict_host_tags
136138
smoke/test_vm_schedule
137139
smoke/test_vm_life_cycle
138140
smoke/test_vm_lifecycle_unmanage_import

PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This PR...
2323
- [ ] Enhancement (improves an existing feature and functionality)
2424
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
2525
- [ ] build/CI
26+
- [ ] test (unit or integration test code)
2627

2728
### Feature/Enhancement Scale or Bug Severity
2829

agent/conf/cloudstack-agent.logrotate.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
/var/log/cloudstack/agent/security_group.log /var/log/cloudstack/agent/resizevolume.log /var/log/cloudstack/agent/rolling-maintenance.log {
18+
/var/log/cloudstack/agent/security_group.log /var/log/cloudstack/agent/resizevolume.log /var/log/cloudstack/agent/rolling-maintenance.log /var/log/cloudstack/agent/agent.out /var/log/cloudstack/agent/agent.err {
1919
copytruncate
2020
daily
2121
rotate 5
2222
compress
2323
missingok
2424
size 10M
25+
dateext
26+
dateformat -%Y-%m-%d
2527
}

agent/conf/log4j-cloud.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ under the License.
3838
<!-- ============================== -->
3939

4040
<Console name="CONSOLE" target="SYSTEM_OUT">
41-
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
41+
<ThresholdFilter level="OFF" onMatch="ACCEPT" onMismatch="DENY"/>
4242
<PatternLayout pattern="%-5p [%c{3}] (%t:%x) (logid:%X{logcontextid}) %m%ex%n"/>
4343
</Console>
4444
</Appenders>

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,12 @@ public void doTask(final Task task) throws TaskExecutionException {
11271127
logger.error("Error parsing task", e);
11281128
}
11291129
} else if (task.getType() == Task.Type.DISCONNECT) {
1130+
try {
1131+
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
1132+
// wait 5 seconds before reconnecting
1133+
Thread.sleep(5000);
1134+
} catch (InterruptedException e) {
1135+
}
11301136
reconnect(task.getLink());
11311137
return;
11321138
} else if (task.getType() == Task.Type.OTHER) {

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ public Property<Integer> getWorkers() {
751751
public static final Property<Integer> IOTHREADS = new Property<>("iothreads", 1);
752752

753753
/**
754-
* Enable verbose mode for virt-v2v Instance Conversion from Vmware to KVM
754+
* Enable verbose mode for virt-v2v Instance Conversion from VMware to KVM
755755
* Data type: Boolean.<br>
756756
* Default value: <code>false</code>
757757
*/

agent/src/test/java/com/cloud/agent/AgentShellTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,16 @@ public void setHostTestValueIsNullPropertyDoesNotStartAndEndWithAtSignSetHosts()
350350

351351
Mockito.verify(agentShellSpy).setHosts(expected);
352352
}
353+
354+
@Test
355+
public void updateAndGetConnectedHost() {
356+
String expected = "test";
357+
358+
AgentShell shell = new AgentShell();
359+
shell.setHosts("test");
360+
shell.getNextHost();
361+
shell.updateConnectedHost();
362+
363+
Assert.assertEquals(expected, shell.getConnectedHost());
364+
}
353365
}

api/src/main/java/com/cloud/agent/api/to/RemoteInstanceTO.java

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,39 @@
1818
*/
1919
package com.cloud.agent.api.to;
2020

21+
import java.io.Serializable;
22+
2123
import com.cloud.agent.api.LogLevel;
2224
import com.cloud.hypervisor.Hypervisor;
2325

24-
import java.io.Serializable;
25-
2626
public class RemoteInstanceTO implements Serializable {
2727

2828
private Hypervisor.HypervisorType hypervisorType;
29-
private String hostName;
3029
private String instanceName;
3130

32-
// Vmware Remote Instances parameters
31+
// VMware Remote Instances parameters (required for exporting OVA through ovftool)
3332
// TODO: cloud.agent.transport.Request#getCommands() cannot handle gsoc decode for polymorphic classes
3433
private String vcenterUsername;
3534
@LogLevel(LogLevel.Log4jLevel.Off)
3635
private String vcenterPassword;
3736
private String vcenterHost;
3837
private String datacenterName;
39-
private String clusterName;
4038

4139
public RemoteInstanceTO() {
4240
}
4341

44-
public RemoteInstanceTO(String hostName, String instanceName, String vcenterHost,
45-
String datacenterName, String clusterName,
46-
String vcenterUsername, String vcenterPassword) {
42+
public RemoteInstanceTO(String instanceName) {
43+
this.hypervisorType = Hypervisor.HypervisorType.VMware;
44+
this.instanceName = instanceName;
45+
}
46+
47+
public RemoteInstanceTO(String instanceName, String vcenterHost, String vcenterUsername, String vcenterPassword, String datacenterName) {
4748
this.hypervisorType = Hypervisor.HypervisorType.VMware;
48-
this.hostName = hostName;
4949
this.instanceName = instanceName;
5050
this.vcenterHost = vcenterHost;
51-
this.datacenterName = datacenterName;
52-
this.clusterName = clusterName;
5351
this.vcenterUsername = vcenterUsername;
5452
this.vcenterPassword = vcenterPassword;
53+
this.datacenterName = datacenterName;
5554
}
5655

5756
public Hypervisor.HypervisorType getHypervisorType() {
@@ -62,10 +61,6 @@ public String getInstanceName() {
6261
return this.instanceName;
6362
}
6463

65-
public String getHostName() {
66-
return this.hostName;
67-
}
68-
6964
public String getVcenterUsername() {
7065
return vcenterUsername;
7166
}
@@ -81,8 +76,4 @@ public String getVcenterHost() {
8176
public String getDatacenterName() {
8277
return datacenterName;
8378
}
84-
85-
public String getClusterName() {
86-
return clusterName;
87-
}
8879
}

api/src/main/java/com/cloud/event/EventTypes.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import org.apache.cloudstack.api.response.ZoneResponse;
3030
import org.apache.cloudstack.config.Configuration;
3131
import org.apache.cloudstack.ha.HAConfig;
32+
import org.apache.cloudstack.quota.QuotaTariff;
3233
import org.apache.cloudstack.storage.object.Bucket;
3334
import org.apache.cloudstack.storage.object.ObjectStore;
34-
import org.apache.cloudstack.quota.QuotaTariff;
3535
import org.apache.cloudstack.usage.Usage;
3636
import org.apache.cloudstack.vm.schedule.VMSchedule;
3737

@@ -451,6 +451,7 @@ public class EventTypes {
451451
public static final String EVENT_ENABLE_PRIMARY_STORAGE = "ENABLE.PS";
452452
public static final String EVENT_DISABLE_PRIMARY_STORAGE = "DISABLE.PS";
453453
public static final String EVENT_SYNC_STORAGE_POOL = "SYNC.STORAGE.POOL";
454+
public static final String EVENT_CHANGE_STORAGE_POOL_SCOPE = "CHANGE.STORAGE.POOL.SCOPE";
454455

455456
// VPN
456457
public static final String EVENT_REMOTE_ACCESS_VPN_CREATE = "VPN.REMOTE.ACCESS.CREATE";
@@ -721,6 +722,8 @@ public class EventTypes {
721722

722723
// SystemVM
723724
public static final String EVENT_LIVE_PATCH_SYSTEMVM = "LIVE.PATCH.SYSTEM.VM";
725+
//Purge resources
726+
public static final String EVENT_PURGE_EXPUNGED_RESOURCES = "PURGE.EXPUNGED.RESOURCES";
724727

725728
// OBJECT STORE
726729
public static final String EVENT_OBJECT_STORE_CREATE = "OBJECT.STORE.CREATE";
@@ -1000,6 +1003,7 @@ public class EventTypes {
10001003
// Primary storage pool
10011004
entityEventDetails.put(EVENT_ENABLE_PRIMARY_STORAGE, StoragePool.class);
10021005
entityEventDetails.put(EVENT_DISABLE_PRIMARY_STORAGE, StoragePool.class);
1006+
entityEventDetails.put(EVENT_CHANGE_STORAGE_POOL_SCOPE, StoragePool.class);
10031007

10041008
// VPN
10051009
entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_CREATE, RemoteAccessVpn.class);
@@ -1229,4 +1233,8 @@ public static Class getEntityClassForEvent(String eventName) {
12291233
public static boolean isVpcEvent(String eventType) {
12301234
return EventTypes.EVENT_VPC_CREATE.equals(eventType) || EventTypes.EVENT_VPC_DELETE.equals(eventType);
12311235
}
1236+
1237+
public static void addEntityEventDetail(String event, Class<?> clazz) {
1238+
entityEventDetails.put(event, clazz);
1239+
}
12321240
}

api/src/main/java/com/cloud/host/Host.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static String[] toStrings(Host.Type... types) {
5454
}
5555
public static final String HOST_UEFI_ENABLE = "host.uefi.enable";
5656
public static final String HOST_VOLUME_ENCRYPTION = "host.volume.encryption";
57+
public static final String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
5758

5859
/**
5960
* @return name of the machine.

0 commit comments

Comments
 (0)