Skip to content

Commit ee33748

Browse files
Merge branch '4.19' into mysql-distributed-lock
2 parents 9830bbe + a2690e9 commit ee33748

File tree

876 files changed

+20942
-14548
lines changed

Some content is hidden

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

876 files changed

+20942
-14548
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
tests: [ "smoke/test_accounts
38+
smoke/test_account_access
3839
smoke/test_affinity_groups
3940
smoke/test_affinity_groups_projects
4041
smoke/test_annotations
@@ -54,6 +55,7 @@ jobs:
5455
smoke/test_deploy_vm_with_userdata
5556
smoke/test_deploy_vms_in_parallel
5657
smoke/test_deploy_vms_with_varied_deploymentplanners
58+
smoke/test_restore_vm
5759
smoke/test_diagnostics
5860
smoke/test_direct_download
5961
smoke/test_disk_offerings

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/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.19.1.0-SNAPSHOT</version>
27+
<version>4.19.2.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,12 @@ public void doTask(final Task task) throws TaskExecutionException {
11411141
s_logger.error("Error parsing task", e);
11421142
}
11431143
} else if (task.getType() == Task.Type.DISCONNECT) {
1144+
try {
1145+
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
1146+
// wait 5 seconds before reconnecting
1147+
Thread.sleep(5000);
1148+
} catch (InterruptedException e) {
1149+
}
11441150
reconnect(task.getLink());
11451151
return;
11461152
} 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
*/

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.19.1.0-SNAPSHOT</version>
27+
<version>4.19.2.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

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: 7 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";
@@ -1000,6 +1001,7 @@ public class EventTypes {
10001001
// Primary storage pool
10011002
entityEventDetails.put(EVENT_ENABLE_PRIMARY_STORAGE, StoragePool.class);
10021003
entityEventDetails.put(EVENT_DISABLE_PRIMARY_STORAGE, StoragePool.class);
1004+
entityEventDetails.put(EVENT_CHANGE_STORAGE_POOL_SCOPE, StoragePool.class);
10031005

10041006
// VPN
10051007
entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_CREATE, RemoteAccessVpn.class);
@@ -1229,4 +1231,8 @@ public static Class getEntityClassForEvent(String eventName) {
12291231
public static boolean isVpcEvent(String eventType) {
12301232
return EventTypes.EVENT_VPC_CREATE.equals(eventType) || EventTypes.EVENT_VPC_DELETE.equals(eventType);
12311233
}
1234+
1235+
public static void addEntityEventDetail(String event, Class<?> clazz) {
1236+
entityEventDetails.put(event, clazz);
1237+
}
12321238
}

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.

api/src/main/java/com/cloud/hypervisor/HypervisorGuru.java

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.cloudstack.framework.config.ConfigKey;
2424

2525
import com.cloud.agent.api.Command;
26+
import com.cloud.agent.api.to.DataStoreTO;
2627
import com.cloud.agent.api.to.NicTO;
2728
import com.cloud.agent.api.to.VirtualMachineTO;
2829
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -101,21 +102,20 @@ boolean attachRestoredVolumeToVirtualMachine(long zoneId, String location, Backu
101102
* Will generate commands to migrate a vm to a pool. For now this will only work for stopped VMs on Vmware.
102103
*
103104
* @param vm the stopped vm to migrate
104-
* @param destination the primary storage pool to migrate to
105+
* @param volumeToPool the primary storage pools to migrate to
105106
* @return a list of commands to perform for a successful migration
106107
*/
107108
List<Command> finalizeMigrate(VirtualMachine vm, Map<Volume, StoragePool> volumeToPool);
108109

109110

110111
/**
111-
* Will perform a clone of a VM on an external host (if the guru can handle)
112+
* Will return the hypervisor VM (clone VM for PowerOn VMs), performs a clone of a VM if required on an external host (if the guru can handle)
112113
* @param hostIp VM's source host IP
113-
* @param vmName name of the source VM to clone from
114+
* @param vmName name of the source VM (clone VM name if cloned)
114115
* @param params hypervisor specific additional parameters
115-
* @return a reference to the cloned VM
116+
* @return a reference to the hypervisor or cloned VM, and cloned flag
116117
*/
117-
UnmanagedInstanceTO cloneHypervisorVMOutOfBand(String hostIp, String vmName,
118-
Map<String, String> params);
118+
Pair<UnmanagedInstanceTO, Boolean> getHypervisorVMOutOfBandAndCloneIfRequired(String hostIp, String vmName, Map<String, String> params);
119119

120120
/**
121121
* Removes a VM created as a clone of a VM on an external host
@@ -124,6 +124,23 @@ UnmanagedInstanceTO cloneHypervisorVMOutOfBand(String hostIp, String vmName,
124124
* @param params hypervisor specific additional parameters
125125
* @return true if the operation succeeds, false if not
126126
*/
127-
boolean removeClonedHypervisorVMOutOfBand(String hostIp, String vmName,
128-
Map<String, String> params);
127+
boolean removeClonedHypervisorVMOutOfBand(String hostIp, String vmName, Map<String, String> params);
128+
129+
/**
130+
* Create an OVA/OVF template of a VM on an external host (if the guru can handle)
131+
* @param hostIp VM's source host IP
132+
* @param vmName name of the source VM to create template from
133+
* @param params hypervisor specific additional parameters
134+
* @param templateLocation datastore to create the template file
135+
* @return the created template dir/name
136+
*/
137+
String createVMTemplateOutOfBand(String hostIp, String vmName, Map<String, String> params, DataStoreTO templateLocation, int threadsCountToExportOvf);
138+
139+
/**
140+
* Removes the template on the location
141+
* @param templateLocation datastore to remove the template file
142+
* @param templateDir the template dir to remove from datastore
143+
* @return true if the operation succeeds, false if not
144+
*/
145+
boolean removeVMTemplateOutOfBand(DataStoreTO templateLocation, String templateDir);
129146
}

0 commit comments

Comments
 (0)