Skip to content

Commit 7814829

Browse files
committed
Merge branch 'main' into nsx-integration
2 parents a357193 + 0bc7fb5 commit 7814829

196 files changed

Lines changed: 15345 additions & 718 deletions

File tree

Some content is hidden

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

.asf.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ github:
4141
features:
4242
wiki: true
4343
issues: true
44+
discussions: true
4445
projects: true
4546

4647
enabled_merge_buttons:
@@ -49,15 +50,21 @@ github:
4950
rebase: false
5051

5152
collaborators:
53+
- acs-robot
5254
- kiranchavala
5355
- rajujith
5456
- alexandremattioli
5557
- vishesh92
5658
- GaOrtiga
57-
- acs-robot
5859
- BryanMLima
5960
- SadiJr
6061
- JoaoJandre
6162
- winterhazel
6263

6364
protected_branches: ~
65+
66+
notifications:
67+
commits: commits@cloudstack.apache.org
68+
issues: commits@cloudstack.apache.org
69+
pullrequests: commits@cloudstack.apache.org
70+
discussions: users@cloudstack.apache.org

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
package com.cloud.agent.properties;
1616

17+
import org.apache.cloudstack.utils.security.KeyStoreUtils;
18+
1719
/**
1820
* Class of constant agent's properties available to configure on
1921
* "agent.properties".
@@ -779,6 +781,13 @@ public Property<Integer> getWorkers() {
779781
*/
780782
public static final Property<Long> KVM_HEARTBEAT_CHECKER_TIMEOUT = new Property<>("kvm.heartbeat.checker.timeout", 360000L);
781783

