Skip to content

Commit df9cdbe

Browse files
authored
Merge branch 'main' into rename-uservmdetail-vminstancedetail
2 parents ffc009e + fd74895 commit df9cdbe

File tree

324 files changed

+9799
-2846
lines changed

Some content is hidden

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

324 files changed

+9799
-2846
lines changed

.asf.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ github:
5151

5252
collaborators:
5353
- acs-robot
54-
- abh1sar
5554
- gpordeus
5655
- hsato03
5756
- bernardodemarco
5857
- FelipeM525
5958
- lucas-a-martins
6059
- nicoschmdt
60+
- abh1sar
61+
- sudo87
62+
- rosi-shapeblue
6163

6264
protected_branches: ~
6365

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ jobs:
236236
237237
- name: Install Python dependencies
238238
run: |
239-
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid
239+
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid pynose
240240
241241
- name: Install jacoco dependencies
242242
run: |

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Contributing to Apache CloudStack (ACS)
44
Summary
55
-------
66
This document covers how to contribute to the ACS project. ACS uses GitHub PRs to manage code contributions.
7-
These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the ACS project and you will submit a Pull Request for your changes to be added.
7+
These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the ACS project, and you will submit a Pull Request for your changes to be added.
88

9-
_Lets get started!!!_
9+
_Let's get started!!!_
1010

1111
Bug fixes
1212
---------
@@ -26,7 +26,7 @@ No back porting / cherry-picking features to existing branches!
2626

2727
PendingReleaseNotes file
2828
------------------------
29-
When developing a new feature or making a (major) change to a existing feature you are encouraged to append this to the PendingReleaseNotes file so that the Release Manager can
29+
When developing a new feature or making a (major) change to an existing feature you are encouraged to append this to the PendingReleaseNotes file so that the Release Manager can
3030
use this file as a source of information when compiling the Release Notes for a new release.
3131

3232
When adding information to the PendingReleaseNotes file make sure that you write a good and understandable description of the new feature or change which you have developed.
@@ -38,9 +38,9 @@ Fork the code
3838

