Skip to content

Commit 5817bbe

Browse files
committed
Merge branch 'master' into prevent_null_pointer_on_consecutive_vm_migrates
2 parents 3df49a8 + bf62661 commit 5817bbe

File tree

2,048 files changed

+217843
-260251
lines changed

Some content is hidden

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

2,048 files changed

+217843
-260251
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
system
1+
3.6

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ jdk:
2525
- openjdk11
2626

2727
python:
28-
- "2.7"
28+
- "3.9"
29+
30+
node_js:
31+
- 12
2932

3033
cache:
3134
directories:
3235
- $HOME/.m2
3336
timeout: 500
37+
npm: false
3438

3539
notifications:
3640
email: false
@@ -160,6 +164,7 @@ env:
160164

161165
- TESTS="component/test_project_usage
162166
component/test_protocol_number_security_group
167+
component/test_public_ip
163168
component/test_resource_limits"
164169

165170
- TESTS="component/test_regions_accounts

CONTRIBUTING.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Bug fixes
1414
It's very important that we can easily track bug fix commits, so their hashes should remain the same in all branches.
1515
Therefore, a pull request (PR) that fixes a bug, should be sent against a release branch.
1616
This can be either the "current release" or the "previous release", depending on which ones are maintained.
17-
Since the goal is a stable master, bug fixes should be "merged forward" to the next branch in order: "previous release" -> "current release" -> master (in other words: old to new)
17+
Since the goal is a stable main, bug fixes should be "merged forward" to the next branch in order: "previous release" -> "current release" -> main (in other words: old to new)
1818

1919
Developing new features
2020
-----------------------
2121

22-
Development should be done in a feature branch, branched off of master.
23-
Send a PR(steps below) to get it into master (2x LGTM applies).
24-
PR will only be merged when master is open, will be held otherwise until master is open again.
22+
Development should be done in a feature branch, branched off of main.
23+
Send a PR(steps below) to get it into main (2x LGTM applies).
24+
PR will only be merged when main is open, will be held otherwise until main is open again.
2525
No back porting / cherry-picking features to existing branches!
2626

2727
PendingReleaseNotes file
@@ -46,17 +46,17 @@ On your computer, follow these steps to setup a local repository for working on
4646
$ git clone https://github.com/YOUR_ACCOUNT/cloudstack.git
4747
$ cd cloudstack
4848
$ git remote add upstream https://github.com/apache/cloudstack.git
49-
$ git checkout master
49+
$ git checkout main
5050
$ git fetch upstream
51-
$ git rebase upstream/master
51+
$ git rebase upstream/main
5252
```
5353

5454

5555
Making changes
5656
--------------
5757

5858

59-
It is important that you create a new branch to make changes on and that you do not change the `master` branch (other than to rebase in changes from `upstream/master`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the ACS project.
59+
It is important that you create a new branch to make changes on and that you do not change the `main` branch (other than to rebase in changes from `upstream/main`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the ACS project.
6060

6161
It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.
6262

@@ -71,26 +71,26 @@ $ git commit -a -m "descriptive commit message for your changes"
7171
> The `-b` specifies that you want to create a new branch called `feature_x`. You only specify `-b` the first time you checkout because you are creating a new branch. Once the `feature_x` branch exists, you can later switch to it with only `git checkout feature_x`.
7272
7373

74-
Rebase `feature_x` to include updates from `upstream/master`
74+
Rebase `feature_x` to include updates from `upstream/main`
7575
------------------------------------------------------------
7676

77-
It is important that you maintain an up-to-date `master` branch in your local repository. This is done by rebasing in the code changes from `upstream/master` (the official ACS project repository) into your local repository. You will want to do this before you start working on a feature as well as right before you submit your changes as a pull request. I recommend you do this process periodically while you work to make sure you are working off the most recent project code.
77+
It is important that you maintain an up-to-date `main` branch in your local repository. This is done by rebasing in the code changes from `upstream/main` (the official ACS project repository) into your local repository. You will want to do this before you start working on a feature as well as right before you submit your changes as a pull request. I recommend you do this process periodically while you work to make sure you are working off the most recent project code.
7878

7979
This process will do the following:
8080

81-
1. Checkout your local `master` branch
82-
2. Synchronize your local `master` branch with the `upstream/master` so you have all the latest changes from the project
81+
1. Checkout your local `main` branch
82+
2. Synchronize your local `main` branch with the `upstream/main` so you have all the latest changes from the project
8383
3. Rebase the latest project code into your `feature_x` branch so it is up-to-date with the upstream code
8484

8585
``` bash
86-
$ git checkout master
86+
$ git checkout main
8787
$ git fetch upstream
88-
$ git rebase upstream/master
88+
$ git rebase upstream/main
8989
$ git checkout feature_x
90-
$ git rebase master
90+
$ git rebase main
9191
```
9292

93-
> Now your `feature_x` branch is up-to-date with all the code in `upstream/master`.
93+
> Now your `feature_x` branch is up-to-date with all the code in `upstream/main`.
9494
9595

9696
Make a GitHub Pull Request to contribute your changes
@@ -100,10 +100,10 @@ When you are happy with your changes and you are ready to contribute them, you w
100100

101101
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.
102102

103-
> **IMPORTANT:** Make sure you have rebased your `feature_x` branch to include the latest code from `upstream/master` _before_ you do this.
103+
> **IMPORTANT:** Make sure you have rebased your `feature_x` branch to include the latest code from `upstream/main` _before_ you do this.
104104
105105
``` bash
106-
$ git push origin master
106+
$ git push origin main
107107
$ git push origin feature_x
108108
```
109109

@@ -113,7 +113,7 @@ To initiate the pull request, do the following:
113113

114114
1. In your browser, navigate to your forked repository: [https://github.com/YOUR_ACCOUNT/cloudstack](https://github.com/YOUR_ACCOUNT/cloudstack)
115115
2. Click the new button called '**Compare & pull request**' that showed up just above the main area in your forked repository
116-
3. Validate the pull request will be into the upstream `master` and will be from your `feature_x` branch
116+
3. Validate the pull request will be into the upstream `main` and will be from your `feature_x` branch
117117
4. Enter a detailed description of the work you have done and then click '**Send pull request**'
118118

119119
If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change and update accordingly.
@@ -122,14 +122,14 @@ If you are requested to make modifications to your proposed changes, make the ch
122122
Cleaning up after a successful pull request
123123
-------------------------------------------
124124

125-
Once the `feature_x` branch has been committed into the `upstream/master` branch, your local `feature_x` branch and the `origin/feature_x` branch are no longer needed. If you want to make additional changes, restart the process with a new branch.
125+
Once the `feature_x` branch has been committed into the `upstream/main` branch, your local `feature_x` branch and the `origin/feature_x` branch are no longer needed. If you want to make additional changes, restart the process with a new branch.
126126

127-
> **IMPORTANT:** Make sure that your changes are in `upstream/master` before you delete your `feature_x` and `origin/feature_x` branches!
127+
> **IMPORTANT:** Make sure that your changes are in `upstream/main` before you delete your `feature_x` and `origin/feature_x` branches!
128128
129129
You can delete these deprecated branches with the following:
130130

131131
``` bash
132-
$ git checkout master
132+
$ git checkout main
133133
$ git branch -D feature_x
134134
$ git push origin :feature_x
135135
```

INSTALL.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,20 @@ 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.0/binaries/apache-maven-3.6.0-bin.tar.gz
24-
# tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local
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
2525
# cd /usr/local
26-
# ln -s apache-maven-3.6.0 maven
26+
# ln -s apache-maven-3.6.3 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
3030

31+
Setup up NodeJS (LTS):
32+
33+
# curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
34+
# sudo yum install nodejs
35+
# sudo npm install -g @vue/cli npm-check-updates
36+
3137
Start the MySQL service:
3238

3339
$ service mysqld start
@@ -130,7 +136,7 @@ To create rpms, install the following extra packages:
130136

131137
# yum -y install rpm-build
132138
# yum -y install ws-commons-util
133-
# yum -y instal gcc
139+
# yum -y install gcc
134140
# yum -y install glibc-devel
135141
# yum -y install MySQL-python
136142

ISSUE_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Verify first that your issue/request is not already reported on GitHub.
3-
Also test if the latest release and master branch are affected too.
3+
Also test if the latest release and main branch are affected too.
44
Always add information AFTER of these HTML comments, but no need to delete the comments.
55
-->
66

@@ -23,7 +23,7 @@ Categorize the issue, e.g. API, VR, VPN, UI, etc.
2323

2424
##### CLOUDSTACK VERSION
2525
<!--
26-
New line separated list of affected versions, commit ID for issues on master branch.
26+
New line separated list of affected versions, commit ID for issues on main branch.
2727
-->
2828

2929
~~~

PULL_REQUEST_TEMPLATE.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## Description
2-
<!--- Describe your changes in detail -->
1+
### Description
2+
3+
This PR...
4+
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
35

46
<!-- For new features, provide link to FS, dev ML discussion etc. -->
57
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
@@ -8,20 +10,42 @@
810
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
911
<!-- Fixes: # -->
1012

11-
## Types of changes
12-
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
13+
<!--- ********************************************************************************* -->
14+
<!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
15+
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
16+
<!--- ********************************************************************************* -->
17+
18+
### Types of changes
19+
1320
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
1421
- [ ] New feature (non-breaking change which adds functionality)
1522
- [ ] Bug fix (non-breaking change which fixes an issue)
1623
- [ ] Enhancement (improves an existing feature and functionality)
1724
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
1825

19-
## Screenshots (if appropriate):
26+
### Feature/Enhancement Scale or Bug Severity
27+
28+
#### Feature/Enhancement Scale
29+
30+
- [ ] Major
31+
- [ ] Minor
32+
33+
#### Bug Severity
34+
35+
- [ ] BLOCKER
36+
- [ ] Critical
37+
- [ ] Major
38+
- [ ] Minor
39+
- [ ] Trivial
40+
41+
42+
### Screenshots (if appropriate):
43+
2044

21-
## How Has This Been Tested?
45+
### How Has This Been Tested?
2246
<!-- Please describe in detail how you tested your changes. -->
2347
<!-- Include details of your testing environment, and the tests you ran to -->
2448
<!-- see how your change affects other areas of the code, etc. -->
2549

2650

27-
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
51+
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Apache CloudStack [![Build Status](https://travis-ci.org/apache/cloudstack.svg?branch=master)](https://travis-ci.org/apache/cloudstack) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apachecloudstack) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=ncloc)](https://sonarcloud.io/dashboard?id=apachecloudstack) ![GitHub language count](https://img.shields.io/github/languages/count/apache/cloudstack.svg) ![GitHub top language](https://img.shields.io/github/languages/top/apache/cloudstack.svg)
1+
# Apache CloudStack [![Build Status](https://travis-ci.org/apache/cloudstack.svg?branch=main)](https://travis-ci.org/apache/cloudstack) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apachecloudstack) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=ncloc)](https://sonarcloud.io/dashboard?id=apachecloudstack) ![GitHub language count](https://img.shields.io/github/languages/count/apache/cloudstack.svg) ![GitHub top language](https://img.shields.io/github/languages/top/apache/cloudstack.svg)
22

33
![Apache CloudStack](tools/logo/apache_cloudstack.png)
44

@@ -58,7 +58,7 @@ via Github pull requests.
5858
* Developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Home)
5959
* [Release notes](http://docs.cloudstack.apache.org/projects/cloudstack-release-notes)
6060
* Design [documents](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Design)
61-
* API [documentation](http://cloudstack.apache.org/docs/api)
61+
* API [documentation](https://cloudstack.apache.org/api.html)
6262
* How to [contribute](CONTRIBUTING.md)
6363

6464
## Getting Involved and Contributing
@@ -81,11 +81,7 @@ Mailing lists:
8181
- [Issues Mailing List](mailto:issues-subscribe@cloudstack.apache.org)
8282
- [Marketing Mailing List](mailto:marketing-subscribe@cloudstack.apache.org)
8383

84-
IRC, join us on irc.freenode.net on:
85-
- `#cloudstack`: General Apache CloudStack conversation and end user support
86-
- `#cloudstack-dev`: Development discussions
87-
88-
Report and/or check bugs on [JIRA](https://issues.apache.org/jira/browse/CLOUDSTACK) and check our
84+
Report and/or check bugs on [Github](https://github.com/apache/cloudstack/issues) and check our
8985
developer [page](http://cloudstack.apache.org/developers.html) for contributing code.
9086

9187
## News and Events

agent/conf/agent.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ hypervisor.type=kvm
143143
# This parameter specifies a directory on the host local storage for temporary storing direct download templates
144144
#direct.download.temporary.download.location=/var/lib/libvirt/images
145145

146+
# This parameter specifies a directory on the host local storage for creating and hosting the config drives
147+
#host.cache.location=/var/cache/cloud
148+
146149
# set the rolling maintenance hook scripts directory
147150
#rolling.maintenance.hooks.dir=/etc/cloudstack/agent/hooks.d
148151

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.15.0.0-SNAPSHOT</version>
27+
<version>4.16.0.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,19 @@ protected void cancelTasks() {
420420
}
421421
}
422422

423+
/**
424+
* Cleanup agent zone properties.
425+
*
426+
* Unset zone, cluster and pod values so that host is not added back
427+
* when service is restarted. This will be set to proper values
428+
* when host is added back
429+
*/
430+
protected void cleanupAgentZoneProperties() {
431+
_shell.setPersistentProperty(null, "zone", "");
432+
_shell.setPersistentProperty(null, "cluster", "");
433+
_shell.setPersistentProperty(null, "pod", "");
434+
}
435+
423436
public synchronized void lockStartupTask(final Link link) {
424437
_startup = new StartupTask(link);
425438
_timer.schedule(_startup, _startupWait);
@@ -603,6 +616,9 @@ protected void processRequest(final Request request, final Link link) {
603616
final ShutdownCommand shutdown = (ShutdownCommand)cmd;
604617
s_logger.debug("Received shutdownCommand, due to: " + shutdown.getReason());
605618
cancelTasks();
619+
if (shutdown.isRemoveHost()) {
620+
cleanupAgentZoneProperties();
621+
}
606622
_reconnectAllowed = false;
607623
answer = new Answer(cmd, true, null);
608624
} else if (cmd instanceof ReadyCommand && ((ReadyCommand)cmd).getDetails() != null) {

0 commit comments

Comments
 (0)