784+
/**
785+
* Keystore passphrase
786+
* Data type: String.<br>
787+
* Default value: <code>null</code>
788+
*/
789+
public static final Property<String> KEYSTORE_PASSPHRASE = new Property<>(KeyStoreUtils.KS_PASSPHRASE_PROPERTY, null, String.class);
790+
782791
public static class Property <T>{
783792
private String name;
784793
private T defaultValue;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ public class EventTypes {
320320
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
321321
public static final String EVENT_DOMAIN_DELETE = "DOMAIN.DELETE";
322322
public static final String EVENT_DOMAIN_UPDATE = "DOMAIN.UPDATE";
323+
public static final String EVENT_DOMAIN_MOVE = "DOMAIN.MOVE";
323324

324325
// Snapshots
325326
public static final String EVENT_SNAPSHOT_COPY = "SNAPSHOT.COPY";
@@ -878,6 +879,7 @@ public class EventTypes {
878879
entityEventDetails.put(EVENT_DOMAIN_CREATE, Domain.class);
879880
entityEventDetails.put(EVENT_DOMAIN_DELETE, Domain.class);
880881
entityEventDetails.put(EVENT_DOMAIN_UPDATE, Domain.class);
882+
entityEventDetails.put(EVENT_DOMAIN_MOVE, Domain.class);
881883

882884
// Snapshots
883885
entityEventDetails.put(EVENT_SNAPSHOT_CREATE, Snapshot.class);

api/src/main/java/com/cloud/storage/Storage.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,18 @@ public String getFileExtension() {
7777
}
7878

7979
public static enum Capability {
80-
HARDWARE_ACCELERATION("HARDWARE_ACCELERATION");
80+
HARDWARE_ACCELERATION("HARDWARE_ACCELERATION"),
81+
ALLOW_MIGRATE_OTHER_POOLS("ALLOW_MIGRATE_OTHER_POOLS");
8182

8283
private final String capability;
8384

8485
private Capability(String capability) {
8586
this.capability = capability;
8687
}
88+
89+
public String toString() {
90+
return this.capability;
91+
}
8792
}
8893

8994
public static enum ProvisioningType {
@@ -150,7 +155,8 @@ public static enum StoragePoolType {
150155
ManagedNFS(true, false, false),
151156
Linstor(true, true, false),
152157
DatastoreCluster(true, true, false), // for VMware, to abstract pool of clusters
153-
StorPool(true, true, true);
158+
StorPool(true, true, true),
159+
FiberChannel(true, true, false); // Fiber Channel Pool for KVM hypervisors is used to find the volume by WWN value (/dev/disk/by-id/wwn-<wwnvalue>)
154160

155161
private final boolean shared;
156162
private final boolean overprovisioning;

api/src/main/java/com/cloud/user/DomainService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020

2121
import org.apache.cloudstack.api.command.admin.domain.ListDomainChildrenCmd;
2222
import org.apache.cloudstack.api.command.admin.domain.ListDomainsCmd;
23+
import org.apache.cloudstack.api.command.admin.domain.MoveDomainCmd;
2324

2425
import com.cloud.domain.Domain;
2526
import com.cloud.exception.PermissionDeniedException;
27+
import com.cloud.exception.ResourceAllocationException;
2628
import com.cloud.utils.Pair;
2729

2830
public interface DomainService {
@@ -66,4 +68,5 @@ public interface DomainService {
6668
*/
6769
Domain findDomainByIdOrPath(Long id, String domainPath);
6870

71+
Domain moveDomainAndChildrenToNewParentDomain(MoveDomainCmd cmd) throws ResourceAllocationException;
6972
}

api/src/main/java/com/cloud/vm/UserVmService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package com.cloud.vm;
1818

19+
import java.util.LinkedHashMap;
1920
import java.util.List;
2021
import java.util.Map;
2122

@@ -518,7 +519,8 @@ UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException
518519

519520
UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemplate template, final String instanceName, final String displayName, final Account owner, final String userData, final Account caller, final Boolean isDisplayVm, final String keyboard,
520521
final long accountId, final long userId, final ServiceOffering serviceOffering, final String sshPublicKey,
521-
final String hostName, final HypervisorType hypervisorType, final Map<String, String> customParameters, final VirtualMachine.PowerState powerState) throws InsufficientCapacityException;
522+
final String hostName, final HypervisorType hypervisorType, final Map<String, String> customParameters,
523+
final VirtualMachine.PowerState powerState, final LinkedHashMap<String, List<NicProfile>> networkNicMap) throws InsufficientCapacityException;
522524

523525
/**
524526
* Unmanage a guest VM from CloudStack

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public interface VmDetailConstants {
3939
// KVM specific (internal)
4040
String KVM_VNC_PORT = "kvm.vnc.port";
4141
String KVM_VNC_ADDRESS = "kvm.vnc.address";
42+
String KVM_VNC_PASSWORD = "kvm.vnc.password";
4243

4344
// KVM specific, custom virtual GPU hardware
4445
String VIDEO_HARDWARE = "video.hardware";

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public class ApiConstants {
212212
public static final String HOST_IDS = "hostids";
213213
public static final String HOST_IP = "hostip";
214214
public static final String HOST_NAME = "hostname";
215+
public static final String HOST = "host";
215216
public static final String HOST_CONTROL_STATE = "hostcontrolstate";
216217
public static final String HOSTS_MAP = "hostsmap";
217218
public static final String HYPERVISOR = "hypervisor";
@@ -1079,7 +1080,9 @@ public class ApiConstants {
10791080
public static final String SOURCE_NAT_IP_ID = "sourcenatipaddressid";
10801081
public static final String HAS_RULES = "hasrules";
10811082
public static final String NSX_DETAIL_KEY = "forNsx";
1083+
public static final String DISK_PATH = "diskpath";
10821084
public static final String IMPORT_SOURCE = "importsource";
1085+
public static final String TEMP_PATH = "temppath";
10831086
public static final String OBJECT_STORAGE = "objectstore";
10841087
public static final String HEURISTIC_RULE = "heuristicrule";
10851088
public static final String HEURISTIC_TYPE_VALID_OPTIONS = "Valid options are: ISO, SNAPSHOT, TEMPLATE and VOLUME.";
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.api.command.admin.domain;
18+
19+
import com.cloud.domain.Domain;
20+
import com.cloud.exception.ResourceAllocationException;
21+
import com.cloud.user.Account;
22+
import org.apache.cloudstack.acl.RoleType;
23+
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiConstants;
25+
import org.apache.cloudstack.api.ApiErrorCode;
26+
import org.apache.cloudstack.api.BaseCmd;
27+
import org.apache.cloudstack.api.Parameter;
28+
import org.apache.cloudstack.api.ServerApiException;
29+
import org.apache.cloudstack.api.response.DomainResponse;
30+
31+
@APICommand(name = "moveDomain", description = "Moves a domain and its children to a new parent domain.", since = "4.19.0.0", responseObject = DomainResponse.class,
32+
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, authorized = {RoleType.Admin})
33+
public class MoveDomainCmd extends BaseCmd {
34+
35+
private static final String APINAME = "moveDomain";
36+
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class, description = "The ID of the domain to be moved.")
37+
private Long domainId;
38+
39+
@Parameter(name = ApiConstants.PARENT_DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class,
40+
description = "The ID of the new parent domain of the domain to be moved.")
41+
private Long parentDomainId;
42+
43+
public Long getDomainId() {
44+
return domainId;
45+
}
46+
47+
public Long getParentDomainId() {
48+
return parentDomainId;
49+
}
50+
51+
@Override
52+
public String getCommandName() {
53+
return APINAME.toLowerCase() + BaseCmd.RESPONSE_SUFFIX;
54+
}
55+
56+
@Override
57+
public long getEntityOwnerId() {
58+
return Account.ACCOUNT_ID_SYSTEM;
59+
}
60+
61+
@Override
62+
public void execute() throws ResourceAllocationException {
63+
Domain domain = _domainService.moveDomainAndChildrenToNewParentDomain(this);
64+
65+
if (domain != null) {
66+
DomainResponse response = _responseGenerator.createDomainResponse(domain);
67+
response.setResponseName(getCommandName());
68+
this.setResponseObject(response);
69+
} else {
70+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to move the domain.");
71+
}
72+
}
73+
}

api/src/main/java/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command.admin.storage;
1818

1919
import java.util.List;
20+
import java.util.Map;
2021

2122
import org.apache.cloudstack.api.ApiCommandResourceType;
2223
import org.apache.log4j.Logger;
@@ -32,6 +33,7 @@
3233
import com.cloud.storage.StoragePool;
3334
import com.cloud.user.Account;
3435

36+
@SuppressWarnings("rawtypes")
3537
@APICommand(name = "updateStoragePool", description = "Updates a storage pool.", responseObject = StoragePoolResponse.class, since = "3.0.0",
3638
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
3739
public class UpdateStoragePoolCmd extends BaseCmd {
@@ -61,6 +63,20 @@ public class UpdateStoragePoolCmd extends BaseCmd {
6163
" enable it back.")
6264
private Boolean enabled;
6365

66+
@Parameter(name = ApiConstants.DETAILS,
67+
type = CommandType.MAP,
68+
required = false,
69+
description = "the details for the storage pool",
70+
since = "4.19.0")
71+
private Map details;
72+
73+
@Parameter(name = ApiConstants.URL,
74+
type = CommandType.STRING,
75+
required = false,
76+
description = "the URL of the storage pool",
77+
since = "4.19.0")
78+
private String url;
79+
6480
@Parameter(name = ApiConstants.IS_TAG_A_RULE, type = CommandType.BOOLEAN, description = ApiConstants.PARAMETER_DESCRIPTION_IS_TAG_A_RULE)
6581
private Boolean isTagARule;
6682

@@ -115,6 +131,22 @@ public ApiCommandResourceType getApiResourceType() {
115131
return ApiCommandResourceType.StoragePool;
116132
}
117133

134+
public Map<String,String> getDetails() {
135+
return details;
136+
}
137+
138+
public void setDetails(Map<String,String> details) {
139+
this.details = details;
140+
}
141+
142+
public String getUrl() {
143+
return url;
144+
}
145+
146+
public void setUrl(String url) {
147+
this.url = url;
148+
}
149+
118150
@Override
119151
public void execute() {
120152
StoragePool result = _storageService.updateStoragePool(this);

0 commit comments

Comments
 (0)