Skip to content

Commit 0df674f

Browse files
authored
Merge pull request #26 from jschoiRR/ablestack-diplo
2 parents 601445c + c5b55a2 commit 0df674f

File tree

155 files changed

+3348
-2530
lines changed

Some content is hidden

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

155 files changed

+3348
-2530
lines changed

.asf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ github:
5858
- acs-robot
5959
- BryanMLima
6060
- SadiJr
61+
- JoaoJandre
6162

6263
protected_branches: ~

.github/linters/.flake8

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
# E112 Expected an indented block
19+
# E113 Unexpected indentation
20+
# E133 Closing bracket is missing indentation
1821
# E223 Tab before operator
1922
# E224 Tab after operator
23+
# E227 Missing whitespace around bitwise or shift operator
2024
# E242 Tab after ','
2125
# E273 Tab after keyword
2226
# E274 Tab before keyword
@@ -30,4 +34,7 @@
3034
# W391 Blank line at end of file
3135

3236
[flake8]
33-
select = E223,E224,E242,E273,E274,E742,E743,E901,E902,W291,W292,W293,W391
37+
exclude =
38+
.git,
39+
venv
40+
select = E112,E113,E133,E223,E224,E227,E242,E273,E274,E742,E743,E901,E902,W291,W292,W293,W391

.github/workflows/sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ concurrency:
2929

3030
jobs:
3131
build:
32-
if: github.repository == 'apache/cloudstack'
32+
if: github.repository == 'apache/cloudstack' && github.event.pull_request.head.repo.full_name == github.repository
3333
name: Sonar JaCoCo Coverage
3434
runs-on: ubuntu-22.04
3535
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
#- id: check-added-large-files
3232
- id: check-case-conflict
3333
#- id: check-executables-have-shebangs
34-
#- id: check-merge-conflict
34+
- id: check-merge-conflict
3535
- id: check-vcs-permalinks
3636
#- id: check-yaml
3737
- id: detect-private-key

agent/conf/agent.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ hypervisor.type=kvm
279279
# If this parameter is used, property host.overcommit.mem.mb must be set to 0.
280280
#host.reserved.mem.mb=1024
281281

282+
# Number of CPU cores to subtract from advertised available cores.
283+
# These are reserved for system activity, or otherwise share host CPU resources with
284+
# CloudStack VM allocation.
285+
# host.reserved.cpu.count = 0
286+
282287
# The model of Watchdog timer to present to the Guest.
283288
# For all models refer to the libvirt documentation.
284289
#vm.watchdog.model=i6300esb

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
import javax.naming.ConfigurationException;
4242

43+
import com.cloud.resource.AgentStatusUpdater;
44+
import com.cloud.resource.ResourceStatusUpdater;
4345
import com.cloud.utils.NumbersUtil;
4446
import org.apache.cloudstack.agent.lb.SetupMSListAnswer;
4547
import org.apache.cloudstack.agent.lb.SetupMSListCommand;
@@ -100,7 +102,7 @@
100102
* For more configuration options, see the individual types.
101103
*
102104
**/
103-
public class Agent implements HandlerFactory, IAgentControl {
105+
public class Agent implements HandlerFactory, IAgentControl, AgentStatusUpdater {
104106
protected static Logger s_logger = Logger.getLogger(Agent.class);
105107

106108
public enum ExitStatus {
@@ -409,6 +411,20 @@ public void scheduleWatch(final Link link, final Request request, final long del
409411
}
410412
}
411413

414+
public void triggerUpdate() {
415+
PingCommand command = _resource.getCurrentStatus(getId());
416+
command.setOutOfBand(true);
417+
s_logger.debug("Sending out of band ping");
418+
419+
final Request request = new Request(_id, -1, command, false);
420+
request.setSequence(getNextSequence());
421+
try {
422+
_link.send(request.toBytes());
423+
} catch (final ClosedChannelException e) {
424+
s_logger.warn("Unable to send ping update: " + request.toString());
425+
}
426+
}
427+
412428
protected void cancelTasks() {
413429
synchronized (_watchList) {
414430
for (final WatchTask task : _watchList) {
@@ -461,6 +477,10 @@ public void sendStartup(final Link link) {
461477
} catch (final ClosedChannelException e) {
462478
s_logger.warn("Unable to send request: " + request.toString());
463479
}
480+
481+
if (_resource instanceof ResourceStatusUpdater) {
482+
((ResourceStatusUpdater) _resource).registerStatusUpdater(this);
483+
}
464484
}
465485
}
466486

agent/src/main/java/com/cloud/agent/dhcp/FakeDhcpSnooper.java

Lines changed: 0 additions & 161 deletions
This file was deleted.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,15 @@ public class AgentProperties{
502502
*/
503503
public static final Property<Integer> HOST_RESERVED_MEM_MB = new Property<>("host.reserved.mem.mb", 1024);
504504

505+
/**
506+
* How many host CPUs to reserve for non-allocation.<br>
507+
* This can be used to set aside CPU cores on the host for other tasks, such as running hyperconverged storage<br>
508+
* processes, etc.
509+
* Data type: Integer.<br>
510+
* Default value: <code>0</code>
511+
*/
512+
public static final Property<Integer> HOST_RESERVED_CPU_CORE_COUNT = new Property<>("host.reserved.cpu.count", 0);
513+
505514
/**
506515
* The model of Watchdog timer to present to the Guest.<br>
507516
* For all models refer to the libvirt documentation.<br>

0 commit comments

Comments
 (0)