Skip to content
Merged
Show file tree
Hide file tree
Changes from 217 commits
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
32fc7f8
Fix Map and String
harikrishna-patnala Mar 27, 2025
73ad1bf
License
harikrishna-patnala Mar 27, 2025
f6ab456
Unit test fix
harikrishna-patnala Mar 27, 2025
8b1ed02
Lint error
harikrishna-patnala Mar 27, 2025
50de0ef
gen doc issue
harikrishna-patnala Mar 27, 2025
659e816
Fix sql
harikrishna-patnala Mar 27, 2025
6aedf94
import issue
harikrishna-patnala Mar 27, 2025
f517c68
Script Fixes
harikrishna-patnala Mar 28, 2025
ed9dff1
Lint error
harikrishna-patnala Mar 28, 2025
a9cb4ad
response added
harikrishna-patnala Mar 30, 2025
c25e85c
Fix restart MS issue and method mappings in provisioner.sh
abh1sar Apr 1, 2025
e23bcb5
Introducing extensions and refactoring framework around it
harikrishna-patnala Apr 30, 2025
5ba592e
gen_toc changes
harikrishna-patnala May 12, 2025
cff3c58
license
harikrishna-patnala May 12, 2025
1422536
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr May 13, 2025
831e125
address review comments
shwstppr May 13, 2025
b4350d9
Fix a bug in finalizeReservation due to which External hypervisor was…
abh1sar May 15, 2025
bf4cc9e
refactor, configurable extension path
shwstppr May 16, 2025
5dcb7aa
fix
shwstppr May 16, 2025
0a16872
unnecessary
shwstppr May 16, 2025
83f5cb8
changes
shwstppr May 19, 2025
f77a2e0
refactor check extensions dir
shwstppr May 19, 2025
54c7073
use java code to prepare scripts
shwstppr May 19, 2025
d2132cb
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr May 19, 2025
3c0086c
backend custom actions changes
shwstppr May 20, 2025
568a61e
Update plugins/hypervisors/external/src/main/java/org/apache/cloudsta…
shwstppr May 22, 2025
069f8f2
UI fix for external details not sent correctly
abh1sar May 26, 2025
0174a13
Fix some NPEs in External Hypervisor framework
abh1sar May 26, 2025
65c3a41
base changes for checkhealthcommand handling
shwstppr May 26, 2025
3553e23
Minor bug fixes in Custom Actions
abh1sar May 29, 2025
26d6641
changes
shwstppr May 29, 2025
f5c4b06
fixes
shwstppr May 29, 2025
06b9eb2
changes, extension ui, events, misc
shwstppr May 30, 2025
0dbab7f
remove unimplemented comments tab for now
shwstppr May 30, 2025
d9d7de2
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr May 30, 2025
086f57e
changes - fix CRUD for ext abd custom actions; ui
shwstppr Jun 2, 2025
b8ff2da
changes
shwstppr Jun 3, 2025
204bc28
fix
shwstppr Jun 3, 2025
0a61f80
ui: fix add cluster
shwstppr Jun 5, 2025
4c64106
ui: add refs in extension forms
shwstppr Jun 5, 2025
adc2a00
ui: fix cluster extension selection
shwstppr Jun 5, 2025
321ff1e
ui: use detailinput in addhost form
shwstppr Jun 5, 2025
44e8024
fix cluster extension register
shwstppr Jun 5, 2025
09da11b
refactor
shwstppr Jun 5, 2025
0e9291c
remove unused config validation
shwstppr Jun 5, 2025
af14f06
ui: fix details and parameters input
shwstppr Jun 5, 2025
ebe3e3e
ui: fix select labels in extension forms
shwstppr Jun 5, 2025
7f80ffb
api: allow list custom actions for resource, run api change
shwstppr Jun 5, 2025
82f88d9
ui: initial work for erun custom action
shwstppr Jun 5, 2025
f52bae2
changes
shwstppr Jun 9, 2025
42c846c
additional commands
shwstppr Jun 9, 2025
070051c
remove unused css
shwstppr Jun 9, 2025
41703c2
pass json file instead
shwstppr Jun 9, 2025
17eb17c
wip changes for extension sync
shwstppr Jun 10, 2025
fd917ab
fix stop vm
shwstppr Jun 10, 2025
238bc19
entrypoint sync ui
shwstppr Jun 10, 2025
08c6f0e
allow actual execution, fix script
shwstppr Jun 10, 2025
eafe9f1
fix addcusotmaction form
shwstppr Jun 10, 2025
6bb936e
fix add host form css
shwstppr Jun 10, 2025
51bd0b1
ui fixes
shwstppr Jun 10, 2025
22fec2a
external planner to adhere arch, enabled clusters
shwstppr Jun 10, 2025
f0c5ecf
prepare entry-point on all MS
shwstppr Jun 10, 2025
cafb5a9
fixes, changes
shwstppr Jun 10, 2025
0a35310
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 11, 2025
0beeeea
wip
shwstppr Jun 11, 2025
34040e8
fix enable-disable
shwstppr Jun 11, 2025
5210121
fix runaction wait
shwstppr Jun 11, 2025
8296d48
ui: fix custom action add/update
shwstppr Jun 11, 2025
abc3943
wip: changes for feedback from demo
shwstppr Jun 13, 2025
2605b51
ui fix
shwstppr Jun 13, 2025
84f25c0
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 13, 2025
dd5568c
Merge branch 'ExternalDeploymentIntegration' into feature-extensions-…
shwstppr Jun 13, 2025
d7c982f
ui: label fixes
shwstppr Jun 13, 2025
945109b
wip: changes for writing files in a known dir
shwstppr Jun 13, 2025
005bd8d
changes for host update, command handling, ui actions control
shwstppr Jun 16, 2025
49318a8
changes for extension data directory
shwstppr Jun 16, 2025
b651d1c
refactor external details in JSON
shwstppr Jun 16, 2025
ef6960c
use default timeout
shwstppr Jun 16, 2025
7e35bdb
ui: fix instance vol snapshot action
shwstppr Jun 16, 2025
8d75f15
remove postprovisioning
shwstppr Jun 16, 2025
28b1b34
change logging
shwstppr Jun 16, 2025
94151b4
keep extensions dir in replace.properties and server.properties.in
abh1sar Jun 13, 2025
e04fba9
builtin extensions initial scripts
abh1sar Jun 13, 2025
685674f
Update proxmox and hyperv scripts
abh1sar Jun 13, 2025
e623d1f
upgrade path to add builtin extensions
abh1sar Jun 13, 2025
849a0e1
remove extensionsDirectory config
abh1sar Jun 13, 2025
4868760
move sample extensions to scripts/vm/hypervisor/external
abh1sar Jun 16, 2025
d5e7670
Package sample extensions for el8
abh1sar Jun 17, 2025
500d649
fix precommit failure in hyperv.py
abh1sar Jun 17, 2025
f1d63c0
revert copy to /etc/cloudstack
abh1sar Jun 17, 2025
b2f04ca
fix minor error in cloud.spec
abh1sar Jun 17, 2025
6f4f4ec
refactor
shwstppr Jun 16, 2025
abae8af
ui fix
shwstppr Jun 16, 2025
21bbae2
Merge branch 'feature-extensions-framework' into ExternalDeploymentIn…
shwstppr Jun 17, 2025
c83d184
refactor reading server.properties for extensions.file.path
shwstppr Jun 17, 2025
751fed6
update column name in insert
shwstppr Jun 17, 2025
6b1fbb5
typo
shwstppr Jun 17, 2025
21bbc63
move extensions data dir under target
shwstppr Jun 17, 2025
e1de17a
do not prepare inbuilt extension
shwstppr Jun 17, 2025
54d0acd
notification title
shwstppr Jun 17, 2025
8c765e3
fixes
shwstppr Jun 17, 2025
c5a48cd
more fix
shwstppr Jun 17, 2025
53c0f46
extensions directory label
shwstppr Jun 17, 2025
3270afd
default location for extensions for dev env
abh1sar Jun 17, 2025
fe79499
rename class member for JSON
shwstppr Jun 17, 2025
2bf6690
only return details that are meant for display
shwstppr Jun 18, 2025
23b7d93
update extension fix
shwstppr Jun 18, 2025
f112ba9
wip: prepare updates VM in a generic way
shwstppr Jun 16, 2025
eee516c
changes
shwstppr Jun 17, 2025
e076a35
ui: show inbuilt tag in infocard
shwstppr Jun 18, 2025
c6dab62
ui: minor refactor
shwstppr Jun 18, 2025
d8bd9de
ui: fix console error
shwstppr Jun 18, 2025
2c59171
ui: enable/disable as separate actions
shwstppr Jun 18, 2025
378d64e
changes for orchestrator prepare using virtualmachineto
shwstppr Jun 18, 2025
049f52c
changes for extension path, refactor
shwstppr Jun 18, 2025
f33a70a
missing license
shwstppr Jun 18, 2025
3644cf4
Move extensions dir to top level. add property extensions.deployment.…
abh1sar Jun 19, 2025
518503d
prepare only on first start
shwstppr Jun 19, 2025
d5f1d72
api,server,ui: changes for host, cluster extensionid
shwstppr Jun 19, 2025
440aba0
minor refactor
shwstppr Jun 19, 2025
34691b2
fixes
shwstppr Jun 19, 2025
76b08a8
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 19, 2025
9b1ca52
refactor
shwstppr Jun 19, 2025
a46873d
fix merge issue
shwstppr Jun 19, 2025
a18682e
build fix
shwstppr Jun 19, 2025
7ab2dc9
error handling and other improvements in proxmox.sh
abh1sar Jun 20, 2025
d205b84
enable destroy for external vms. get deployvm from vmto.
abh1sar Jun 20, 2025
97c8d6f
insert parameters as HashMap into accessDetails in RunCustomAction
abh1sar Jun 20, 2025
2590316
refactor, remove todo
shwstppr Jun 20, 2025
840c1c1
refactor
shwstppr Jun 20, 2025
5836a2d
handle upload todo, move common methods from HypervisorTemplateAdapter
shwstppr Jun 20, 2025
a11cdfb
Add Proxmox custom actions
abh1sar Jun 20, 2025
cb38175
fix pre-commit failure
abh1sar Jun 20, 2025
85101ac
Error handling and custom actions for hyperv
abh1sar Jun 21, 2025
a89a493
Add ExternalEntryPointPayloadProvisionerTest
abh1sar Jun 22, 2025
9e4376d
ExternalEntryPointPayloadProvisionerTest
abh1sar Jun 23, 2025
8cbd28e
changes for vm state, external details
shwstppr Jun 20, 2025
8b0bb7b
assorted changes
shwstppr Jun 23, 2025
7af9868
test: add integration tests
shwstppr Jun 23, 2025
77856d9
ui: fix extensions path
shwstppr Jun 23, 2025
2e77980
fix build
shwstppr Jun 23, 2025
534a56d
fix naming
shwstppr Jun 23, 2025
5280666
add more tests
shwstppr Jun 23, 2025
c248627
more tests
shwstppr Jun 23, 2025
1b92d4a
tests and minor refactor
shwstppr Jun 23, 2025
e56a591
build fix
shwstppr Jun 23, 2025
69ede10
lint eof
shwstppr Jun 23, 2025
6297a42
integration test fix
shwstppr Jun 23, 2025
157e4a5
fix test fail with sudo permissions
shwstppr Jun 23, 2025
eb21fc8
fix
shwstppr Jun 23, 2025
f3b93e6
Remove prepare from proxmox and hyperv. Builtin exts disabled by defa…
abh1sar Jun 23, 2025
54e844c
Added ExtensionCustomActionTest
abh1sar Jun 24, 2025
f7d0fe8
refactor to add more tests
shwstppr Jun 24, 2025
af19e3c
use InvalidParameterValueException, fix integration test failure
shwstppr Jun 24, 2025
35f779b
list all for sync check
shwstppr Jun 24, 2025
2951a67
minor fixes
shwstppr Jun 24, 2025
be99173
ui fixes
shwstppr Jun 24, 2025
cace6cd
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jun 24, 2025
67377c4
show run action result
shwstppr Jun 25, 2025
10a90e8
extensions directory to be owned by cloud:cloud. Also added debian ru…
abh1sar Jun 25, 2025
2abe27a
prepare changes
shwstppr Jun 26, 2025
39c8b16
action name check
shwstppr Jun 26, 2025
ecd517c
get vmid in prepare for proxmox. nic related changes
abh1sar Jun 29, 2025
b54804c
multiple network support in hyperv
abh1sar Jun 29, 2025
b0bb7f4
test fixes
shwstppr Jun 30, 2025
b552c67
change default path sync check to 5mins
shwstppr Jun 30, 2025
b0c7e2e
use path instead of entrypoint, ui changes
shwstppr Jun 30, 2025
3e86874
changes and refactor to fix command deserialization issue
shwstppr Jul 2, 2025
ed2bf1a
Few code improvements
harikrishna-patnala Jul 2, 2025
ed41fcc
fix adding multiple nics in hyperv
abh1sar Jul 1, 2025
e911ffb
Fix debian packaging for built-in extensions
abh1sar Jul 2, 2025
b14fe74
refactor error message
shwstppr Jul 3, 2025
287fe8b
ui: fix serach view
shwstppr Jul 3, 2025
85ed77b
Fix debian packaging for built-in extensions
abh1sar Jul 3, 2025
5018ddc
hyperv misc fixes
abh1sar Jul 4, 2025
b879183
Add extension files to debian .install
abh1sar Jul 4, 2025
017a003
ui: hide delete on builtin extension
shwstppr Jul 4, 2025
e51e340
improvements for extension alert
shwstppr Jul 4, 2025
31e35ff
delete payload files for successful trivial actions
shwstppr Jul 4, 2025
3c5a1f0
Merge branch 'main' into ExternalDeploymentIntegration
shwstppr Jul 4, 2025
7a9e246
fix debian packaging
abh1sar Jul 5, 2025
96dc6cc
Merge remote-tracking branch 'upstream/main' into ExternalDeploymentI…
abh1sar Jul 6, 2025
0d32ddc
fix ui errors after merging
abh1sar Jul 6, 2025
a7efa75
ui: fix passing external details
shwstppr Jul 4, 2025
4b3c2c9
ui: messages for custom actions
shwstppr Jul 4, 2025
72afbc4
ui: change icon
shwstppr Jul 7, 2025
a23cea2
ui: getAPI-postAPI logic
shwstppr Jul 7, 2025
fc0ad49
fix adding multiple external hosts issue
shwstppr Jul 7, 2025
7b1fc3e
refactor: move nsx specific code
shwstppr Jul 7, 2025
ae73f66
template filter
shwstppr Jul 7, 2025
023b7b9
lint
shwstppr Jul 7, 2025
ccd7bcc
hyperv to support winrm protocol and listnsnapshots custom action
abh1sar Jul 7, 2025
1489c0b
conditional print json result as table in custom action
abh1sar Jul 7, 2025
25bbeac
Set timeout in RunCustomActionCommand
abh1sar Jul 7, 2025
5306a46
Proxmox list snapshots
abh1sar Jul 7, 2025
58576af
fix pre-commit
abh1sar Jul 7, 2025
6e162f9
run custom action print string/object as well.
abh1sar Jul 7, 2025
21fd9ab
fix schema errors
abh1sar Jul 8, 2025
321733e
remove unused imports from hyperv.py
abh1sar Jul 8, 2025
ea7be75
rename validate_ssl to verify_tls_certificate
abh1sar Jul 8, 2025
f917a54
remove default extension details from hyperv and proxmox
abh1sar Jul 8, 2025
7c7041b
revert NsxService inject
shwstppr Jul 8, 2025
6eaf626
use printmessage for print_message
shwstppr Jul 8, 2025
57a8ff2
revert eol removal
shwstppr Jul 8, 2025
892a69b
refactor: move nsx code in the plugin (again)
shwstppr Jul 9, 2025
6541ef0
prevent errors in edge case extension unregistered, ms restarted
shwstppr Jul 9, 2025
4d59f36
ui: run custom action improvements
shwstppr Jul 10, 2025
12e4e0e
ui: fix required boolean value issue
shwstppr Jul 16, 2025
842a53d
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jul 16, 2025
e33237c
ui; fix runcutomaction date input
shwstppr Jul 16, 2025
418035a
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jul 16, 2025
aaf75ed
ui: close popup on action complete
shwstppr Jul 17, 2025
bd84a5c
ui: fix date input issue
shwstppr Jul 17, 2025
bdd8105
ui: show, allow host externaldetails update
shwstppr Jul 21, 2025
71e9d2f
filter 'External' hypervisor
shwstppr Jul 22, 2025
58645cd
ui: allow external VM expunge
shwstppr Jul 22, 2025
d14e5d2
ui: do not allow vnf external template
shwstppr Jul 22, 2025
7939d74
ui: only show USER type template
shwstppr Jul 22, 2025
4290367
server: add external hypervisor check for vm related apis
shwstppr Jul 22, 2025
11f1c67
use zero for external host cpu, ram
shwstppr Jul 23, 2025
fa398b9
ui: do not show config details if no details
shwstppr Jul 23, 2025
d1c554c
refactor error messages
shwstppr Jul 23, 2025
adee8d0
server: prevent autoscalevmpolicy with external template
shwstppr Jul 23, 2025
8c5b846
server,ui: prevent non-user templates for External hypervisor
shwstppr Jul 23, 2025
d18dfb2
ui: disable network actions for the external vm
shwstppr Jul 23, 2025
7154a05
fix boolean param value for custom action
shwstppr Jul 23, 2025
62d6843
ui: fix update custom action form shows same action
shwstppr Jul 23, 2025
f2dd216
test fix
shwstppr Jul 23, 2025
75e36b5
prevent commands when extension path is not ready
shwstppr Jul 23, 2025
59bfe2e
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jul 23, 2025
d1ab999
typo fix
shwstppr Jul 23, 2025
1bc3c66
Update ExtensionCustomActionTest.java
shwstppr Jul 23, 2025
c4b50f3
fix customaction logging
shwstppr Jul 24, 2025
b4dd9dc
fix customaction access
shwstppr Jul 24, 2025
c27abcf
test fix
shwstppr Jul 24, 2025
798c165
server: allow vr implement when external vm
shwstppr Jul 24, 2025
ae7e647
Allow expunge of external vms if there are not present on the externa…
abh1sar Jul 24, 2025
1a0e221
Merge remote-tracking branch 'upstream/main' into ExternalDeploymentI…
abh1sar Jul 24, 2025
d9115d6
fix host update form width
shwstppr Jul 24, 2025
0332f4f
ui: fix clearing details
shwstppr Jul 24, 2025
346c8a2
ui: show external details for computeoffering
shwstppr Jul 24, 2025
d88a55a
fix host details wrongly removed
shwstppr Jul 24, 2025
179ae8d
ui: show extensionresourcemap details for resource
shwstppr Jul 25, 2025
7e637c2
ui: do not show unsupported actions for external cluster
shwstppr Jul 25, 2025
249c5ae
api,server,ui: allow updating computeoffering external details
shwstppr Jul 25, 2025
6f4abff
plugins-external: improve payload path
shwstppr Jul 25, 2025
a960a21
fix vm power status
shwstppr Jul 25, 2025
5b81935
Merge remote-tracking branch 'apache/main' into ExternalDeploymentInt…
shwstppr Jul 25, 2025
c25bf9d
make provisioner.sh executable like other scripts - needed for debian
abh1sar Jul 26, 2025
d673742
Merge remote-tracking branch 'upstream/main' into ExternalDeploymentI…
abh1sar Jul 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ jobs:
smoke/test_nested_virtualization
smoke/test_set_sourcenat
smoke/test_webhook_lifecycle
smoke/test_purge_expunged_vms",
smoke/test_purge_expunged_vms
smoke/test_extension_lifecycle
smoke/test_extension_custom_action_lifecycle
smoke/test_extension_custom",
"smoke/test_network
smoke/test_network_acl
smoke/test_network_ipv6
Expand Down
14 changes: 12 additions & 2 deletions api/src/main/java/com/cloud/agent/api/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import java.util.HashMap;
import java.util.Map;

import com.cloud.agent.api.LogLevel.Log4jLevel;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.cloud.agent.api.LogLevel.Log4jLevel;

/**
* implemented by classes that extends the Command class. Command specifies
Expand Down Expand Up @@ -60,6 +61,7 @@
private int wait; //in second
private boolean bypassHostMaintenance = false;
private transient long requestSequence = 0L;
protected Map<String, Map<String, String>> externalDetails;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason these should be called externalDetails, and not just details?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaanHoogland yes, externalDetails is more appropriate here as these are filtered details and used by extensions specific code. Many of the resources already have a details property and would be a bit confusing.
Also, Answer class that extends Command has a member named details


protected Command() {
this.wait = 0;
Expand Down Expand Up @@ -128,6 +130,14 @@
this.requestSequence = requestSequence;
}

public void setExternalDetails(Map<String, Map<String, String>> externalDetails) {

Check warning on line 133 in api/src/main/java/com/cloud/agent/api/Command.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/Command.java#L133

Added line #L133 was not covered by tests
this.externalDetails = externalDetails;
}

public Map<String, Map<String, String>> getExternalDetails() {
return externalDetails;
}

Check warning on line 139 in api/src/main/java/com/cloud/agent/api/Command.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/Command.java#L137-L139

Added lines #L137 - L139 were not covered by tests

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
14 changes: 14 additions & 0 deletions api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.stream.Collectors;

import com.cloud.agent.api.LogLevel;
import com.cloud.network.element.NetworkElement;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachine.Type;
import com.cloud.vm.VmDetailConstants;

public class VirtualMachineTO {
private long id;
Expand Down Expand Up @@ -496,4 +498,16 @@
public String toString() {
return String.format("VM {id: \"%s\", name: \"%s\", uuid: \"%s\", type: \"%s\"}", id, name, uuid, type);
}

public Map<String, String> getExternalDetails() {

Check warning on line 502 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L502

Added line #L502 was not covered by tests
if (details == null) {
return new HashMap<>();

Check warning on line 504 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L504

Added line #L504 was not covered by tests
}
return details.entrySet().stream()
.filter(entry -> entry.getKey().startsWith(VmDetailConstants.EXTERNAL_DETAIL_PREFIX))
.collect(Collectors.toMap(
entry -> entry.getKey().substring(VmDetailConstants.EXTERNAL_DETAIL_PREFIX.length()),

Check warning on line 509 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L506-L509

Added lines #L506 - L509 were not covered by tests
Map.Entry::getValue
));
}

Check warning on line 512 in api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java#L512

Added line #L512 was not covered by tests
}
28 changes: 27 additions & 1 deletion api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.config.Configuration;
import org.apache.cloudstack.datacenter.DataCenterIpv4GuestSubnet;
import org.apache.cloudstack.extension.Extension;
import org.apache.cloudstack.extension.ExtensionCustomAction;
import org.apache.cloudstack.ha.HAConfig;
import org.apache.cloudstack.network.BgpPeer;
import org.apache.cloudstack.network.Ipv4GuestSubnetNetworkMap;
import org.apache.cloudstack.quota.QuotaTariff;
import org.apache.cloudstack.storage.sharedfs.SharedFS;
import org.apache.cloudstack.storage.object.Bucket;
import org.apache.cloudstack.storage.object.ObjectStore;
import org.apache.cloudstack.storage.sharedfs.SharedFS;
import org.apache.cloudstack.usage.Usage;
import org.apache.cloudstack.vm.schedule.VMSchedule;

Expand Down Expand Up @@ -804,11 +806,25 @@ public class EventTypes {
// Management Server
public static final String EVENT_MANAGEMENT_SERVER_REMOVE = "MANAGEMENT.SERVER.REMOVE";

// VM Lease
public static final String VM_LEASE_EXPIRED = "VM.LEASE.EXPIRED";
public static final String VM_LEASE_DISABLED = "VM.LEASE.DISABLED";
public static final String VM_LEASE_CANCELLED = "VM.LEASE.CANCELLED";
public static final String VM_LEASE_EXPIRING = "VM.LEASE.EXPIRING";

// Extension
public static final String EVENT_EXTENSION_CREATE = "EXTENSION.CREATE";
public static final String EVENT_EXTENSION_UPDATE = "EXTENSION.UPDATE";
public static final String EVENT_EXTENSION_DELETE = "EXTENSION.DELETE";
public static final String EVENT_EXTENSION_RESOURCE_REGISTER = "EXTENSION.RESOURCE.REGISTER";
public static final String EVENT_EXTENSION_RESOURCE_UNREGISTER = "EXTENSION.RESOURCE.UNREGISTER";
public static final String EVENT_EXTENSION_CUSTOM_ACTION_ADD = "EXTENSION.CUSTOM.ACTION.ADD";
public static final String EVENT_EXTENSION_CUSTOM_ACTION_UPDATE = "EXTENSION.CUSTOM.ACTION.UPDATE";
public static final String EVENT_EXTENSION_CUSTOM_ACTION_DELETE = "EXTENSION.CUSTOM.ACTION.DELETE";

// Custom Action
public static final String EVENT_CUSTOM_ACTION = "CUSTOM.ACTION";

static {

// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
Expand Down Expand Up @@ -1312,6 +1328,16 @@ public class EventTypes {
entityEventDetails.put(VM_LEASE_EXPIRING, VirtualMachine.class);
entityEventDetails.put(VM_LEASE_DISABLED, VirtualMachine.class);
entityEventDetails.put(VM_LEASE_CANCELLED, VirtualMachine.class);

// Extension
entityEventDetails.put(EVENT_EXTENSION_CREATE, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_UPDATE, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_DELETE, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_RESOURCE_REGISTER, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_RESOURCE_UNREGISTER, Extension.class);
entityEventDetails.put(EVENT_EXTENSION_CUSTOM_ACTION_ADD, ExtensionCustomAction.class);
entityEventDetails.put(EVENT_EXTENSION_CUSTOM_ACTION_UPDATE, ExtensionCustomAction.class);
entityEventDetails.put(EVENT_EXTENSION_CUSTOM_ACTION_DELETE, ExtensionCustomAction.class);
}

public static boolean isNetworkEvent(String eventType) {
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/com/cloud/hypervisor/Hypervisor.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public enum Functionality {
public static final HypervisorType Ovm3 = new HypervisorType("Ovm3", ImageFormat.RAW);
public static final HypervisorType LXC = new HypervisorType("LXC");
public static final HypervisorType Custom = new HypervisorType("Custom", null, EnumSet.of(RootDiskSizeOverride));
public static final HypervisorType External = new HypervisorType("External", null, EnumSet.of(RootDiskSizeOverride));
public static final HypervisorType Any = new HypervisorType("Any"); /*If you don't care about the hypervisor type*/
private final String name;
private final ImageFormat imageFormat;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/network/NetworkModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ public interface NetworkModel {

NicProfile getNicProfile(VirtualMachine vm, long networkId, String broadcastUri);

NicProfile getNicProfile(VirtualMachine vm, Nic nic, DataCenter dataCenter);

Set<Long> getAvailableIps(Network network, String requestedIp);

String getDomainNetworkDomain(long domainId, long zoneId);
Expand Down
9 changes: 6 additions & 3 deletions api/src/main/java/com/cloud/network/NetworkService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.List;
import java.util.Map;

import com.cloud.dc.DataCenter;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.command.admin.address.ReleasePodIpCmdByAdmin;
import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
Expand All @@ -39,13 +38,16 @@
import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
import org.apache.cloudstack.api.response.AcquirePodIpCmdResponse;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;

import com.cloud.agent.api.to.NicTO;
import com.cloud.dc.DataCenter;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network.IpAddresses;
import com.cloud.network.Network.Service;
import com.cloud.network.Networks.TrafficType;
Expand All @@ -57,7 +59,6 @@
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.Nic;
import com.cloud.vm.NicSecondaryIp;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;

/**
* The NetworkService interface is the "public" api to entities that make requests to the orchestration engine
Expand Down Expand Up @@ -270,4 +271,6 @@ Network createPrivateNetwork(String networkName, String displayText, long physic
List<InternalLoadBalancerElementService> getInternalLoadBalancerElements();

boolean handleCksIsoOnNetworkVirtualRouter(Long virtualRouterId, boolean mount) throws ResourceUnavailableException;

String getNicVlanValueForExternalVm(NicTO nic);
}
1 change: 1 addition & 0 deletions api/src/main/java/com/cloud/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static enum ImageFormat {
OVA(true, true, true, "ova"),
VHDX(true, true, true, "vhdx"),
BAREMETAL(false, false, false, "BAREMETAL"),
EXTERNAL(false, false, false, "EXTERNAL"),
VMDK(true, true, false, "vmdk"),
VDI(true, true, false, "vdi"),
TAR(false, false, false, "tar"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,6 @@ public enum TemplateFilter {

CPU.CPUArch getArch();

Long getExtensionId();

}
8 changes: 8 additions & 0 deletions api/src/main/java/com/cloud/vm/VmDetailConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ public interface VmDetailConstants {
String GUEST_CPU_MODE = "guest.cpu.mode";
String GUEST_CPU_MODEL = "guest.cpu.model";

// Lease related
String INSTANCE_LEASE_EXPIRY_DATE = "leaseexpirydate";
String INSTANCE_LEASE_EXPIRY_ACTION = "leaseexpiryaction";
String INSTANCE_LEASE_EXECUTION = "leaseactionexecution";

// External orchestrator related
String MAC_ADDRESS = "mac_address";
String EXPUNGE_EXTERNAL_VM = "expunge.external.vm";
String EXTERNAL_DETAIL_PREFIX = "External:";
String CLOUDSTACK_VM_DETAILS = "cloudstack.vm.details";
String CLOUDSTACK_VLAN = "cloudstack.vlan";
}
27 changes: 27 additions & 0 deletions api/src/main/java/org/apache/cloudstack/acl/RoleType.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import java.util.Collection;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

// Enum for default roles in CloudStack
public enum RoleType {
Expand Down Expand Up @@ -100,6 +103,30 @@
return roleId;
}

public static int toCombinedMask(Collection<RoleType> roles) {
int combinedMask = 0;

Check warning on line 107 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L106-L107

Added lines #L106 - L107 were not covered by tests
if (roles != null) {
for (RoleType role : roles) {
combinedMask |= role.getMask();
}
}
return combinedMask;
}

Check warning on line 114 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L110-L114

Added lines #L110 - L114 were not covered by tests

public static Set<RoleType> fromCombinedMask(int combinedMask) {
Set<RoleType> roles = EnumSet.noneOf(RoleType.class);

Check warning on line 117 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L116-L117

Added lines #L116 - L117 were not covered by tests
for (RoleType roleType : RoleType.values()) {
if ((combinedMask & roleType.getMask()) != 0) {
roles.add(roleType);

Check warning on line 120 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L120

Added line #L120 was not covered by tests
}
}
if (roles.isEmpty()) {
roles.add(Unknown);

Check warning on line 124 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L124

Added line #L124 was not covered by tests
}
return roles;
}

Check warning on line 127 in api/src/main/java/org/apache/cloudstack/acl/RoleType.java

View check run for this annotation

Codecov / codecov/patch

api/src/main/java/org/apache/cloudstack/acl/RoleType.java#L126-L127

Added lines #L126 - L127 were not covered by tests


/**
* This method returns the role account type if the role isn't null, else it returns the default account type.
* */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private AlertType(short type, String name, boolean isDefault) {
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_EXTENSION_PATH_NOT_READY = new AlertType((short)33, "ALERT.TYPE.EXTENSION.PATH.NOT.READY", true);

public short getType() {
return type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public enum ApiCommandResourceType {
QuotaTariff(org.apache.cloudstack.quota.QuotaTariff.class),
KubernetesCluster(com.cloud.kubernetes.cluster.KubernetesCluster.class),
KubernetesSupportedVersion(null),
SharedFS(org.apache.cloudstack.storage.sharedfs.SharedFS.class);
SharedFS(org.apache.cloudstack.storage.sharedfs.SharedFS.class),
Extension(org.apache.cloudstack.extension.Extension.class),
ExtensionCustomAction(org.apache.cloudstack.extension.ExtensionCustomAction.class);

private final Class<?> clazz;

Expand Down
Loading
Loading