Skip to content

Commit 41b3658

Browse files
authored
Merge branch 'main' into disjoint-systemvmtmpl
2 parents 9649e71 + 162c45f commit 41b3658

File tree

223 files changed

+8346
-1254
lines changed

Some content is hidden

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

223 files changed

+8346
-1254
lines changed

PRE-COMMIT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# pre-commit
2+
3+
We run [pre-commit](https://pre-commit.com/) with
4+
[GitHub Actions](https://github.com/apache/cloudstack/blob/main/.github/workflows/linter.yml) so installation on your
5+
local machine is currently optional.
6+
7+
The `pre-commit` [configuration file](https://github.com/apache/cloudstack/blob/main/.pre-commit-config.yaml)
8+
is in the repository root. Before you can run the hooks, you need to have `pre-commit` installed. `pre-commit` is a
9+
[Python package](https://pypi.org/project/pre-commit/).
10+
11+
From the repository root run: `pip install -r requirements-dev.txt` to install `pre-commit` and after you install
12+
`pre-commit` you will then need to install the pre-commit hooks by running `pre-commit install`.
13+
14+
The hooks run when running `git commit` and also from the command line with `pre-commit`. Some of the hooks will auto
15+
fix the code after the hooks fail whilst most will print error messages from the linters. If a hook fails the overall
16+
commit will fail, and you will need to fix the issues or problems and `git add` and `git commit` again. On `git commit`
17+
the hooks will run mostly only against modified files so if you want to test all hooks against all files and when you
18+
are adding a new hook you should always run:
19+
20+
`pre-commit run --all-files`
21+
22+
Sometimes you might need to skip a hook to commit because the hook is stopping you from committing or your computer
23+
might not have all the installation requirements for all the hooks. The `SKIP` variable is comma separated for two or
24+
more hooks:
25+
26+
`SKIP=codespell git commit -m "foo"`
27+
28+
The same applies when running pre-commit:
29+
30+
`SKIP=codespell pre-commit run --all-files`
31+
32+
Occasionally you can have more serious problems when using `pre-commit` with `git commit`. You can use `--no-verify` to
33+
commit and stop `pre-commit` from checking the hooks. For example:
34+
35+
`git commit --no-verify -m "foo"`
36+
37+
If you are having major problems using `pre-commit` you can always uninstall it.
38+
39+
To run a single hook use `pre-commit run --all-files <hook_id>`
40+
41+
For example just run the `codespell` hook:
42+
43+
`pre-commit run --all-files codespell`

agent/conf/agent.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,3 +451,9 @@ iscsi.session.cleanup.enabled=false
451451

452452
# If set to true, creates VMs as full clones of their templates on KVM hypervisor. Creates as linked clones otherwise.
453453
# create.full.clone=false
454+
455+
# Instance conversion TMPDIR env var
456+
#convert.instance.env.tmpdir=
457+
458+
# Instance conversion VIRT_V2V_TMPDIR env var
459+
#convert.instance.env.virtv2v.tmpdir=

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,20 @@ public Property<Integer> getWorkers() {
794794
*/
795795
public static final Property<Boolean> VIRTV2V_VERBOSE_ENABLED = new Property<>("virtv2v.verbose.enabled", false);
796796

797+
/**
798+
* Set env TMPDIR var for virt-v2v Instance Conversion from VMware to KVM
799+
* Data type: String.<br>
800+
* Default value: <code>null</code>
801+
*/
802+
public static final Property<String> CONVERT_ENV_TMPDIR = new Property<>("convert.instance.env.tmpdir", null, String.class);
803+
804+
/**
805+
* Set env VIRT_V2V_TMPDIR var for virt-v2v Instance Conversion from VMware to KVM
806+
* Data type: String.<br>
807+
* Default value: <code>null</code>
808+
*/
809+
public static final Property<String> CONVERT_ENV_VIRTV2V_TMPDIR = new Property<>("convert.instance.env.virtv2v.tmpdir", null, String.class);
810+
797811
/**
798812
* BGP controll CIDR
799813
* Data type: String.<br>

api/src/main/java/com/cloud/offering/DiskOffering.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ enum State {
3737
State getState();
3838

3939
enum DiskCacheMode {
40-
NONE("none"), WRITEBACK("writeback"), WRITETHROUGH("writethrough");
40+
NONE("none"), WRITEBACK("writeback"), WRITETHROUGH("writethrough"), HYPERVISOR_DEFAULT("hypervisor_default");
4141

4242
private final String _diskCacheMode;
4343

@@ -69,6 +69,8 @@ public String toString() {
6969

7070
boolean isCustomized();
7171

72+
boolean isShared();
73+
7274
void setDiskSize(long diskSize);
7375

7476
long getDiskSize();
@@ -99,7 +101,6 @@ public String toString() {
99101

100102
Long getBytesReadRateMaxLength();
101103

102-
103104
void setBytesWriteRate(Long bytesWriteRate);
104105

105106
Long getBytesWriteRate();
@@ -112,7 +113,6 @@ public String toString() {
112113

113114
Long getBytesWriteRateMaxLength();
114115

115-
116116
void setIopsReadRate(Long iopsReadRate);
117117

118118
Long getIopsReadRate();
@@ -133,7 +133,6 @@ public String toString() {
133133

134134
Long getIopsWriteRateMax();
135135

136-
137136
void setIopsWriteRateMaxLength(Long iopsWriteRateMaxLength);
138137

139138
Long getIopsWriteRateMaxLength();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ Volume updateVolume(long volumeId, String path, String state, Long storageId,
180180
*/
181181
boolean doesStoragePoolSupportDiskOfferingTags(StoragePool destPool, String diskOfferingTags);
182182

183+
boolean validateConditionsToReplaceDiskOfferingOfVolume(Volume volume, DiskOffering newDiskOffering, StoragePool destPool);
184+
183185
Volume destroyVolume(long volumeId, Account caller, boolean expunge, boolean forceExpunge);
184186

185187
void destroyVolume(long volumeId);

api/src/main/java/com/cloud/storage/snapshot/SnapshotApiService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public interface SnapshotApiService {
8585
* the command that specifies the volume criteria
8686
* @return list of snapshot policies
8787
*/
88-
Pair<List<? extends SnapshotPolicy>, Integer> listPoliciesforVolume(ListSnapshotPoliciesCmd cmd);
88+
Pair<List<? extends SnapshotPolicy>, Integer> listSnapshotPolicies(ListSnapshotPoliciesCmd cmd);
8989

9090
boolean deleteSnapshotPolicies(DeleteSnapshotPoliciesCmd cmd);
9191

api/src/main/java/com/cloud/storage/snapshot/SnapshotPolicy.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
// under the License.
1717
package com.cloud.storage.snapshot;
1818

19+
import org.apache.cloudstack.acl.ControlledEntity;
1920
import org.apache.cloudstack.api.Displayable;
2021
import org.apache.cloudstack.api.Identity;
2122
import org.apache.cloudstack.api.InternalIdentity;
2223

23-
public interface SnapshotPolicy extends Identity, InternalIdentity, Displayable {
24+
public interface SnapshotPolicy extends ControlledEntity, Identity, InternalIdentity, Displayable {
2425

2526
long getVolumeId();
2627

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import com.cloud.template.VirtualMachineTemplate;
6565
import com.cloud.user.Account;
6666
import com.cloud.uservm.UserVm;
67+
import com.cloud.utils.Pair;
6768
import com.cloud.utils.exception.ExecutionException;
6869

6970
public interface UserVmService {
@@ -538,9 +539,10 @@ UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemp
538539

539540
/**
540541
* Unmanage a guest VM from CloudStack
541-
* @return true if the VM is successfully unmanaged, false if not.
542+
*
543+
* @return (true if successful, false if not, hostUuid) if the VM is successfully unmanaged.
542544
*/
543-
boolean unmanageUserVM(Long vmId);
545+
Pair<Boolean, String> unmanageUserVM(Long vmId, Long targetHostId);
544546

545547
UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws InsufficientCapacityException, ResourceAllocationException, ResourceUnavailableException;
546548

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class ApiConstants {
2727
public static final String ACTIVATION_RULE = "activationrule";
2828
public static final String ACTIVITY = "activity";
2929
public static final String ADAPTER_TYPE = "adaptertype";
30+
public static final String ADDITONAL_CONFIG_ENABLED = "additionalconfigenabled";
3031
public static final String ADDRESS = "address";
3132
public static final String ALGORITHM = "algorithm";
3233
public static final String ALIAS = "alias";
@@ -224,6 +225,7 @@ public class ApiConstants {
224225
public static final String EVENT_TYPE = "eventtype";
225226
public static final String EXPIRES = "expires";
226227
public static final String EXTRA_CONFIG = "extraconfig";
228+
public static final String EXTRA_PARAMS = "extraparams";
227229
public static final String EXTRA_DHCP_OPTION = "extradhcpoption";
228230
public static final String EXTRA_DHCP_OPTION_NAME = "extradhcpoptionname";
229231
public static final String EXTRA_DHCP_OPTION_CODE = "extradhcpoptioncode";
@@ -242,6 +244,8 @@ public class ApiConstants {
242244
public static final String FIRSTNAME = "firstname";
243245
public static final String FORCED = "forced";
244246
public static final String FORCED_DESTROY_LOCAL_STORAGE = "forcedestroylocalstorage";
247+
public static final String FORCE_CONVERT_TO_POOL = "forceconverttopool";
248+
245249
public static final String FORCE_DELETE_HOST = "forcedeletehost";
246250
public static final String FORCE_MS_TO_IMPORT_VM_FILES = "forcemstoimportvmfiles";
247251
public static final String FORCE_UPDATE_OS_TYPE = "forceupdateostype";
@@ -528,6 +532,7 @@ public class ApiConstants {
528532
public static final String SHOW_CAPACITIES = "showcapacities";
529533
public static final String SHOW_REMOVED = "showremoved";
530534
public static final String SHOW_RESOURCE_ICON = "showicon";
535+
public static final String SHOW_COMPLETED = "showcompleted";
531536
public static final String SHOW_INACTIVE = "showinactive";
532537
public static final String SHOW_UNIQUE = "showunique";
533538
public static final String SIGNATURE = "signature";

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public class CreateDiskOfferingCmd extends BaseCmd {
151151
@Parameter(name = ApiConstants.CACHE_MODE,
152152
type = CommandType.STRING,
153153
required = false,
154-
description = "the cache mode to use for this disk offering. none, writeback or writethrough",
154+
description = "the cache mode to use for this disk offering. none, writeback, writethrough or hypervisor default. If the hypervisor default cache mode is used on other hypervisors than KVM, it will fall back to none cache mode",
155155
since = "4.14")
156156
private String cacheMode;
157157

0 commit comments

Comments
 (0)