Skip to content

Conversation

@abh1sar
Copy link
Collaborator

@abh1sar abh1sar commented Sep 29, 2025

Description

Fixes Issues

#11631 : Handle create instance from backup if the template was deleted (273920b)

  • Added Guest OS Type in the backup metadata and giving a warning while creating instance if a template / iso with a different guest OS is selected while creating an instance from backup.
Screenshot 2025-10-09 at 5 36 35 PM

#11746 : Create Instance from Backup on another Zone not showing Zone options for normal Users (35ea878)
Screenshot 2025-09-29 at 6 48 16 PM

#11747 : Reuse IP Address button not showing in Create Instance from Backup (77e9125)
Screenshot 2025-09-29 at 6 46 11 PM
Screenshot 2025-09-29 at 6 46 33 PM

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)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 37.83784% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.55%. Comparing base (6089c16) to head (4bc78e4).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
...rg/apache/cloudstack/backup/BackupManagerImpl.java 57.89% 3 Missing and 5 partials ⚠️
server/src/main/java/com/cloud/api/ApiDBUtils.java 0.00% 5 Missing ⚠️
...loudstack/api/response/BackupOfferingResponse.java 0.00% 3 Missing ⚠️
...apache/cloudstack/api/response/BackupResponse.java 0.00% 3 Missing ⚠️
...e/cloudstack/backup/dao/BackupOfferingDaoImpl.java 0.00% 3 Missing ⚠️
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               main   #11754     +/-   ##
===========================================
  Coverage     17.54%   17.55%             
- Complexity    15469    15521     +52     
===========================================
  Files          5897     5907     +10     
  Lines        527426   528698   +1272     
  Branches      64412    64572    +160     
===========================================
+ Hits          92522    92795    +273     
- Misses       424507   425466    +959     
- Partials      10397    10437     +40     
Flag Coverage Δ
uitests 3.58% <ø> (-0.03%) ⬇️
unittests 18.61% <37.83%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abh1sar
Copy link
Collaborator Author

abh1sar commented Sep 29, 2025

@blueorangutan package

@blueorangutan
Copy link

@abh1sar a [SL] 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

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Sep 29, 2025

@blueorangutan package

@blueorangutan
Copy link

@abh1sar a [SL] 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

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

@abh1sar abh1sar added this to the 4.22.0 milestone Sep 30, 2025
@DaanHoogland DaanHoogland linked an issue Oct 1, 2025 that may be closed by this pull request
abh1sar and others added 2 commits October 7, 2025 17:04
@sureshanaparti sureshanaparti self-assigned this Oct 7, 2025
@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] 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

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Oct 8, 2025

@blueorangutan package

@blueorangutan
Copy link

@abh1sar a [SL] 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

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

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

code LGTM

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] 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

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Oct 11, 2025

@blueorangutan test

@blueorangutan
Copy link

@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14633)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 57856 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11754-t14633-kvm-ol8.zip
Smoke tests completed. 145 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestNASBackupAndRecovery>:setup Error 0.00 test_backup_recovery_nas.py
test_02_enableHumanReadableLogs Error 0.31 test_human_readable_logs.py
test_01_deployVMInSharedNetwork Failure 477.21 test_network.py
test_01_redundant_vpc_site2site_vpn Failure 407.52 test_vpc_vpn.py

@abh1sar
Copy link
Collaborator Author

abh1sar commented Oct 13, 2025

@blueorangutan package

@blueorangutan
Copy link

@abh1sar a [SL] 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

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

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] 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

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Oct 13, 2025

@blueorangutan test keepEnv

@blueorangutan
Copy link

@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@sureshanaparti
Copy link
Contributor

sureshanaparti commented Oct 14, 2025

Manually verified the below tests. LGTM

  • Created instance from backup (with its source template deleted) and not selected any template - Failed with “Unable to find template associated with the backup. Please specify another valid Template/ISO for creating the instance.
  • Created instance from backup (with it’s source template deleted) and selected another available template of same OS type - Pass
  • Created instance from backup (with it’s source template deleted) and selected another available template of different OS type - Pass (Warning is shown on the UI for different OS type template)