3939
In your browser, navigate to: [https://github.com/apache/cloudstack](https://github.com/apache/cloudstack)
4040

41-
Fork the repository by clicking on the 'Fork' button on the top right hand side. The fork will happen and you will be taken to your own fork of the repository. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under '**HTTPS** clone URL'. You will paste this URL when doing the following `git clone` command.
41+
Fork the repository by clicking on the 'Fork' button on the top right hand side. The fork will happen, and you will be taken to your own fork of the repository. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under '**HTTPS** clone URL'. You will paste this URL when doing the following `git clone` command.
4242

43-
On your computer, follow these steps to setup a local repository for working on ACS:
43+
On your computer, follow these steps to set up a local repository for working on ACS:
4444

4545
```bash
4646
$ git clone https://github.com/YOUR_ACCOUNT/cloudstack.git
@@ -92,9 +92,9 @@ $ git rebase main
9292
Make a GitHub Pull Request to contribute your changes
9393
-----------------------------------------------------
9494

95-
When you are happy with your changes and you are ready to contribute them, you will create a Pull Request on GitHub to do so. This is done by pushing your local changes to your forked repository (default remote name is `origin`) and then initiating a pull request on GitHub.
95+
When you are happy with your changes, and you are ready to contribute them, you will create a Pull Request on GitHub to do so. This is done by pushing your local changes to your forked repository (default remote name is `origin`) and then initiating a pull request on GitHub.
9696

97-
Please include JIRA id, detailed information about the bug/feature, what all tests are executed, how the reviewer can test this feature etc. Incase of UI PRs, a screenshot is preferred.
97+
Please include JIRA id, detailed information about the bug/feature, what all tests are executed, how the reviewer can test this feature etc. In case of UI PRs, a screenshot is preferred.
9898

9999
> **IMPORTANT:** Make sure you have rebased your `feature_x` branch to include the latest code from `upstream/main` _before_ you do this.
100100

INSTALL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Install tools and dependencies used for development:
2020

2121
Set up Maven (3.6.0):
2222

23-
# wget http://www.us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
24-
# tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /usr/local
23+
# wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
24+
# tar -zxvf apache-maven-3.9.9-bin.tar.gz -C /usr/local
2525
# cd /usr/local
26-
# ln -s apache-maven-3.6.3 maven
26+
# ln -s apache-maven-3.9.9 maven
2727
# echo export M2_HOME=/usr/local/maven >> ~/.bashrc # or .zshrc or .profile
2828
# echo export PATH=/usr/local/maven/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile
2929
# source ~/.bashrc

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,9 @@ protected void processRequest(final Request request, final Link link) {
800800
}
801801
commandsInProgress.incrementAndGet();
802802
try {
803+
if (cmd.isReconcile()) {
804+
cmd.setRequestSequence(request.getSequence());
805+
}
803806
answer = serverResource.executeRequest(cmd);
804807
} finally {
805808
commandsInProgress.decrementAndGet();
@@ -1021,6 +1024,8 @@ private void processPingAnswer(final PingAnswer answer) {
10211024
if ((answer.isSendStartup()) && reconnectAllowed) {
10221025
logger.info("Management server requested startup command to reinitialize the agent");
10231026
sendStartup(link);
1027+
} else {
1028+
serverResource.processPingAnswer((PingAnswer) answer);
10241029
}
10251030
shell.setAvoidHosts(answer.getAvoidMsList());
10261031
}
@@ -1087,6 +1092,9 @@ public void processOtherTask(final Task task) {
10871092
Answer answer = null;
10881093
commandsInProgress.incrementAndGet();
10891094
try {
1095+
if (command.isReconcile()) {
1096+
command.setRequestSequence(req.getSequence());
1097+
}
10901098
answer = serverResource.executeRequest(command);
10911099
} finally {
10921100
commandsInProgress.decrementAndGet();

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,31 @@ public static enum OnError {
3535
Continue, Stop
3636
}
3737

38+
public enum State {
39+
CREATED, // Command is created by management server
40+
STARTED, // Command is started by agent
41+
PROCESSING, // Processing by agent
42+
PROCESSING_IN_BACKEND, // Processing in backend by agent
43+
COMPLETED, // Operation succeeds by agent or management server
44+
FAILED, // Operation fails by agent
45+
RECONCILE_RETRY, // Ready for retry of reconciliation
46+
RECONCILING, // Being reconciled by management server
47+
RECONCILED, // Reconciled by management server
48+
RECONCILE_SKIPPED, // Skip the reconciliation as the resource state is inconsistent with the command
49+
RECONCILE_FAILED, // Fail to reconcile by management server
50+
TIMED_OUT, // Timed out on management server or agent
51+
INTERRUPTED, // Interrupted by management server or agent (for example agent is restarted),
52+
DANGLED_IN_BACKEND // Backend process which cannot be processed normally (for example agent is restarted)
53+
}
54+
3855
public static final String HYPERVISOR_TYPE = "hypervisorType";
3956

4057
// allow command to carry over hypervisor or other environment related context info
4158
@LogLevel(Log4jLevel.Trace)
4259
protected Map<String, String> contextMap = new HashMap<String, String>();
4360
private int wait; //in second
4461
private boolean bypassHostMaintenance = false;
62+
private transient long requestSequence = 0L;
4563

4664
protected Command() {
4765
this.wait = 0;
@@ -82,6 +100,10 @@ public String getContextParam(String name) {
82100
return contextMap.get(name);
83101
}
84102

103+
public Map<String, String> getContextMap() {
104+
return contextMap;
105+
}
106+
85107
public boolean allowCaching() {
86108
return true;
87109
}
@@ -94,6 +116,18 @@ public void setBypassHostMaintenance(boolean bypassHostMaintenance) {
94116
this.bypassHostMaintenance = bypassHostMaintenance;
95117
}
96118

119+
public boolean isReconcile() {
120+
return false;
121+
}
122+
123+
public long getRequestSequence() {
124+
return requestSequence;
125+
}
126+
127+
public void setRequestSequence(long requestSequence) {
128+
this.requestSequence = requestSequence;
129+
}
130+
97131
@Override
98132
public boolean equals(Object o) {
99133
if (this == o) return true;

api/src/main/java/com/cloud/agent/api/to/DiskTO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class DiskTO {
4646
private Long diskSeq;
4747
private String path;
4848
private Volume.Type type;
49-
private Map<String, String> _details;
49+
private Map<String, String> details;
5050

5151
public DiskTO() {
5252

@@ -92,10 +92,10 @@ public void setType(Volume.Type type) {
9292
}
9393

9494
public void setDetails(Map<String, String> details) {
95-
_details = details;
95+
this.details = details;
9696
}
9797

9898
public Map<String, String> getDetails() {
99-
return _details;
99+
return details;
100100
}
101101
}

api/src/main/java/com/cloud/agent/api/to/NetworkTO.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class NetworkTO {
3636
protected TrafficType type;
3737
protected URI broadcastUri;
3838
protected URI isolationUri;
39-
protected boolean isSecurityGroupEnabled;
39+
protected boolean securityGroupEnabled;
4040
protected String name;
4141
protected String ip6address;
4242
protected String ip6gateway;
@@ -112,7 +112,7 @@ public String getName() {
112112
}
113113

114114
public void setSecurityGroupEnabled(boolean enabled) {
115-
this.isSecurityGroupEnabled = enabled;
115+
this.securityGroupEnabled = enabled;
116116
}
117117

118118
/**
@@ -221,7 +221,7 @@ public void setIsolationuri(URI isolationUri) {
221221
}
222222

223223
public boolean isSecurityGroupEnabled() {
224-
return this.isSecurityGroupEnabled;
224+
return this.securityGroupEnabled;
225225
}
226226

227227
public void setIp6Dns1(String ip6Dns1) {

api/src/main/java/com/cloud/agent/api/to/NicTO.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ public void setUuid(String uuid) {
8686
this.nicUuid = uuid;
8787
}
8888

89+
public String getNicUuid() {
90+
return nicUuid;
91+
}
92+
93+
public void setNicUuid(String nicUuid) {
94+
this.nicUuid = nicUuid;
95+
}
96+
8997
@Override
9098
public String toString() {
9199
return new StringBuilder("[Nic:").append(type).append("-").append(ip).append("-").append(broadcastUri).append("]").toString();

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class VirtualMachineTO {
6161
@LogLevel(LogLevel.Log4jLevel.Off)
6262
String vncPassword;
6363
String vncAddr;
64-
Map<String, String> params;
64+
Map<String, String> details;
6565
String uuid;
6666
String bootType;
6767
String bootMode;
@@ -191,7 +191,11 @@ public Integer getMaxSpeed() {
191191
return maxSpeed;
192192
}
193193

194-
public boolean getLimitCpuUse() {
194+
public boolean isEnableHA() {
195+
return enableHA;
196+
}
197+
198+
public boolean isLimitCpuUse() {
195199
return limitCpuUse;
196200
}
197201

@@ -289,11 +293,11 @@ public void setVncAddr(String vncAddr) {
289293
}
290294

291295
public Map<String, String> getDetails() {
292-
return params;
296+
return details;
293297
}
294298

295299
public void setDetails(Map<String, String> params) {
296-
this.params = params;
300+
this.details = params;
297301
}
298302

299303
public String getUuid() {

0 commit comments

Comments
 (0)