You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "abh1sar (via GitHub)" <gi...@apache.org> on 2025/09/02 10:54:17 UTC
[PR] Create Instance from backup on another Zone [cloudstack]
abh1sar opened a new pull request, #11560:
URL: https://github.com/apache/cloudstack/pull/11560
### Description
In continuation of #10140 , this PR adds the functionality that a new Instance can be created on a different Zone from which the backup was taken.
- Supported backup Providers are NAS and Dummy.
- The two zones have to be on the same CloudStack Installation
- The backup repository still needs to be added only for the Zone where backup will be taken.
But the operator should ensure that the backup repository is also accessible in the Zone where the new Instance is being created.
#### Other changes done:
1. Throw relevant errors to the end user. i.e, if backup repository is not accessible or the backup files are not present or corrupted.
2. Changes to decrease the RTO.
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!--- ******************************************************************************* -->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ******************************************************************************* -->
### 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)
- [x] 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
- [x] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
<img width="1313" height="1239" alt="Screenshot from 2025-09-02 16-06-21" src="https://github.com/user-attachments/assets/262de69c-eb57-4c5a-b00f-cd2bac4abe4b" />
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3268785139
> @abh1sar also can you please check the failures in simulator CI run
Thanks @harikrishna-patnala. I have fixed the issue and addressed other comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3293178496
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15019
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3321919813
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299587087
@blueorangutan test keepEnv
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3301907051
<b>[SF] Trillian test result (tid-14361)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 52873 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11560-t14361-kvm-ol8.zip
Smoke tests completed. 139 look OK, 8 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
ContextSuite context=TestClusterDRS>:setup | `Error` | 0.00 | test_cluster_drs.py
test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 1.14 | test_kubernetes_clusters.py
test_04_autoscale_kubernetes_cluster | `Failure` | 27.83 | test_kubernetes_clusters.py
test_delete_account | `Error` | 5.28 | test_network.py
test_delete_network_while_vm_on_it | `Error` | 1.19 | test_network.py
test_deploy_vm_l2network | `Error` | 1.16 | test_network.py
test_l2network_restart | `Error` | 2.29 | test_network.py
ContextSuite context=TestPortForwarding>:setup | `Error` | 3.51 | test_network.py
ContextSuite context=TestPublicIP>:setup | `Error` | 9.94 | test_network.py
test_reboot_router | `Failure` | 0.07 | test_network.py
test_releaseIP | `Error` | 5.00 | test_network.py
test_releaseIP_using_IP | `Error` | 5.04 | test_network.py
ContextSuite context=TestRouterRules>:setup | `Error` | 5.11 | test_network.py
ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 1520.90 | test_network.py
ContextSuite context=TestNonStrictAffinityGroups>:setup | `Error` | 0.00 | test_nonstrict_affinity_group.py
ContextSuite context=TestIsolatedNetworksPasswdServer>:setup | `Error` | 0.00 | test_password_server.py
ContextSuite context=TestPortForwardingRules>:setup | `Error` | 0.00 | test_portforwardingrules.py
ContextSuite context=TestPrivateGwACL>:setup | `Error` | 0.00 | test_privategw_acl.py
test_09_project_suspend | `Error` | 1.09 | test_projects.py
test_10_project_activation | `Error` | 1.07 | test_projects.py
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330512208
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -9612,20 +9615,15 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
@Override
public UserVm restoreVMFromBackup(CreateVMFromBackupCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException {
long vmId = cmd.getEntityId();
+ UserVm vm;
Map<Long, DiskOffering> diskOfferingMap = cmd.getDataDiskTemplateToDiskOfferingMap();
Map<VirtualMachineProfile.Param, Object> additonalParams = new HashMap<>();
- UserVm vm;
+ additonalParams.put(VirtualMachineProfile.Param.ReturnAfterVolumePrepare, true);
try {
- vm = startVirtualMachine(vmId, null, null, null, diskOfferingMap, additonalParams, null);
-
- boolean status = stopVirtualMachine(CallContext.current().getCallingUserId(), vm.getId()) ;
Review Comment:
stopVirtualMachine call has been removed. cleanup code was to handle any errors returned from that. if startVirtualMachine() fails, it should return an exception for which cleanup is done in the catch block.
thinking about it more, we should catch all the exceptions thrown by startVirtualMachie. Currently the code only catches CloudRuntimeException.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2320764504
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java:
##########
@@ -140,52 +146,59 @@ private void restoreVolume(String backupPath, String backupRepoType, String back
throw new CloudRuntimeException(String.format("Failed to attach volume to VM: %s", vmNameAndState.first()));
}
}
- } catch (Exception e) {
- throw new CloudRuntimeException("Failed to restore volume", e);
} finally {
unmountBackupDirectory(mountDirectory);
deleteTemporaryDirectory(mountDirectory);
}
}
- private String mountBackupDirectory(String backupRepoAddress, String backupRepoType, String mountOptions) {
+ private String mountBackupDirectory(String backupRepoAddress, String backupRepoType, String mountOptions, Integer mountTimeout) {
String randomChars = RandomStringUtils.random(5, true, false);
String mountDirectory = String.format("%s.%s",BACKUP_TEMP_FILE_PREFIX , randomChars);
+
try {
mountDirectory = Files.createTempDirectory(mountDirectory).toString();
- String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
- if ("cifs".equals(backupRepoType)) {
- if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
- mountOptions = "nobrl";
- } else {
- mountOptions += ",nobrl";
- }
- }
- if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
- mount += " -o " + mountOptions;
+ } catch (IOException e) {
+ logger.error(String.format("Failed to create the tmp mount directory {} for restore", mountDirectory), e);
+ throw new CloudRuntimeException("Failed to create the tmp mount directory for restore on the KVM host");
+ }
+
+ String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
+ if ("cifs".equals(backupRepoType)) {
+ if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
+ mountOptions = "nobrl";
+ } else {
+ mountOptions += ",nobrl";
}
- Script.runSimpleBashScript(mount);
- } catch (Exception e) {
- throw new CloudRuntimeException(String.format("Failed to mount %s to %s", backupRepoType, backupRepoAddress), e);
+ }
+ if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
+ mount += " -o " + mountOptions;
+ }
+
+ int exitValue = Script.runSimpleBashScriptForExitValue(mount, mountTimeout, false);
Review Comment:
fiy - runSimpleBashScript doesn't return any exception. just a return value. So no need to keep it inside try-catch. So, checking the return value instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3274180553
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3297969877
@borisstoyanov 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3297962945
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3321918924
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3293916881
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3298473820
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15034
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3244845708
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/11560?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 3.63%. Comparing base ([`574ed78`](https://app.codecov.io/gh/apache/cloudstack/commit/574ed7857b350f7ba8b0e0d061ad9484977dbbbd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2588ee4`](https://app.codecov.io/gh/apache/cloudstack/commit/2588ee445afd22fdbb273faf86d852ba2e1f3727?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 5 commits behind head on main.
> :exclamation: There is a different number of reports uploaded between BASE (574ed78) and HEAD (2588ee4). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (574ed78) | HEAD (2588ee4) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #11560 +/- ##
=============================================
- Coverage 17.36% 3.63% -13.73%
=============================================
Files 5888 441 -5447
Lines 525737 37016 -488721
Branches 64164 6784 -57380
=============================================
- Hits 91274 1345 -89929
+ Misses 424163 35510 -388653
+ Partials 10300 161 -10139
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/11560/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/11560/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.63% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/11560/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/11560?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2320770191
##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -1310,18 +1331,21 @@ public boolean restoreBackupToVM(final Long backupId, final Long vmId) throws Re
host = restoreInfo.first().getPrivateIpAddress();
dataStore = restoreInfo.second().getUuid();
}
- if (!backupProvider.restoreBackupToVM(vm, backup, host, dataStore)) {
- throw new CloudRuntimeException(String.format("Error restoring backup [%s] to VM %s.", backupDetailsInMessage, vm.getUuid()));
- }
+ result = backupProvider.restoreBackupToVM(vm, backup, host, dataStore);
+
} catch (Exception e) {
- updateVolumeState(vm, Volume.Event.RestoreFailed, Volume.State.Ready);
- updateVmState(vm, VirtualMachine.Event.RestoringFailed, VirtualMachine.State.Stopped);
- logger.error(String.format("Failed to create Instance [%s] from backup [%s] due to: [%s].", vm.getInstanceName(), backupDetailsInMessage, e.getMessage()), e);
- ActionEventUtils.onCompletedActionEvent(User.UID_SYSTEM, vm.getAccountId(), EventVO.LEVEL_ERROR, EventTypes.EVENT_VM_CREATE_FROM_BACKUP,
- String.format("Failed to create Instance %s from backup %s", vm.getInstanceName(), backup.getUuid()),
- vm.getId(), ApiCommandResourceType.VirtualMachine.toString(), eventId);
+ logger.error(String.format("Failed to create Instance [%s] from backup [%s] due to: [%s]", vm.getInstanceName(), backupDetailsInMessage, e.getMessage()), e);
+ processRestoreBackupToVMFailure(vm, backup, eventId);
throw new CloudRuntimeException(String.format("Error while creating Instance [%s] from backup [%s].", vm.getUuid(), backupDetailsInMessage));
}
+
+ if (result != null && !result.first()) {
+ String error_msg = String.format("Failed to create Instance [%s] from backup [%s] due to: %s.", vm.getInstanceName(), backupDetailsInMessage, result.second());
+ logger.error(error_msg);
+ processRestoreBackupToVMFailure(vm, backup, eventId);
+ throw new CloudRuntimeException(error_msg);
Review Comment:
fiy - this is done to pass on the error passed by the provider.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330493072
##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -115,27 +130,38 @@ public class NASBackupProvider extends AdapterBase implements BackupProvider, Co
@Inject
private DiskOfferingDao diskOfferingDao;
+ protected Long getClusterIdFromRootVolume(VirtualMachine vm) {
+ VolumeVO rootVolume = _volsDao.getInstanceRootVolume(vm.getId());
+ StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolume.getPoolId());
Review Comment:
We assume that the volume is allocated and placed in a storage pool at this point of time for restore to work. So poolId should not be null, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3290918911
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3290914371
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299583228
@abh1sar [SL] I understand these words: "help", "hello", "thanks", "package", "test"
Test command usage: test [mgmt os] [hypervisor] [keepEnv] [qemuEv] [basicZone|securityGroups]
Mgmt OS options: ['suse15', 'alma10', 'ol10', 'rocky10', 'alma9', 'centos7', 'centos6', 'rocky9', 'alma8', 'ubuntu18', 'ol9', 'ol8', 'ubuntu22', 'debian12', 'ubuntu20', 'rocky8', 'ubuntu24']
Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-rocky9', 'kvm-rocky10', 'kvm-ol8', 'kvm-ol9', 'kvm-ol10', 'kvm-alma8', 'kvm-alma9', 'kvm-alma10', 'kvm-ubuntu18', 'kvm-ubuntu20', 'kvm-ubuntu22', 'kvm-ubuntu24', 'kvm-debian12', 'kvm-suse15', 'vmware-55u3', 'vmware-60u2', 'vmware-65u2', 'vmware-67u3', 'vmware-70u1', 'vmware-70u2', 'vmware-70u3', 'vmware-80', 'vmware-80u1', 'vmware-80u2', 'vmware-80u3', 'vmware-80u3e', 'xenserver-65sp1', 'xenserver-71', 'xenserver-74', 'xenserver-84', 'xcpng74', 'xcpng76', 'xcpng80', 'xcpng81', 'xcpng82', 'xcpng83']
Note: when keepEnv is passed, you need to specify mgmt server os and hypervisor or use the `matrix` command.
when qemuEv is passed, it will deploy KVM hyperviosr hosts with qemu-kvm-ev, else it will default to stock qemu.
When basicZone and/or securityGroups are passed it will create a zone of the last type specified (default is Advanced)
Package command usage: package [all(default value),kvm,xen,vmware,hyperv,ovm] - a comma separated list can be passed with package command to bundle the required hypervisor's systemVM templates. Not passing any argument will bundle all - kvm,xen and vmware templates.
Blessed contributors for kicking Trillian test jobs: ['rohityadavcloud', 'shwstppr', 'vishesh92', 'Pearl1594', 'harikrishna-patnala', 'nvazquez', 'DaanHoogland', 'weizhouapache', 'borisstoyanov', 'vladimirpetrov', 'kiranchavala', 'andrijapanicsb', 'NuxRo', 'rajujith', 'alexandremattioli', 'sureshanaparti', 'abh1sar', 'sudo87', 'rosi-shapeblue']
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299579490
@blueorangutan help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3294137395
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15024
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3292116134
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3290566689
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14999
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299180965
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone [cloudstack]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3251493553
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3322175844
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330498248
##########
ui/src/components/view/DeployVMFromBackup.vue:
##########
@@ -45,14 +45,76 @@
</div>
</template>
</a-step>
+ <a-step
+ v-if="isDRaaSEnabled"
+ :title="$t('label.select.a.zone')"
+ status="process">
+ <template #description>
+ <div style="margin-top: 15px">
+ <a-form-item :label="$t('label.zoneid')" name="zoneid" ref="zoneid">
+ <div v-if="zones.length <= 8">
+ <a-row type="flex" :gutter="[16, 18]" justify="start">
+ <div v-for="(zoneItem, idx) in zones" :key="idx">
+ <a-radio-group
+ :key="idx"
+ v-model:value="form.zoneid"
+ @change="onSelectZoneId(zoneItem.id)">
+ <a-col :span="6">
+ <a-radio-button
+ :value="zoneItem.id"
+ style="border-width: 2px"
+ class="zone-radio-button">
+ <span>
+ <resource-icon
+ v-if="zoneItem && zoneItem.icon && zoneItem.icon.base64image"
+ :image="zoneItem.icon.base64image"
+ size="2x" />
+ <global-outlined size="2x" v-else />
+ {{ zoneItem.name }}
+ </span>
+ </a-radio-button>
+ </a-col>
+ </a-radio-group>
+ </div>
+ </a-row>
+ </div>
+ <a-select
+ v-else
+ v-model:value="form.zoneid"
+ showSearch
+ optionFilterProp="label"
+ :filterOption="(input, option) => {
+ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
+ }"
+ @change="onSelectZoneId"
+ :loading="loading.zones"
+ v-focus="true"
+ >
+ <a-select-option v-for="zone1 in zones" :key="zone1.id" :label="zone1.name">
+ <span>
+ <resource-icon v-if="zone1.icon && zone1.icon.base64image" :image="zone1.icon.base64image" size="2x" style="margin-right: 5px"/>
+ <global-outlined v-else style="margin-right: 5px" />
+ {{ zone1.name }}
+ </span>
+ </a-select-option>
+ </a-select>
+ </a-form-item>
+ <a-alert
+ v-if="isDifferentZoneFromBackup">
+ <template #message>
+ <div v-html="$t('message.create.instance.from.backup.different.zone')"></div>
+ </template>
+ </a-alert>
+ </div>
+ </template>
+ </a-step>
<a-step
v-if="!isNormalAndDomainUser"
:title="$t('label.select.deployment.infrastructure')"
status="process">
<template #description>
<div style="margin-top: 15px">
<a-form-item
- v-if="!isNormalAndDomainUser"
Review Comment:
The check is present in the parent a-step, so not really needed here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330493072
##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -115,27 +130,38 @@ public class NASBackupProvider extends AdapterBase implements BackupProvider, Co
@Inject
private DiskOfferingDao diskOfferingDao;
+ protected Long getClusterIdFromRootVolume(VirtualMachine vm) {
+ VolumeVO rootVolume = _volsDao.getInstanceRootVolume(vm.getId());
+ StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolume.getPoolId());
Review Comment:
Ideally volume should be allocated and placed in a storage pool by this time but I'll add the check to be safe.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3269311562
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3269310844
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2320764918
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java:
##########
@@ -140,52 +146,59 @@ private void restoreVolume(String backupPath, String backupRepoType, String back
throw new CloudRuntimeException(String.format("Failed to attach volume to VM: %s", vmNameAndState.first()));
}
}
- } catch (Exception e) {
- throw new CloudRuntimeException("Failed to restore volume", e);
} finally {
unmountBackupDirectory(mountDirectory);
deleteTemporaryDirectory(mountDirectory);
}
}
- private String mountBackupDirectory(String backupRepoAddress, String backupRepoType, String mountOptions) {
+ private String mountBackupDirectory(String backupRepoAddress, String backupRepoType, String mountOptions, Integer mountTimeout) {
String randomChars = RandomStringUtils.random(5, true, false);
String mountDirectory = String.format("%s.%s",BACKUP_TEMP_FILE_PREFIX , randomChars);
+
try {
mountDirectory = Files.createTempDirectory(mountDirectory).toString();
- String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
- if ("cifs".equals(backupRepoType)) {
- if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
- mountOptions = "nobrl";
- } else {
- mountOptions += ",nobrl";
- }
- }
- if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
- mount += " -o " + mountOptions;
+ } catch (IOException e) {
+ logger.error(String.format("Failed to create the tmp mount directory {} for restore", mountDirectory), e);
+ throw new CloudRuntimeException("Failed to create the tmp mount directory for restore on the KVM host");
+ }
+
+ String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
+ if ("cifs".equals(backupRepoType)) {
+ if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
+ mountOptions = "nobrl";
+ } else {
+ mountOptions += ",nobrl";
}
- Script.runSimpleBashScript(mount);
- } catch (Exception e) {
- throw new CloudRuntimeException(String.format("Failed to mount %s to %s", backupRepoType, backupRepoAddress), e);
+ }
+ if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
+ mount += " -o " + mountOptions;
+ }
+
+ int exitValue = Script.runSimpleBashScriptForExitValue(mount, mountTimeout, false);
+ if (exitValue != 0) {
+ logger.error(String.format("Failed to mount repository {} of type {} to the directory {}", backupRepoAddress, backupRepoType, mountDirectory));
+ throw new CloudRuntimeException("Failed to mount the backup repository on the KVM host");
}
return mountDirectory;
}
private void unmountBackupDirectory(String backupDirectory) {
- try {
- String umountCmd = String.format(UMOUNT_COMMAND, backupDirectory);
- Script.runSimpleBashScript(umountCmd);
- } catch (Exception e) {
- throw new CloudRuntimeException(String.format("Failed to unmount backup directory: %s", backupDirectory), e);
+ String umountCmd = String.format(UMOUNT_COMMAND, backupDirectory);
+ int exitValue = Script.runSimpleBashScriptForExitValue(umountCmd);
Review Comment:
fiy - same here. runSimpleBashScript doesn't throw any exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2320762899
##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -115,27 +130,38 @@ public class NASBackupProvider extends AdapterBase implements BackupProvider, Co
@Inject
private DiskOfferingDao diskOfferingDao;
+ protected Long getClusterIdFromRootVolume(VirtualMachine vm) {
+ VolumeVO rootVolume = _volsDao.getInstanceRootVolume(vm.getId());
+ StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolume.getPoolId());
+ return rootDiskPool.getClusterId();
+ }
+
protected Host getLastVMHypervisorHost(VirtualMachine vm) {
Long hostId = vm.getLastHostId();
- if (hostId == null) {
- LOG.debug("Cannot find last host for vm. This should never happen, please check your database.");
- return null;
- }
- Host host = hostDao.findById(hostId);
+ Long clusterId = null;
- if (host.getStatus() == Status.Up) {
- return host;
+ if (hostId != null) {
+ Host host = hostDao.findById(hostId);
+ if (host.getStatus() == Status.Up) {
+ return host;
+ }
+ clusterId = host.getClusterId();
} else {
+ clusterId = getClusterIdFromRootVolume(vm);
Review Comment:
fyi - hostId won't be set for create Instance from Backup. But we can get the clusterId from the root volume which is already created.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299171901
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3291732353
@borisstoyanov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov closed pull request #11560: Create Instance from backup on another Zone (DRaaS use case)
URL: https://github.com/apache/cloudstack/pull/11560
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3324945021
<b>[SF] Trillian test result (tid-14418)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 49825 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11560-t14418-kvm-ol8.zip
Smoke tests completed. 147 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330512208
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -9612,20 +9615,15 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
@Override
public UserVm restoreVMFromBackup(CreateVMFromBackupCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException {
long vmId = cmd.getEntityId();
+ UserVm vm;
Map<Long, DiskOffering> diskOfferingMap = cmd.getDataDiskTemplateToDiskOfferingMap();
Map<VirtualMachineProfile.Param, Object> additonalParams = new HashMap<>();
- UserVm vm;
+ additonalParams.put(VirtualMachineProfile.Param.ReturnAfterVolumePrepare, true);
try {
- vm = startVirtualMachine(vmId, null, null, null, diskOfferingMap, additonalParams, null);
-
- boolean status = stopVirtualMachine(CallContext.current().getCallingUserId(), vm.getId()) ;
Review Comment:
stopVirtualMachine call has been removed. cleanup code was to handle any errors returned from that. if startVirtualMachine() fails, it should return an exception for which cleanup is done in the catch block.
thinking about it more, we should catch all the exceptions thrown by startVirtualMachie. Currently the code only catches CloudRuntimeException.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330542441
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -9612,20 +9615,15 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
@Override
public UserVm restoreVMFromBackup(CreateVMFromBackupCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException {
long vmId = cmd.getEntityId();
+ UserVm vm;
Map<Long, DiskOffering> diskOfferingMap = cmd.getDataDiskTemplateToDiskOfferingMap();
Map<VirtualMachineProfile.Param, Object> additonalParams = new HashMap<>();
- UserVm vm;
+ additonalParams.put(VirtualMachineProfile.Param.ReturnAfterVolumePrepare, true);
try {
- vm = startVirtualMachine(vmId, null, null, null, diskOfferingMap, additonalParams, null);
-
- boolean status = stopVirtualMachine(CallContext.current().getCallingUserId(), vm.getId()) ;
Review Comment:
This cleanup was for error returned from stopVirtualMachine.
startVirtualMachine should throw an exception if it fails, for which cleanup is done in the catch block.
thinking about it more, startVirtualMachine returns some more Exception types apart from CloudRuntimeException, which is not being caught here. I'll add those.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2329691991
##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -115,27 +130,38 @@ public class NASBackupProvider extends AdapterBase implements BackupProvider, Co
@Inject
private DiskOfferingDao diskOfferingDao;
+ protected Long getClusterIdFromRootVolume(VirtualMachine vm) {
+ VolumeVO rootVolume = _volsDao.getInstanceRootVolume(vm.getId());
+ StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolume.getPoolId());
Review Comment:
do we need a null check for poolId here ?
##########
ui/src/components/view/DeployVMFromBackup.vue:
##########
@@ -45,14 +45,76 @@
</div>
</template>
</a-step>
+ <a-step
+ v-if="isDRaaSEnabled"
+ :title="$t('label.select.a.zone')"
+ status="process">
+ <template #description>
+ <div style="margin-top: 15px">
+ <a-form-item :label="$t('label.zoneid')" name="zoneid" ref="zoneid">
+ <div v-if="zones.length <= 8">
+ <a-row type="flex" :gutter="[16, 18]" justify="start">
+ <div v-for="(zoneItem, idx) in zones" :key="idx">
+ <a-radio-group
+ :key="idx"
+ v-model:value="form.zoneid"
+ @change="onSelectZoneId(zoneItem.id)">
+ <a-col :span="6">
+ <a-radio-button
+ :value="zoneItem.id"
+ style="border-width: 2px"
+ class="zone-radio-button">
+ <span>
+ <resource-icon
+ v-if="zoneItem && zoneItem.icon && zoneItem.icon.base64image"
+ :image="zoneItem.icon.base64image"
+ size="2x" />
+ <global-outlined size="2x" v-else />
+ {{ zoneItem.name }}
+ </span>
+ </a-radio-button>
+ </a-col>
+ </a-radio-group>
+ </div>
+ </a-row>
+ </div>
+ <a-select
+ v-else
+ v-model:value="form.zoneid"
+ showSearch
+ optionFilterProp="label"
+ :filterOption="(input, option) => {
+ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
+ }"
+ @change="onSelectZoneId"
+ :loading="loading.zones"
+ v-focus="true"
+ >
+ <a-select-option v-for="zone1 in zones" :key="zone1.id" :label="zone1.name">
+ <span>
+ <resource-icon v-if="zone1.icon && zone1.icon.base64image" :image="zone1.icon.base64image" size="2x" style="margin-right: 5px"/>
+ <global-outlined v-else style="margin-right: 5px" />
+ {{ zone1.name }}
+ </span>
+ </a-select-option>
+ </a-select>
+ </a-form-item>
+ <a-alert
+ v-if="isDifferentZoneFromBackup">
+ <template #message>
+ <div v-html="$t('message.create.instance.from.backup.different.zone')"></div>
+ </template>
+ </a-alert>
+ </div>
+ </template>
+ </a-step>
<a-step
v-if="!isNormalAndDomainUser"
:title="$t('label.select.deployment.infrastructure')"
status="process">
<template #description>
<div style="margin-top: 15px">
<a-form-item
- v-if="!isNormalAndDomainUser"
Review Comment:
any reason for removal of this check ?
##########
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java:
##########
@@ -1476,16 +1476,29 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
processPrepareExternalProvisioning(firstStart, dest.getHost(), vmProfile, dest.getDataCenter());
- _networkMgr.prepare(vmProfile, dest, ctx);
if (vm.getHypervisorType() != HypervisorType.BareMetal && vm.getHypervisorType() != HypervisorType.External) {
checkAndAttemptMigrateVmAcrossCluster(vm, clusterId, dest.getStorageForDisks());
volumeMgr.prepare(vmProfile, dest);
}
+ Boolean returnAfterVolumePrepare = (Boolean) params.get(VirtualMachineProfile.Param.ReturnAfterVolumePrepare);
Review Comment:
Can you please help me understand why these changes are required
##########
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java:
##########
@@ -9612,20 +9615,15 @@ public UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws Insufficien
@Override
public UserVm restoreVMFromBackup(CreateVMFromBackupCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException {
long vmId = cmd.getEntityId();
+ UserVm vm;
Map<Long, DiskOffering> diskOfferingMap = cmd.getDataDiskTemplateToDiskOfferingMap();
Map<VirtualMachineProfile.Param, Object> additonalParams = new HashMap<>();
- UserVm vm;
+ additonalParams.put(VirtualMachineProfile.Param.ReturnAfterVolumePrepare, true);
try {
- vm = startVirtualMachine(vmId, null, null, null, diskOfferingMap, additonalParams, null);
-
- boolean status = stopVirtualMachine(CallContext.current().getCallingUserId(), vm.getId()) ;
Review Comment:
Don't we need this cleanup now ?
##########
api/src/main/java/org/apache/cloudstack/api/command/user/backup/repository/UpdateBackupRepositoryCmd.java:
##########
@@ -0,0 +1,116 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.api.command.user.backup.repository;
+
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.BackupRepositoryResponse;
+import org.apache.cloudstack.backup.BackupRepository;
+import org.apache.cloudstack.backup.BackupRepositoryService;
+import org.apache.cloudstack.context.CallContext;
+
+import javax.inject.Inject;
+
+@APICommand(name = "updateBackupRepository",
+ description = "Update a backup repository",
+ responseObject = BackupRepositoryResponse.class, since = "4.22.0",
+ authorized = {RoleType.Admin})
+public class UpdateBackupRepositoryCmd extends BaseCmd {
+
+ @Inject
+ private BackupRepositoryService backupRepositoryService;
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = BackupRepositoryResponse.class, description = "ID of the backup repository")
+ private Long id;
+
+ @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "name of the backup repository")
+ private String name;
+
+ @Parameter(name = ApiConstants.ADDRESS, type = CommandType.STRING, required = true, description = "address of the backup repository")
+ private String address;
+
+ @Parameter(name = ApiConstants.MOUNT_OPTIONS, type = CommandType.STRING, description = "shared storage mount options")
+ private String mountOptions;
+
+ @Parameter(name = ApiConstants.DRAAS_ENABLED, type = CommandType.BOOLEAN, description = "the backup repository is configured to be used for disaster recovery on other Zones")
+ private Boolean draasEnabled;
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public BackupRepositoryService getBackupRepositoryService() {
+ return backupRepositoryService;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public String getMountOptions() {
+ return mountOptions == null ? "" : mountOptions;
+ }
+
+ public Boolean isDraasEnabled() {
+ return draasEnabled;
+ }
+
+ /////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ @Override
+ public void execute() {
+ try {
+ BackupRepository result = backupRepositoryService.updateBackupRepository(this);
+ if (result != null) {
+ BackupRepositoryResponse response = _responseGenerator.createBackupRepositoryResponse(result);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add backup repository");
Review Comment:
Failed to update !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala merged PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3317164490
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3290453214
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3290452454
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299589399
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3269309637
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3269734925
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14912
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3277228124
<b>[SF] Trillian test result (tid-14275)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59571 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11560-t14275-kvm-ol8.zip
Smoke tests completed. 146 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3291205880
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15003
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2320764918
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java:
##########
@@ -140,52 +146,59 @@ private void restoreVolume(String backupPath, String backupRepoType, String back
throw new CloudRuntimeException(String.format("Failed to attach volume to VM: %s", vmNameAndState.first()));
}
}
- } catch (Exception e) {
- throw new CloudRuntimeException("Failed to restore volume", e);
} finally {
unmountBackupDirectory(mountDirectory);
deleteTemporaryDirectory(mountDirectory);
}
}
- private String mountBackupDirectory(String backupRepoAddress, String backupRepoType, String mountOptions) {
+ private String mountBackupDirectory(String backupRepoAddress, String backupRepoType, String mountOptions, Integer mountTimeout) {
String randomChars = RandomStringUtils.random(5, true, false);
String mountDirectory = String.format("%s.%s",BACKUP_TEMP_FILE_PREFIX , randomChars);
+
try {
mountDirectory = Files.createTempDirectory(mountDirectory).toString();
- String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
- if ("cifs".equals(backupRepoType)) {
- if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
- mountOptions = "nobrl";
- } else {
- mountOptions += ",nobrl";
- }
- }
- if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
- mount += " -o " + mountOptions;
+ } catch (IOException e) {
+ logger.error(String.format("Failed to create the tmp mount directory {} for restore", mountDirectory), e);
+ throw new CloudRuntimeException("Failed to create the tmp mount directory for restore on the KVM host");
+ }
+
+ String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
+ if ("cifs".equals(backupRepoType)) {
+ if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
+ mountOptions = "nobrl";
+ } else {
+ mountOptions += ",nobrl";
}
- Script.runSimpleBashScript(mount);
- } catch (Exception e) {
- throw new CloudRuntimeException(String.format("Failed to mount %s to %s", backupRepoType, backupRepoAddress), e);
+ }
+ if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
+ mount += " -o " + mountOptions;
+ }
+
+ int exitValue = Script.runSimpleBashScriptForExitValue(mount, mountTimeout, false);
+ if (exitValue != 0) {
+ logger.error(String.format("Failed to mount repository {} of type {} to the directory {}", backupRepoAddress, backupRepoType, mountDirectory));
+ throw new CloudRuntimeException("Failed to mount the backup repository on the KVM host");
}
return mountDirectory;
}
private void unmountBackupDirectory(String backupDirectory) {
- try {
- String umountCmd = String.format(UMOUNT_COMMAND, backupDirectory);
- Script.runSimpleBashScript(umountCmd);
- } catch (Exception e) {
- throw new CloudRuntimeException(String.format("Failed to unmount backup directory: %s", backupDirectory), e);
+ String umountCmd = String.format(UMOUNT_COMMAND, backupDirectory);
+ int exitValue = Script.runSimpleBashScriptForExitValue(umountCmd);
Review Comment:
fyi - same here. runSimpleBashScript doesn't throw any exception.
##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -1310,18 +1331,21 @@ public boolean restoreBackupToVM(final Long backupId, final Long vmId) throws Re
host = restoreInfo.first().getPrivateIpAddress();
dataStore = restoreInfo.second().getUuid();
}
- if (!backupProvider.restoreBackupToVM(vm, backup, host, dataStore)) {
- throw new CloudRuntimeException(String.format("Error restoring backup [%s] to VM %s.", backupDetailsInMessage, vm.getUuid()));
- }
+ result = backupProvider.restoreBackupToVM(vm, backup, host, dataStore);
+
} catch (Exception e) {
- updateVolumeState(vm, Volume.Event.RestoreFailed, Volume.State.Ready);
- updateVmState(vm, VirtualMachine.Event.RestoringFailed, VirtualMachine.State.Stopped);
- logger.error(String.format("Failed to create Instance [%s] from backup [%s] due to: [%s].", vm.getInstanceName(), backupDetailsInMessage, e.getMessage()), e);
- ActionEventUtils.onCompletedActionEvent(User.UID_SYSTEM, vm.getAccountId(), EventVO.LEVEL_ERROR, EventTypes.EVENT_VM_CREATE_FROM_BACKUP,
- String.format("Failed to create Instance %s from backup %s", vm.getInstanceName(), backup.getUuid()),
- vm.getId(), ApiCommandResourceType.VirtualMachine.toString(), eventId);
+ logger.error(String.format("Failed to create Instance [%s] from backup [%s] due to: [%s]", vm.getInstanceName(), backupDetailsInMessage, e.getMessage()), e);
+ processRestoreBackupToVMFailure(vm, backup, eventId);
throw new CloudRuntimeException(String.format("Error while creating Instance [%s] from backup [%s].", vm.getUuid(), backupDetailsInMessage));
}
+
+ if (result != null && !result.first()) {
+ String error_msg = String.format("Failed to create Instance [%s] from backup [%s] due to: %s.", vm.getInstanceName(), backupDetailsInMessage, result.second());
+ logger.error(error_msg);
+ processRestoreBackupToVMFailure(vm, backup, eventId);
+ throw new CloudRuntimeException(error_msg);
Review Comment:
fyi - this is done to pass on the error passed by the provider.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3292121515
@borisstoyanov 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3317434878
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15132
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3322031169
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15139
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3274186068
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on code in PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#discussion_r2330550106
##########
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java:
##########
@@ -1476,16 +1476,29 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
processPrepareExternalProvisioning(firstStart, dest.getHost(), vmProfile, dest.getDataCenter());
- _networkMgr.prepare(vmProfile, dest, ctx);
if (vm.getHypervisorType() != HypervisorType.BareMetal && vm.getHypervisorType() != HypervisorType.External) {
checkAndAttemptMigrateVmAcrossCluster(vm, clusterId, dest.getStorageForDisks());
volumeMgr.prepare(vmProfile, dest);
}
+ Boolean returnAfterVolumePrepare = (Boolean) params.get(VirtualMachineProfile.Param.ReturnAfterVolumePrepare);
Review Comment:
This new parameter is passed from restoreVMFromBackup, to allocate and place the volumes on a storage pool but avoid starting the VM. This helps reduce the RTO for disaster recovery, by avoiding one start and stop VM cycle.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3265504753
@abh1sar also can you please check the failures in simulator CI run
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov closed pull request #11560: Create Instance from backup on another Zone (DRaaS use case)
URL: https://github.com/apache/cloudstack/pull/11560
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "abh1sar (via GitHub)" <gi...@apache.org>.
abh1sar commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3293913759
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3291728237
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3299482670
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15037
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3322176644
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create Instance from backup on another Zone (DRaaS use case) [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11560:
URL: https://github.com/apache/cloudstack/pull/11560#issuecomment-3317170576
@harikrishna-patnala 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org