Skip to content

Feature: VM Scheduler#7397

Merged
yadvr merged 37 commits intoapache:mainfrom
shapeblue:orchestrated-vm-schedule
Jun 26, 2023
Merged

Feature: VM Scheduler#7397
yadvr merged 37 commits intoapache:mainfrom
shapeblue:orchestrated-vm-schedule

Conversation

@vishesh92
Copy link
Copy Markdown
Member

@vishesh92 vishesh92 commented Apr 4, 2023

Description

This PR adds a feature to setup schedules to stop/start/restart your VMs.

Documentation PR: apache/cloudstack-documentation#313
Related issue: #3387

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

image
image

How Has This Been Tested?

@vishesh92 vishesh92 force-pushed the orchestrated-vm-schedule branch 4 times, most recently from 852e8ce to f2e0809 Compare April 17, 2023 04:50
@yadvr yadvr added this to the 4.19.0.0 milestone Apr 17, 2023
@vishesh92 vishesh92 marked this pull request as ready for review April 19, 2023 12:58
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2023

Codecov Report

Merging #7397 (c2ba181) into main (0466bf9) will increase coverage by 0.06%.
The diff coverage is 48.57%.

@@             Coverage Diff              @@
##               main    #7397      +/-   ##
============================================
+ Coverage     13.23%   13.30%   +0.06%     
- Complexity     9212     9255      +43     
============================================
  Files          2728     2735       +7     
  Lines        257335   257825     +490     
  Branches      40117    40167      +50     
============================================
+ Hits          34053    34293     +240     
- Misses       218991   219214     +223     
- Partials       4291     4318      +27     
Impacted Files Coverage Δ
.../cloudstack/vm/schedule/dao/VMScheduleDaoImpl.java 0.00% <0.00%> (ø)
...udstack/vm/schedule/dao/VMScheduledJobDaoImpl.java 0.00% <0.00%> (ø)
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 8.06% <0.00%> (-0.01%) ⬇️
...org/apache/cloudstack/vm/schedule/VMScheduler.java 0.00% <0.00%> (ø)
...rg/apache/cloudstack/vm/schedule/VMScheduleVO.java 26.19% <26.19%> (ø)
...pache/cloudstack/vm/schedule/VMScheduledJobVO.java 36.84% <36.84%> (ø)
...apache/cloudstack/vm/schedule/VMSchedulerImpl.java 50.24% <50.24%> (ø)
.../cloudstack/vm/schedule/VMScheduleManagerImpl.java 74.84% <74.84%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yadvr yadvr requested review from nvazquez, shwstppr and yadvr April 21, 2023 08:37
@vishesh92 vishesh92 force-pushed the orchestrated-vm-schedule branch from 4075398 to 53fdfe2 Compare April 21, 2023 09:32
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

@vishesh92 Looks promising. Some comments

@@ -0,0 +1,412 @@
// Licensed to the Apache Software Foundation (ASF) under one
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be called InstanceSchedules or something for clarity?

Comment on lines +170 to +200
/*
TODO: Check if we should use schedule or scheduleAtFixedRate here?
scheduleAtFixedRate can result in issues if the task is taking more than 1 minute
schedule might result in skipping of some scheduled jobs
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Address todo or remove

@vishesh92 vishesh92 force-pushed the orchestrated-vm-schedule branch 2 times, most recently from e2b1b1f to e71a68c Compare April 24, 2023 19:56
@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 20 Code Smells

34.1% 34.1% Coverage
1.6% 1.6% Duplication

@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5976

@shwstppr
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@vishesh92 vishesh92 force-pushed the orchestrated-vm-schedule branch from 6524b6c to c2ba181 Compare June 22, 2023 20:48
@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6315

@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@apache apache deleted a comment from blueorangutan Jun 23, 2023
@apache apache deleted a comment from vishesh92 Jun 23, 2023
@apache apache deleted a comment from blueorangutan Jun 23, 2023
@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-6827)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42275 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7397-t6827-kvm-centos7.zip
Smoke tests completed. 111 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_migrate_VM_and_root_volume Error 77.72 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 51.35 test_vm_life_cycle.py

@yadvr yadvr merged commit fa3f2a7 into apache:main Jun 26, 2023
@yadvr yadvr deleted the orchestrated-vm-schedule branch June 26, 2023 08:07
shwstppr added a commit to shapeblue/cloudstack that referenced this pull request Jul 29, 2025
Fixes apache#11175

Behaviour introduced in apache#7397 always validates start-end times during
update even when they are not changed which leads to failure to
enable/disable schedule if the start time has passed.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
weizhouapache pushed a commit that referenced this pull request Sep 9, 2025
…11314)

Fixes #11175

Behaviour introduced in #7397 always validates start-end times during
update even when they are not changed which leads to failure to
enable/disable schedule if the start time has passed.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Sep 15, 2025
…pache#11314)

Fixes apache#11175

Behaviour introduced in apache#7397 always validates start-end times during
update even when they are not changed which leads to failure to
enable/disable schedule if the start time has passed.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants