-
Notifications
You must be signed in to change notification settings - Fork 1.3k
backup: veeam kvm integration #12991
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
base: main
Are you sure you want to change the base?
Changes from 137 commits
7c23b26
065ec85
a30eb28
f52b114
2784468
81c3b5b
f396c5c
73df3cb
23ecb1f
5389fe6
aae158b
10f65b6
7b45d2e
2350661
9ee9748
f83fd00
2bc3114
3460a5d
b926c74
da62e9a
4173947
91a081b
c36cd2c
ca4112e
a366929
586134d
6ca1c9b
fba7c63
a89f872
106fbdb
b97f70c
047595d
2352c83
d9a7d2f
4853453
a9c0215
894eef1
aa7d4bc
0b4b02d
c0b8aa6
3a02433
30136c8
0ff4dc5
f907098
27a2eb0
18fbf76
11592b0
8655f61
196dd7f
0dadbad
b68e541
824b05f
eac6943
a0be1fb
05a5b03
10ad796
9974e48
f4a4c7a
29dbf69
d527762
a6c7e55
1f72a22
3bce25d
90d87d0
1e9a116
cb2d736
38c8b70
50403f7
5907d64
3e7268e
81fc6d5
dad314a
bb213dc
5b71847
8d42d5f
b6d480c
ca0ad93
ce19b92
9a7008a
2bbbcae
ebdcf70
e32a6ab
19a8509
260e6bc
bad164c
414d96e
bf856ab
5fd1b85
2d2f740
cdf4684
6f4758d
5310f29
76793f0
ac25dc9
b52daa2
d6055c9
b84ff6b
dc480e0
6e420fe
c588e67
1669c0d
800faa4
e836bab
1078202
1ddccaa
f118fc2
b7f8fa3
259ba31
d804b75
2f67356
40cadd0
605f7bf
ef1a47e
527db66
411122b
ff12afb
1d20ecc
9af2c94
a9fb479
e2aac41
e5fd64b
07bca60
c40b30b
00d1dbc
fb82ca3
82d062e
fac62ad
830044d
0c83842
c9a55c8
daa910a
d263241
48119d7
39b2cef
38a83d6
0bd4f0f
34960a0
6b8a725
adb317d
5710676
574f0ea
568c1aa
7bdd703
eaab07d
905be92
1f306b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| //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 | ||
| //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.admin.backup; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| import org.apache.cloudstack.acl.RoleType; | ||
| import org.apache.cloudstack.api.APICommand; | ||
| import org.apache.cloudstack.api.ApiConstants; | ||
| import org.apache.cloudstack.api.BaseCmd; | ||
| import org.apache.cloudstack.api.Parameter; | ||
| import org.apache.cloudstack.api.command.admin.AdminCmd; | ||
| import org.apache.cloudstack.api.response.BackupResponse; | ||
| import org.apache.cloudstack.api.response.ImageTransferResponse; | ||
| import org.apache.cloudstack.api.response.VolumeResponse; | ||
| import org.apache.cloudstack.backup.ImageTransfer; | ||
| import org.apache.cloudstack.backup.KVMBackupExportService; | ||
| import org.apache.cloudstack.context.CallContext; | ||
|
|
||
| import com.cloud.utils.EnumUtils; | ||
|
|
||
| @APICommand(name = "createImageTransfer", | ||
| description = "Create image transfer for a disk in backup. This API is intended for testing only and is disabled by default.", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
this sentence exists in all APIs in this folder. is this correct ? @abh1sar
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes Wei, I don't want to expose these APIs to end users. Only Veeam control service uses them. |
||
| responseObject = ImageTransferResponse.class, | ||
| since = "4.23.0", | ||
| authorized = {RoleType.Admin}) | ||
| public class CreateImageTransferCmd extends BaseCmd implements AdminCmd { | ||
|
|
||
| @Inject | ||
| private KVMBackupExportService kvmBackupExportService; | ||
|
|
||
| @Parameter(name = ApiConstants.BACKUP_ID, | ||
| type = CommandType.UUID, | ||
| entityType = BackupResponse.class, | ||
| description = "ID of the backup") | ||
| private Long backupId; | ||
|
|
||
| @Parameter(name = ApiConstants.VOLUME_ID, | ||
| type = CommandType.UUID, | ||
| entityType = VolumeResponse.class, | ||
| required = true, | ||
| description = "ID of the disk/volume") | ||
| private Long volumeId; | ||
|
|
||
| @Parameter(name = ApiConstants.DIRECTION, | ||
| type = CommandType.STRING, | ||
| required = true, | ||
| description = "Direction of the transfer: upload, download") | ||
| private String direction; | ||
|
|
||
| @Parameter(name = ApiConstants.FORMAT, | ||
| type = CommandType.STRING, | ||
| description = "Format of the image: cow/raw. Currently only raw is supported for download. Defaults to raw if not provided") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think the image is qcow2/cow format, right ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, the description is confusing. the format here is not the disk format, but the image transfer format. I'll update the description to |
||
| private String format; | ||
|
|
||
| public Long getBackupId() { | ||
| return backupId; | ||
| } | ||
|
|
||
| public Long getVolumeId() { | ||
| return volumeId; | ||
| } | ||
|
|
||
| public ImageTransfer.Direction getDirection() { | ||
| return ImageTransfer.Direction.valueOf(direction); | ||
| } | ||
|
|
||
| public ImageTransfer.Format getFormat() { | ||
| return EnumUtils.getEnum(ImageTransfer.Format.class, format); | ||
| } | ||
|
|
||
| @Override | ||
| public void execute() { | ||
| ImageTransferResponse response = kvmBackupExportService.createImageTransfer(this); | ||
| response.setObjectName(ImageTransfer.class.getSimpleName().toLowerCase()); | ||
| response.setResponseName(getCommandName()); | ||
| setResponseObject(response); | ||
| } | ||
|
|
||
| @Override | ||
| public long getEntityOwnerId() { | ||
| return CallContext.current().getCallingAccount().getId(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| //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 | ||
| //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.admin.backup; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| import org.apache.cloudstack.acl.RoleType; | ||
| import org.apache.cloudstack.api.APICommand; | ||
| import org.apache.cloudstack.api.ApiConstants; | ||
| import org.apache.cloudstack.api.BaseCmd; | ||
| import org.apache.cloudstack.api.Parameter; | ||
| import org.apache.cloudstack.api.command.admin.AdminCmd; | ||
| import org.apache.cloudstack.api.response.SuccessResponse; | ||
| import org.apache.cloudstack.api.response.UserVmResponse; | ||
| import org.apache.cloudstack.backup.KVMBackupExportService; | ||
| import org.apache.cloudstack.context.CallContext; | ||
|
|
||
| @APICommand(name = "deleteVirtualMachineCheckpoint", | ||
| description = "Delete a VM checkpoint. This API is intended for testing only and is disabled by default.", | ||
| responseObject = SuccessResponse.class, | ||
| since = "4.23.0", | ||
| authorized = {RoleType.Admin}) | ||
| public class DeleteVmCheckpointCmd extends BaseCmd implements AdminCmd { | ||
|
|
||
| @Inject | ||
| private KVMBackupExportService kvmBackupExportService; | ||
|
|
||
| @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, | ||
| type = CommandType.UUID, | ||
| entityType = UserVmResponse.class, | ||
| required = true, | ||
| description = "ID of the VM") | ||
| private Long vmId; | ||
|
|
||
| @Parameter(name = "checkpointid", | ||
| type = CommandType.STRING, | ||
| required = true, | ||
| description = "Checkpoint ID") | ||
| private String checkpointId; | ||
|
|
||
| public Long getVmId() { | ||
| return vmId; | ||
| } | ||
|
|
||
| public String getCheckpointId() { | ||
| return checkpointId; | ||
| } | ||
|
|
||
| public void setVmId(Long vmId) { | ||
| this.vmId = vmId; | ||
| } | ||
|
|
||
| public void setCheckpointId(String checkpointId) { | ||
| this.checkpointId = checkpointId; | ||
| } | ||
|
|
||
| @Override | ||
| public void execute() { | ||
| boolean result = kvmBackupExportService.deleteVmCheckpoint(this); | ||
| SuccessResponse response = new SuccessResponse(getCommandName()); | ||
| response.setSuccess(result); | ||
| response.setResponseName(getCommandName()); | ||
| setResponseObject(response); | ||
| } | ||
|
|
||
| @Override | ||
| public long getEntityOwnerId() { | ||
| return CallContext.current().getCallingAccount().getId(); | ||
| } | ||
| } |
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.
@shwstppr
is
/etc/cloudstack/agent/cloud.ca.crtused ?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.
@abh1sar can tell better but I think yes we use cloud certificates for image server.
To the Veeam worker VM, we just pass the Root CA from the MS
Uh oh!
There was an error while loading. Please reload this page.
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.
that's right. Is it ok to show the file names?