InstanceFromBackupOnDiffZone
  • Created Instance from Backup on another Zone using normal user account, with backup on backup repository with Cross Zone enabled - showing Zone options in UI and able to create instance on another Zone - Pass
  • Create Instance from Backup on another Zone using normal user account, with backup on backup repository without Cross Zone enabled - not showing Zone options in UI. With API, Failed with “Internal error executing command, please contact your system administrator” for user admin, and “Create Instance from Backup on another Zone is not supported by this provider or the Backup Repository.” for admin account
  • Created Instance from Backup after expunging the backup instance, and reused IP Address - Pass

API:

  • crosszoneinstancecreation in response parameter in list backupproviderofferings call.
(localcloud) 🐱 > list backupproviderofferings zoneid=222431f6-8ece-47fa-897d-0b36ce188069 
{
  "backupoffering": [
    {
      "allowuserdrivenbackups": true,
      "crosszoneinstancecreation": true,
      "description": "NAS Backup Offering (Repository)",
      "externalid": "3515ee41-0f66-4c2b-84ab-8c298d8f648a",
      "id": "3515ee41-0f66-4c2b-84ab-8c298d8f648a",
      "name": "backuprepo1",
      "provider": "nas"
    },
    {
      "allowuserdrivenbackups": true,
      "description": "NAS Backup Offering (Repository)",
      "externalid": "0157bad3-424f-4caf-8cd9-82c8ded9296a",
      "id": "0157bad3-424f-4caf-8cd9-82c8ded9296a",
      "name": "backuprepo2notcrosszone",
      "provider": "nas"
    }
  ],
  "count": 2
}
  • isbackupvmexpunged response parameter in list backups call.
(localcloud) 🐱 > list backups
{
  "backup": [
    {
      "account": "admin",
      "accountid": "4622c1dd-a4f2-11f0-91dc-1e00e6000357",
      "backupofferingid": "8ccf2e57-e715-419d-9aac-875101adad88",
      "backupofferingname": "backuprepo1",
      "created": "2025-10-14T04:42:15+0000",
      "description": "testvm02-backup01",
      "domain": "ROOT",
      "domainid": "f10c1afc-a4f1-11f0-91dc-1e00e6000357",
      "externalid": "i-2-6-VM/2025.10.14.04.41.49",
      "id": "8101fa92-da07-44f8-b477-d759a41d4d47",
      "intervaltype": "MANUAL",
      "isbackupvmexpunged": true,
      "name": "testvm02-backup01",
      "size": 2093685408,
      "status": "BackedUp",
      "type": "FULL",
      "virtualmachineid": "76682b15-78d1-41df-9714-6d15072610a1",
      "virtualmachinename": "testvm02",
      "virtualsize": 13958643712,
      "vmbackupofferingremoved": true,
      "volumes": "[{\"uuid\":\"d32478d5-84d7-4567-9695-21f6ed2ef110\",\"type\":\"ROOT\",\"size\":8589934592,\"path\":\"d32478d5-84d7-4567-9695-21f6ed2ef110\",\"deviceId\":0,\"diskOfferingId\":\"566ae458-25aa-48af-9761-a1fd0172b1f6\"},{\"uuid\":\"07f8f6f8-6e89-42c0-922f-d1efc71fbbb5\",\"type\":\"DATADISK\",\"size\":5368709120,\"path\":\"07f8f6f8-6e89-42c0-922f-d1efc71fbbb5\",\"deviceId\":1,\"diskOfferingId\":\"b94e3254-5e5a-49d8-ac2f-d05eb6521af7\"}]",
      "zone": "pr11754-t14599-kvm-ol8",
      "zoneid": "222431f6-8ece-47fa-897d-0b36ce188069"
    }
  ],
  "count": 1
}

DB:

  • Details persisted in cloud.backup_details table.
