-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backroll Plugin #8251
base: main
Are you sure you want to change the base?
Backroll Plugin #8251
Conversation
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
@blueorangutan package |
@weizhouapache 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8251 +/- ##
============================================
- Coverage 15.78% 15.76% -0.02%
+ Complexity 12552 12551 -1
============================================
Files 5625 5656 +31
Lines 491993 492511 +518
Branches 63581 61853 -1728
============================================
- Hits 77670 77663 -7
- Misses 405864 406389 +525
Partials 8459 8459
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7806 |
@PeterBackroll , nice to see this coming in. Will you add a documentation PR as well? I think you'll have a lot of reviews ;) |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-8383)
|
Hi @DaanHoogland Yes I will add a documentation PR as soon as possible :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments @PeterBackroll .
I haven't gotten to review the Provider and Client yet, the core of the plugin.
I'll do that next week ;)
.../backup/backroll/src/test/java/org/apache/cloudstack/backup/backroll/BackrollClientTest.java
Outdated
Show resolved
Hide resolved
...s/backup/backroll/src/test/java/org/apache/cloudstack/backup/BackrollBackupProviderTest.java
Outdated
Show resolved
Hide resolved
...java/org/apache/cloudstack/backup/backroll/model/response/policy/BackupPoliciesResponse.java
Show resolved
Hide resolved
@@ -0,0 +1,38 @@ | |||
package org.apache.cloudstack.backup.backroll.model.response.policy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package org.apache.cloudstack.backup.backroll.model.response.policy; | |
// 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.backup.backroll.model.response.policy; |
...kup/backroll/model/response/metrics/virtualMachineBackups/VirtualMachineBackupsResponse.java
Show resolved
Hide resolved
@@ -0,0 +1,31 @@ | |||
package org.apache.cloudstack.backup.backroll.model; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package org.apache.cloudstack.backup.backroll.model; | |
// 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.backup.backroll.model; |
...kup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/model/BackrollOffering.java
Show resolved
Hide resolved
@@ -0,0 +1,19 @@ | |||
package org.apache.cloudstack.backup.backroll.model; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package org.apache.cloudstack.backup.backroll.model; | |
// 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.backup.backroll.model; |
...ackup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/model/BackrollBackup.java
Show resolved
Hide resolved
plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/backroll/BackrollClient.java
Show resolved
Hide resolved
@blueorangutan package |
@rohityadavcloud 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. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7834 |
@PeterBackroll can you please have a look at the GH actions failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments @PeterBackroll .
I haven't gotten to review the Provider and Client yet, the core of the plugin.
Thatś up next ;)
/* import org.apache.log4j.Logger; | ||
import org.apache.cloudstack.api.APICommand; | ||
import org.apache.cloudstack.api.BaseCmd; | ||
import org.apache.cloudstack.backup.backroll.api.response.ApiHelloResponse; */ | ||
|
||
/* @APICommand(name = "getBackrollHello", responseObject = ApiHelloResponse.class, description = "Get Hello", | ||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment (stealing git's job;)
Makes me think if this class is really needed? maybe remove it from the PR?
...ckroll/src/main/java/org/apache/cloudstack/backup/backroll/api/command/GetBackrollHello.java
Outdated
Show resolved
Hide resolved
import com.cloud.serializer.Param; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class ApiHelloResponse extends BaseResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this class be included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks generally good, @PeterBackroll .
some changes will have to be done though (before merging)
import org.apache.cloudstack.framework.config.ConfigKey; | ||
import org.apache.cloudstack.framework.config.Configurable; | ||
import org.apache.commons.collections.CollectionUtils; | ||
import org.apache.commons.lang3.StringUtils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move up to the other org.apache.cloudstack
imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ;)
plugins/backup/backroll/src/main/java/org/apache/cloudstack/backup/BackrollBackupProvider.java
Outdated
Show resolved
Hide resolved
|
||
public ConfigKey<String> BackrollPasswordConfigKey = new ConfigKey<>("Advanced", String.class, | ||
"backup.plugin.backroll.config.password", | ||
"VviX8dALauSyYJMqVYJqf3UyZOpO3joS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this more clear, this string is just as insecure but less inviting to change
"VviX8dALauSyYJMqVYJqf3UyZOpO3joS", | |
"password", |
or
"VviX8dALauSyYJMqVYJqf3UyZOpO3joS", | |
"C'est vraiment secret", |
message = MessageFormat.format("Backup {0} deleted in CS for virtual machine {1}", backup.getId(), vm.getName()); | ||
s_logger.info(message); | ||
} else { | ||
isAnyProblemWhileRemovingBackups = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why reset to false? the prior one have failed right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question!!
} | ||
|
||
@Override | ||
public void syncBackups(VirtualMachine vm, Backup.Metric metric) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe disect this method. it is rather big.
List<BackrollVmBackup> backupsFromBackroll = client.getAllBackupsfromVirtualMachine(vm.getUuid()); | ||
backupsInDb = backupDao.listByVmId(null, vm.getId()); | ||
|
||
// insert new backroll backup in CS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// insert new backroll backup in CS | |
// insert new backroll backups in CS DB |
This could easily be a method name for a private method
} | ||
} | ||
|
||
// delete deleted backroll backup in CS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// delete deleted backroll backup in CS | |
// delete deleted backroll backups from CS DB |
another private method to extract
final BackrollClient client = getClient(vm.getDataCenterId()); | ||
List<Backup> backupsInDb = backupDao.listByVmId(null, vm.getId()); | ||
|
||
for (Backup backup : backupsInDb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the start of three privat methods for improved readibility
public boolean deleteBackup(Backup backup, boolean forced) { | ||
s_logger.info("backroll delete backup id: " + backup.getExternalId()); | ||
if(backup.getStatus().equals(Backup.Status.BackingUp)) { | ||
throw new CloudRuntimeException("You can't delete a backup while it still BackingUp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new CloudRuntimeException("You can't delete a backup while it still BackingUp"); | |
throw new CloudRuntimeException("You can't delete a backup while it's still BackingUp"); |
import org.apache.cloudstack.backup.BackupOffering; | ||
import org.apache.cloudstack.backup.Backup.Metric; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be mixed up there ^ with the rest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ;)
@PeterBackroll do we have any docs on how to configure the plugin, what kind of storage is supported, any limitations, etc? |
…apache#9731) * added a v-if directive within the EditVm view to not show the field userdata if the vm's network does not offer the feature * added the parameter listall:true to the requests made to listNetworks and listVirtualMachines
… than English (apache#9766) * Fix updateTemplatePermission UI in non-english language * Improve fix --------- Co-authored-by: Lucas Martins <[email protected]>
@blueorangutan package |
@rajujith 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11293 |
@blueorangutan package |
@blueorangutan package |
@rajujith 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11302 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PeterBackroll below is my review summary.
I used this plugin with Backroll version v0.4.0-alpha-1-25-g50d43bf.
Backup VM works sometimes with no changes to the configuration.
There is a delay in listing the backup policy while creating the backup offering.
Delay in syncing the backup completion status to CloudStack. The delay observed varies from a few minutes and upwards.
Many times the backup API is not send to Backroll by the cloudstack backroll client, but it works after restarting cloudstack-management service a couple of times. Some of these failed jobs fails with "Failed to authenticate Backroll API service due to:Timeout waiting for connection from pool"
Restore Backup fails with: "Virtual machine not found to process restore"
Single instance backup of an instance with 2 volumes, ROOT and data is listed as two individual instance backups instead of one. The volume is not listed in these backups.
@blueorangutan package |
@rajujith 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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11355 |
@PeterBackroll |
Description
This is the pull request for Backroll Plugin (a backup & restore plugin).
This plugin allows users to use Backroll as backup provider inside Cloudstack.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity