Skip to content

Commit 8ecc0e1

Browse files
committed
Merge branch 'main' into pre-commit-check-yaml
2 parents 8357258 + 3c9bc07 commit 8ecc0e1

File tree

764 files changed

+30380
-14280
lines changed

Some content is hidden

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

764 files changed

+30380
-14280
lines changed

.asf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ github:
5858
- gpordeus
5959
- hsato03
6060
- bernardodemarco
61+
- abh1sar
6162

6263
protected_branches: ~
6364

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ jobs:
8686
smoke/test_migration
8787
smoke/test_multipleips_per_nic
8888
smoke/test_nested_virtualization
89-
smoke/test_set_sourcenat",
89+
smoke/test_set_sourcenat
90+
smoke/test_webhook_lifecycle
91+
smoke/test_purge_expunged_vms",
9092
"smoke/test_network
9193
smoke/test_network_acl
9294
smoke/test_network_ipv6
@@ -132,6 +134,7 @@ jobs:
132134
smoke/test_usage
133135
smoke/test_usage_events
134136
smoke/test_vm_deployment_planner
137+
smoke/test_vm_strict_host_tags
135138
smoke/test_vm_schedule
136139
smoke/test_vm_life_cycle
137140
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/agent.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,3 +430,6 @@ iscsi.session.cleanup.enabled=false
430430
# If set to "true", the agent will register for libvirt domain events, allowing for immediate updates on crashed or
431431
# unexpectedly stopped. Experimental, requires agent restart.
432432
# libvirt.events.enabled=false
433+
434+
# Implicit host tags managed by agent.properties
435+
# host.tags=

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: 8 additions & 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
*/
@@ -803,6 +803,13 @@ public Property<Integer> getWorkers() {
803803
*/
804804
public static final Property<String> KEYSTORE_PASSPHRASE = new Property<>(KeyStoreUtils.KS_PASSPHRASE_PROPERTY, null, String.class);
805805

806+
/**
807+
* Implicit host tags
808+
* Data type: String.<br>
809+
* Default value: <code>null</code>
810+
*/
811+
public static final Property<String> HOST_TAGS = new Property<>("host.tags", null, String.class);
812+
806813
public static class Property <T>{
807814
private String name;
808815
private T defaultValue;

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
}

0 commit comments

Comments
 (0)