mysql> SELECT * FROM cloud.backup_details;
+----+-----------+-------------------+-----------------------------------------------------------------------------------------------------------------+---------+
| id | backup_id | name              | value                                                                                                           | display |
+----+-----------+-------------------+-----------------------------------------------------------------------------------------------------------------+---------+
|  7 |         1 | nics              | [{"ipaddress":"10.1.1.7","networkid":"0305496f-da01-472c-a7be-1ceab6c29f26","macaddress":"02:01:00:cc:00:03"}]  |       1 |
|  8 |         1 | vmsettings        | {"cpuOvercommitRatio":"2.0","rootDiskController":"osdefault"}                                                   |       1 |
|  9 |         1 | templateid        | c214afa2-e649-45f2-9a93-41a2ec020ead                                                                            |       1 |
| 10 |         1 | serviceofferingid | 10ad2900-9174-4dbf-a8f4-b6f4d6423da5                                                                            |       1 |
| 11 |         1 | osname            | CentOS 5.5 (64-bit)                                                                                             |       1 |
| 12 |         1 | ostypeid          | f1416dd0-a4f1-11f0-91dc-1e00e6000357                                                                            |       1 |
| 19 |         2 | nics              | [{"ipaddress":"10.1.1.93","networkid":"b9e7d331-2e29-4259-8c8a-49cacf5b1337","macaddress":"02:01:00:d1:00:01"}] |       1 |
| 20 |         2 | vmsettings        | {"cpuOvercommitRatio":"2.0"}                                                                                    |       1 |
| 21 |         2 | templateid        | f1142d10-a4f1-11f0-91dc-1e00e6000357                                                                            |       1 |
| 22 |         2 | serviceofferingid | 10ad2900-9174-4dbf-a8f4-b6f4d6423da5                                                                            |       1 |
| 23 |         2 | osname            | CentOS 5.5 (64-bit)                                                                                             |       1 |
| 24 |         2 | ostypeid          | f1416dd0-a4f1-11f0-91dc-1e00e6000357                                                                            |       1 |
| 31 |         3 | nics              | [{"ipaddress":"10.1.1.54","networkid":"b9e7d331-2e29-4259-8c8a-49cacf5b1337","macaddress":"02:01:00:d1:00:03"}] |       1 |
| 32 |         3 | vmsettings        | {"cpuOvercommitRatio":"2.0"}                                                                                    |       1 |
| 33 |         3 | templateid        | f1142d10-a4f1-11f0-91dc-1e00e6000357                                                                            |       1 |
| 34 |         3 | serviceofferingid | 10ad2900-9174-4dbf-a8f4-b6f4d6423da5                                                                            |       1 |
| 35 |         3 | osname            | CentOS 5.5 (64-bit)                                                                                             |       1 |
| 36 |         3 | ostypeid          | f1416dd0-a4f1-11f0-91dc-1e00e6000357                                                                            |       1 |
+----+-----------+-------------------+-----------------------------------------------------------------------------------------------------------------+---------+
18 rows in set (0.00 sec)

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] 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

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-14652)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56167 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11754-t14652-kvm-ol8.zip
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@harikrishna-patnala harikrishna-patnala merged commit 046014b into apache:main Oct 14, 2025
27 of 28 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.22.0 Oct 14, 2025
@harikrishna-patnala harikrishna-patnala deleted the nasbnr branch October 14, 2025 09:22
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
* add createCrossZoneInstnaceEnabled to BackupOfferingResponse

* show use IP Address from Backup button when orignal instance is expunged

* Fix NPE in takeBackup if the  vm template is deleted.

* Add since to Cross zone instance creation in BackupOfferingResponse.java

Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>

* Store and show Guest os type in the backup metadata

* show warning in create instance from backup form if guest os type is different

* show warning in create instance from backup form if guest os type is different

* backupvmexpunged -> isbackupvmexpunged

* review comments

* fix npe

* improve err msg

* err msg

---------

Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

cloudstack 4.21 NAS backup and recovery issue.

5 participants