Skip to content
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
35ed72c
Initial api and service layer changes
abh1sar Dec 25, 2024
e094e14
Nas backup provider changes
abh1sar Dec 25, 2024
27feeda
Add hypervisor, service_offering and template to backups table.
abh1sar Dec 30, 2024
f98da37
Create backup_details table and add details related to vm.
abh1sar Jan 1, 2025
04a2deb
Initial UI form
abh1sar Jan 2, 2025
d3439ad
Save networkIds and diskOfferingIds in backup_details. Create require…
abh1sar Jan 3, 2025
753d80f
Restore backup to VM plugin change for VeeamBackupProvider
abh1sar Jan 5, 2025
72c943f
UI form updates
abh1sar Jan 6, 2025
7ae078e
Create instance from backup using just the backupid
abh1sar Jan 7, 2025
31f89df
Remove zone and iso from DeployVMFromBackup.vue
abh1sar Jan 7, 2025
7e3f083
Create multiple data volumes using the deployVirtualMachine Api
abh1sar Jan 9, 2025
f46fad8
Create multiple data volumes for createVMFromBackup api and ui
abh1sar Jan 9, 2025
d941809
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jan 9, 2025
10f7beb
Fix build failure after merge
abh1sar Jan 9, 2025
edbdd01
setup ssh key pair again after restore
abh1sar Jan 10, 2025
f004264
added miniops and maxiops customisation in ui
abh1sar Jan 10, 2025
b1a86b8
added UT for backupManager and UserVmManager
abh1sar Jan 12, 2025
3b317e0
Minor ui fixes and null checks
abh1sar Jan 13, 2025
cfc9c6f
Remove import vm from restorebackuptoinstance
abh1sar Jan 14, 2025
8717e3a
set willDeleteBackupsOnOfferingRemoval to false for dummy and veeam. …
abh1sar Jan 14, 2025
f4f0655
Preserve device Ids of data volumes in the new instance.
abh1sar Jan 14, 2025
07f24cb
Throw exception if diskOffering stored in the backup is not present.
abh1sar Jan 14, 2025
38ad9be
Limit the volume size of new instance to minimum of backup volume size
abh1sar Jan 14, 2025
c2db7af
diskofferingid not supported by createVmFromBackup
abh1sar Jan 14, 2025
50aae80
remove userdata from ui form
abh1sar Jan 14, 2025
963437d
Remove console logs from ui forms
abh1sar Jan 14, 2025
300d096
fix UT failures in BackupManagerTest and UserVmManagerImplTest
abh1sar Jan 15, 2025
3c3885c
Merge branch 'main' into instance-from-backup
abh1sar Jan 15, 2025
0bea21f
Peserve override disk offering from backup
abh1sar Jan 16, 2025
129cb85
Merge branch 'instance-from-backup' of https://github.com/shapeblue/c…
abh1sar Jan 16, 2025
723537b
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jan 16, 2025
683aebe
Fix ut issue on merge
abh1sar Jan 16, 2025
5992a1e
Addressed minor review comments
abh1sar Jan 16, 2025
2da38da
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jan 16, 2025
5ab6c4a
Fix spelling errors.
abh1sar Jan 16, 2025
26d26d8
added more Unit Tests
abh1sar Jan 19, 2025
0cebdae
Merge branch 'main' into instance-from-backup
abh1sar Jan 19, 2025
7c600c7
Return diskofferingid for compute only diskoffering as well in servic…
abh1sar Jan 28, 2025
ac96d06
minor ui fixes
abh1sar Jan 28, 2025
08d4581
Handle inactive disk offering edge case
abh1sar Jan 28, 2025
735c379
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jan 28, 2025
675fc8d
backupvmdetails will be shown in listbackupsresponse only if listvmde…
abh1sar Feb 5, 2025
b708397
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Feb 5, 2025
4d2e444
remove extra line from schema-42010to42100.sql
abh1sar Feb 5, 2025
b7590ba
update Template selection + minor fixes
abh1sar Feb 24, 2025
ae62219
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Feb 24, 2025
9559323
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Feb 28, 2025
934b7ab
Add name and description to backup create
abh1sar Feb 28, 2025
1626a37
Fix UT failure in BackupManagerTest
abh1sar Mar 2, 2025
0043207
Fix UT failure in BackupManagerTest
abh1sar Mar 2, 2025
a60b717
Fix imports in VeeamBackupProvider
abh1sar Mar 3, 2025
4197912
Add object storage capacity and alerts.
abh1sar Mar 3, 2025
beb05ae
Backup storage capacity and alert framework layer.
abh1sar Mar 4, 2025
c72a10e
Nas provider support for backup storage stats
abh1sar Mar 6, 2025
54bf763
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Mar 6, 2025
7791ff3
Don't show object store and backup capacity if total capacity is 0
abh1sar Mar 6, 2025
3d3f6c1
Merge branch 'instance-from-backup' of https://github.com/shapeblue/c…
abh1sar Mar 6, 2025
051d52c
Handle backup listing and restore for expunged and purged Instances
abh1sar Mar 10, 2025
73c185c
Merge remote-tracking branch 'upstream/main' into instance-from-backup
abh1sar Mar 10, 2025
dd45cfe
Fix BackupManagerTest failure
abh1sar Mar 10, 2025
9894eff
Added UT to AlertManager, BackupDao, NasBackupProvider and BackupMana…
abh1sar Mar 11, 2025
47b6cd1
make capacity dasboard scrollable
abh1sar Mar 11, 2025
e909c18
Fix syntax errors in schema-42010to42100.sql
abh1sar Mar 11, 2025
22d25d3
Fix pre commit failure in BackupDaoImplTest
abh1sar Mar 11, 2025
4997056
Enable cephFS in NAS backup repository
abh1sar Mar 11, 2025
1574f3a
Error out vm expunge from destroyvmCmd if it has a backup offering wi…
abh1sar Mar 11, 2025
912639b
Extract duplicate code into new method checkAndRemoveBackupOfferingBe…
abh1sar Mar 12, 2025
1123adf
Addressed last set of review comments
abh1sar Mar 17, 2025
d76cb40
fix npe in updateObjectStore
abh1sar Mar 18, 2025
b2a499e
Handle backup offering remove without deleting backups
abh1sar Mar 20, 2025
bdeb62d
Remove the concept of orphaned backup as vm with backups cannot be pu…
abh1sar Mar 20, 2025
918b8b8
fix listVmIdsWithBackupsInZone
abh1sar Mar 26, 2025
39ea6b7
Add dataSize, backupSize to Backup.RestorePoint for all providers
abh1sar Mar 27, 2025
55486d6
minor UI fixes
abh1sar Mar 27, 2025
f49651f
Show name,description fields only for synchronous backup provider plu…
abh1sar Mar 28, 2025
a50f358
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Mar 28, 2025
c307f82
Fix test failure in BackupDaoImplTest
abh1sar Mar 28, 2025
e0a1c97
Added UT and minor bug fixes
abh1sar Mar 30, 2025
d1b9b6a
Merge branch 'main' into instance-from-backup
abh1sar Apr 2, 2025
70d2395
Merge branch 'instance-from-backup' of https://github.com/shapeblue/c…
abh1sar Apr 9, 2025
c45efba
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Apr 9, 2025
1241252
fixed for build failure in NASBackupProvider
abh1sar Apr 10, 2025
eb4b132
Addressed last set of review comments from Wei.
abh1sar Apr 10, 2025
f8a20a4
Fixed deploydb issue by using TEXT instead of varchar(65536) in backu…
abh1sar Apr 10, 2025
17ecc5a
Handle create VM from backup for VMs created using ISO.
abh1sar Apr 11, 2025
6b098ce
Minor bug fix in UserVmManagerImpl
abh1sar Apr 11, 2025
8803c78
Fix for UT failures
abh1sar Apr 11, 2025
57b0f2c
Fix build failures
abh1sar Apr 11, 2025
1075a55
BaseDeployVMCmd as the base class for DeployVmCmd and CreateVmFromBac…
abh1sar Apr 14, 2025
d2fb239
Fix Expunge generic error
abh1sar Apr 23, 2025
2d89a8f
Fix Backup Storage capacity and NAS backup without mount options
abh1sar Apr 23, 2025
e2fa0be
Dummy BnR plugin integration test
abh1sar Apr 25, 2025
f3f3f97
Store and get IpAddresses details from backup metadata while creating…
abh1sar Apr 29, 2025
555eed8
fix pre-commit failure in CreateVMFromBackupCmd
abh1sar Apr 29, 2025
a34c78a
Added more UT to UserVmManagerImplTest
abh1sar May 1, 2025
a298c33
Fix errors in testDestroyVM in UserVmManagerImplTest
abh1sar May 1, 2025
062e343
Add more UT to BackupManagerTest
abh1sar May 1, 2025
359af7b
Added UT to BackupManager, NetworkService and StorageManager
abh1sar May 2, 2025
cd91111
Merge remote-tracking branch 'upstream/main' into instance
abh1sar May 5, 2025
5ff2e36
Fixed a bug in publishUsageEvent
abh1sar May 5, 2025
756af19
Fixed compilation error in BackupManagerTest
abh1sar May 5, 2025
58d1067
Add Nas backup and recovery integration test
abh1sar May 5, 2025
bb97ea6
Merge branch 'instance-from-backup' of https://github.com/shapeblue/c…
abh1sar May 5, 2025
4ef398b
Disallow offering delete if it is not assigned to any vm, but it has …
abh1sar May 5, 2025
8c881ef
Add backup offering in the list view and search filter in list backups
abh1sar May 6, 2025
784cf76
Merge branch 'instance-from-backup' of https://github.com/shapeblue/c…
abh1sar May 6, 2025
c31da8b
use listBackupOfferings instead of listConfiguration in startbackup.v…
abh1sar May 6, 2025
1e164ef
Don't show select deployment infra section to end users in create ins…
abh1sar May 6, 2025
b6f1c62
Move diskofferingid, miniops and maxiops from backup details to backu…
abh1sar May 11, 2025
910c719
Fix upgrade path issues
abh1sar May 12, 2025
8b9d861
Fix Restore and Attach single volume when the original vm and volume …
abh1sar May 12, 2025
a8d74ed
Merge remote-tracking branch 'upstream/main' into instance
abh1sar May 12, 2025
bc1beb6
Merge branch 'main' into instance-from-backup
abh1sar May 13, 2025
127f807
Fix error in restoring an expunged vm
abh1sar May 14, 2025
40ba664
Merge remote-tracking branch 'upstream/main' into instance
abh1sar May 20, 2025
1b10b3b
Get backed up disk offering details from backup.volumeinfo
abh1sar May 20, 2025
f644f9c
Merge remote-tracking branch 'upstream/main' into instance
abh1sar May 28, 2025
96c4652
Fix keyword and name search for backups
abh1sar May 28, 2025
091c21a
don't call vmInstanceDao.listByIdsIncludingRemoved with empty list.
abh1sar Jun 5, 2025
d6d4442
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jun 5, 2025
440fcc0
Handle delete network in Create Instance from Backup form
abh1sar Jun 10, 2025
6bedc27
Set the backup status as 'Error' in case of any error from backend.
abh1sar Jun 10, 2025
118bbe2
Cleanup the created VM if restore fails afterwards.
abh1sar Jun 10, 2025
2e8e8e3
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jun 11, 2025
622393f
Fix build failure
abh1sar Jun 11, 2025
47459ed
Enable setting lease for instance created from backup
abh1sar Jun 11, 2025
6b60a21
Handle null l2 network ipaddress during preserve ip
abh1sar Jun 12, 2025
75859b6
Merge branch 'main' into instance-from-backup
abh1sar Jun 13, 2025
18dd883
honour and show object store total size
abh1sar Jun 17, 2025
79f83db
Fixed error handling in nasbackup.sh
abh1sar Jun 18, 2025
3aa0954
Fix bucket quota checks
abh1sar Jun 19, 2025
2db672d
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jun 19, 2025
184d98f
fix complation error after merge
abh1sar Jun 19, 2025
f8448b3
fix ut failure in BucketApiServiceImplTest
abh1sar Jun 19, 2025
f14e93c
Error handling in nas backup plugin
abh1sar Jun 26, 2025
dfbbc49
Fix BackupManagerTest failure
abh1sar Jun 26, 2025
9ce63f9
fix iso and hypervisor type
abh1sar Jun 30, 2025
8b9f9b5
return error from the rsync command during restore
abh1sar Jun 30, 2025
ef59186
freeze the fs before backup-begin in nasbackup.sh
abh1sar Jun 30, 2025
0f2606f
iso fixes
abh1sar Jul 1, 2025
f703751
Add volume size checks for rootdisk and overrride rootdisk
abh1sar Jul 1, 2025
39a3ce0
Add quiesce option to createBackup and CreateBackupSchedule
abh1sar Jul 2, 2025
0740088
fix minor bug in BackupSchedule.vue
abh1sar Jul 2, 2025
e2f2f24
Disable console access for Restoring VMs.
abh1sar Jul 2, 2025
ffce09e
Merge branch 'main' into instance-from-backup
abh1sar Jul 8, 2025
e8445bb
Added UT for DeployVMCmd
abh1sar Jul 8, 2025
f3a7878
Merge branch 'instance-from-backup' of https://github.com/shapeblue/c…
abh1sar Jul 8, 2025
cb833ac
fix ui api -> getAPI
abh1sar Jul 8, 2025
d45ef5e
fix lint
abh1sar Jul 8, 2025
d96d969
fix checkstyle
abh1sar Jul 8, 2025
a94104d
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jul 15, 2025
759579c
Fix merge issues
abh1sar Jul 15, 2025
0bdd37e
fix size check logic and deleted template
abh1sar Jul 17, 2025
285d6f0
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jul 17, 2025
75d8888
fix ut errors
abh1sar Jul 17, 2025
f38db97
Show name in backup list in Instance tab + some changes in error, log…
abh1sar Jul 18, 2025
cb7123f
fix UT failure
abh1sar Jul 18, 2025
8ba1436
Show backup instance metadata as a separate tab
abh1sar Jul 20, 2025
4bacb50
Save and restore Instance settings to/from backup
abh1sar Jul 21, 2025
b5830c6
Fix UT
abh1sar Jul 21, 2025
a3f7bfa
review comments
abh1sar Jul 21, 2025
65ac762
add license to BackupMetadata.vue
abh1sar Jul 21, 2025
7572d7b
fix checkstyle
abh1sar Jul 21, 2025
c8987c6
fix backupdaoimpltest
abh1sar Jul 21, 2025
34bb9f2
fix backupmanagertest
abh1sar Jul 21, 2025
e03b9c0
fix error in VeeamBackupProvider.java
abh1sar Jul 21, 2025
cc69f4f
Don't overwrite vm settings during create from backup + nas backup fix
abh1sar Jul 22, 2025
fdb8349
Error out create instance early for other providers
abh1sar Jul 22, 2025
1fc6742
get template details from backup in backup response
abh1sar Jul 22, 2025
1dc12e2
fix UserVmManagerImplTest
abh1sar Jul 22, 2025
fef53cf
Use VmDiskInfo inplace of DiskOfferingInfo to pass disk related infor…
abh1sar Jul 23, 2025
1fec98a
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jul 23, 2025
2018822
fix override disk offering + BackupManagerTest
abh1sar Jul 23, 2025
85f86be
revert change to make vm_id nullable in backup table
abh1sar Jul 24, 2025
9463711
Merge remote-tracking branch 'upstream/main' into instance
abh1sar Jul 24, 2025
a3a8106
rename UserVMDetails to VMInstanceDetails
abh1sar Jul 24, 2025
317b23e
addressed review comments
abh1sar Jul 25, 2025
d96a2b8
fix checkstyle
abh1sar Jul 25, 2025
e82bcfd
Merge remote-tracking branch 'upstream/main' into instance-from-backup
abh1sar Jul 25, 2025
66aeff8
smoke test failure + minor fixes
abh1sar Jul 26, 2025
2ae9ca4
Merge remote-tracking branch 'upstream/main' into instance-from-backu…
abh1sar Jul 28, 2025
ffc6ab8
fix checkstyle
abh1sar Jul 28, 2025
9451c48
Merge remote-tracking branch 'upstream/main' into instance-from-backu…
abh1sar Jul 29, 2025
59aac60
Merge remote-tracking branch 'upstream/main' into instance-from-backu…
abh1sar Jul 29, 2025
629127b
fix backupmanagertest
abh1sar Jul 29, 2025
6e5fa8d
Merge remote-tracking branch 'upstream/main' into instance-from-backu…
abh1sar Jul 29, 2025
f9cf862
Merge branch 'main' into instance-from-backup
abh1sar Jul 30, 2025
226e82a
Merge remote-tracking branch 'upstream/main' into instance-from-backup
abh1sar Jul 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion api/src/main/java/com/cloud/capacity/Capacity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ public interface Capacity extends InternalIdentity, Identity {
public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9;
public static final short CAPACITY_TYPE_VIRTUAL_NETWORK_IPV6_SUBNET = 10;
public static final short CAPACITY_TYPE_GPU = 19;
public static final short CAPACITY_TYPE_OBJECT_STORAGE = 20;
public static final short CAPACITY_TYPE_BACKUP_STORAGE = 21;

public static final short CAPACITY_TYPE_CPU_CORE = 90;

public static final List<Short> STORAGE_CAPACITY_TYPES = List.of(CAPACITY_TYPE_STORAGE,
CAPACITY_TYPE_STORAGE_ALLOCATED,
CAPACITY_TYPE_SECONDARY_STORAGE,
CAPACITY_TYPE_LOCAL_STORAGE);
CAPACITY_TYPE_LOCAL_STORAGE,
CAPACITY_TYPE_BACKUP_STORAGE,
CAPACITY_TYPE_OBJECT_STORAGE);

public Long getHostOrPoolId();

Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/event/EventTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,10 @@ public class EventTypes {
public static final String EVENT_VM_BACKUP_IMPORT_OFFERING = "BACKUP.IMPORT.OFFERING";
public static final String EVENT_VM_BACKUP_OFFERING_ASSIGN = "BACKUP.OFFERING.ASSIGN";
public static final String EVENT_VM_BACKUP_OFFERING_REMOVE = "BACKUP.OFFERING.REMOVE";
public static final String EVENT_VM_BACKUP_DELETE_LAST_POST_OFFERING_REMOVE = "BACKUP.DELETE.LAST.POST.OFFERING.REMOVE";
public static final String EVENT_VM_BACKUP_CREATE = "BACKUP.CREATE";
public static final String EVENT_VM_BACKUP_RESTORE = "BACKUP.RESTORE";
public static final String EVENT_VM_BACKUP_RESTORE_TO_VM = "BACKUP.RESTORE.TO.VM";
public static final String EVENT_VM_BACKUP_DELETE = "BACKUP.DELETE";
public static final String EVENT_VM_BACKUP_RESTORE_VOLUME_TO_VM = "BACKUP.RESTORE.VOLUME.TO.VM";
public static final String EVENT_VM_BACKUP_SCHEDULE_CONFIGURE = "BACKUP.SCHEDULE.CONFIGURE";
Expand Down
21 changes: 21 additions & 0 deletions api/src/main/java/com/cloud/offering/DiskOfferingInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DiskOfferingInfo {
private Long _size;
private Long _minIops;
private Long _maxIops;
private Long _deviceId;

public DiskOfferingInfo() {
}
Expand All @@ -31,6 +32,18 @@ public DiskOfferingInfo(DiskOffering diskOffering) {
_diskOffering = diskOffering;
}

public DiskOfferingInfo(DiskOffering diskOffering, Long size, Long minIops, Long maxIops) {
_diskOffering = diskOffering;
_size = size;
_minIops = minIops;
_maxIops = maxIops;
}

public DiskOfferingInfo(DiskOffering diskOffering, Long size, Long minIops, Long maxIops, Long deviceId) {
this(diskOffering, size, minIops, maxIops);
_deviceId = deviceId;
}

public void setDiskOffering(DiskOffering diskOffering) {
_diskOffering = diskOffering;
}
Expand Down Expand Up @@ -62,4 +75,12 @@ public void setMaxIops(Long maxIops) {
public Long getMaxIops() {
return _maxIops;
}

public void setDeviceId(Long deviceId) {
_deviceId = deviceId;
}

public Long getDeviceId() {
return _deviceId;
}
}
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/storage/StorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public interface StorageService {

void removeSecondaryStorageHeuristic(RemoveSecondaryStorageSelectorCmd cmd);

ObjectStore discoverObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
ObjectStore discoverObjectStore(String name, String url, Long size, String providerName, Map details) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;

boolean deleteObjectStore(DeleteObjectStoragePoolCmd cmd);

Expand Down
15 changes: 10 additions & 5 deletions api/src/main/java/com/cloud/vm/UserVmService.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd;
import org.apache.cloudstack.api.command.user.vm.CreateVMFromBackupCmd;
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
import org.apache.cloudstack.api.command.user.vm.DestroyVMCmd;
import org.apache.cloudstack.api.command.user.vm.RebootVMCmd;
Expand Down Expand Up @@ -55,6 +56,7 @@
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.network.Network.IpAddresses;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.DiskOfferingInfo;
import com.cloud.offering.ServiceOffering;
import com.cloud.storage.StoragePool;
import com.cloud.template.VirtualMachineTemplate;
Expand Down Expand Up @@ -217,7 +219,7 @@ void startVirtualMachineForHA(VirtualMachine vm, Map<VirtualMachineProfile.Param
* available.
*/
UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList,
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod,
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, List<DiskOfferingInfo> dataDiskOfferingsInfo, String group, HypervisorType hypervisor, HTTPMethod httpmethod,
String userData, Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard,
List<Long> affinityGroupIdList, Map<String, String> customParameter, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
Expand Down Expand Up @@ -294,7 +296,7 @@ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering s
* available.
*/
UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList,
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor,
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, List<DiskOfferingInfo> dataDiskOfferingsInfo, String group, HypervisorType hypervisor,
HTTPMethod httpmethod, String userData, Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard,
List<Long> affinityGroupIdList, Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap,
Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap, Map<String, String> userVmOVFProperties, boolean dynamicScalingEnabled, Long overrideDiskOfferingId, String vmType) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
Expand Down Expand Up @@ -366,7 +368,7 @@ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOfferin
* available.
*/
UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner,
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
String hostName, String displayName, Long diskOfferingId, Long diskSize, List<DiskOfferingInfo> dataDiskOfferingsInfo, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
Long userDataId, String userDataDetails, List<String> sshKeyPairs, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList,
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled, String vmType, Long overrideDiskOfferingId)
Expand Down Expand Up @@ -412,8 +414,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
void deletePrivateTemplateRecord(Long templateId);

HypervisorType getHypervisorTypeOfUserVM(long vmid);

UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
StorageUnavailableException, ResourceAllocationException;

/**
Expand Down Expand Up @@ -513,4 +514,8 @@ UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemp
* @return true if the VM is successfully unmanaged, false if not.
*/
boolean unmanageUserVM(Long vmId);

UserVm allocateVMFromBackup(CreateVMFromBackupCmd cmd) throws InsufficientCapacityException, ResourceAllocationException, ResourceUnavailableException;

UserVm restoreVMFromBackup(CreateVMFromBackupCmd cmd) throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException;
}
1 change: 0 additions & 1 deletion api/src/main/java/com/cloud/vm/VirtualMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ public static StateMachine2<State, VirtualMachine.Event, VirtualMachine> getStat
s_fsm.addTransition(new Transition<State, Event>(State.Error, VirtualMachine.Event.DestroyRequested, State.Expunging, null));
s_fsm.addTransition(new Transition<State, Event>(State.Error, VirtualMachine.Event.ExpungeOperation, State.Expunging, null));
s_fsm.addTransition(new Transition<State, Event>(State.Stopped, Event.RestoringRequested, State.Restoring, null));
s_fsm.addTransition(new Transition<State, Event>(State.Expunging, Event.RestoringRequested, State.Restoring, null));
s_fsm.addTransition(new Transition<State, Event>(State.Destroyed, Event.RestoringRequested, State.Restoring, null));
s_fsm.addTransition(new Transition<State, Event>(State.Restoring, Event.RestoringSuccess, State.Stopped, null));
s_fsm.addTransition(new Transition<State, Event>(State.Restoring, Event.RestoringFailed, State.Stopped, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ private AlertType(short type, String name, boolean isDefault) {
public static final AlertType ALERT_TYPE_VM_SNAPSHOT = new AlertType((short)32, "ALERT.VM.SNAPSHOT", true);
public static final AlertType ALERT_TYPE_VR_PUBLIC_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PUBLIC.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_VR_PRIVATE_IFACE_MTU = new AlertType((short)32, "ALERT.VR.PRIVATE.IFACE.MTU", true);
public static final AlertType ALERT_TYPE_BACKUP_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_BACKUP_STORAGE, "ALERT.STORAGE.BACKUP", true);
public static final AlertType ALERT_TYPE_OBJECT_STORAGE = new AlertType(Capacity.CAPACITY_TYPE_OBJECT_STORAGE, "ALERT.STORAGE.OBJECT", true);

public short getType() {
return type;
Expand Down
9 changes: 9 additions & 0 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ApiConstants {
public static final String ADDRESS = "address";
public static final String ALGORITHM = "algorithm";
public static final String ALIAS = "alias";
public static final String ALLOCATED = "allocated";
public static final String ALLOCATED_DATE = "allocateddate";
public static final String ALLOCATED_ONLY = "allocatedonly";
public static final String ALLOCATED_TIME = "allocated";
Expand Down Expand Up @@ -59,6 +60,7 @@ public class ApiConstants {
public static final String BACKUP_STORAGE_AVAILABLE = "backupstorageavailable";
public static final String BACKUP_STORAGE_LIMIT = "backupstoragelimit";
public static final String BACKUP_STORAGE_TOTAL = "backupstoragetotal";
public static final String BACKUP_VM_OFFERING_REMOVED = "vmbackupofferingremoved";
public static final String BACKUP_TOTAL = "backuptotal";
public static final String BASE64_IMAGE = "base64image";
public static final String BGP_PEERS = "bgppeers";
Expand Down Expand Up @@ -144,6 +146,7 @@ public class ApiConstants {
public static final String MAX_IOPS = "maxiops";
public static final String HYPERVISOR_SNAPSHOT_RESERVE = "hypervisorsnapshotreserve";
public static final String DATACENTER_NAME = "datacentername";
public static final String DATADISKS_DETAILS = "datadisksdetails";
public static final String DATADISK_OFFERING_LIST = "datadiskofferinglist";
public static final String DEFAULT_VALUE = "defaultvalue";
public static final String DELETE_PROTECTION = "deleteprotection";
Expand All @@ -152,6 +155,7 @@ public class ApiConstants {
public static final String DESTINATION_ZONE_ID = "destzoneid";
public static final String DETAILS = "details";
public static final String DEVICE_ID = "deviceid";
public static final String DEVICE_IDS = "deviceids";
public static final String DIRECT_DOWNLOAD = "directdownload";
public static final String DISK = "disk";
public static final String DISK_OFFERING_ID = "diskofferingid";
Expand All @@ -163,7 +167,9 @@ public class ApiConstants {
public static final String DISK_IO_WRITE = "diskiowrite";
public static final String DISK_IO_PSTOTAL = "diskiopstotal";
public static final String DISK_SIZE = "disksize";
public static final String DISK_SIZES = "disksizes";
public static final String DISK_SIZE_STRICTNESS = "disksizestrictness";
public static final String DISK_OFFERING_IDS = "diskofferingids";
public static final String DISK_OFFERING_STRICTNESS = "diskofferingstrictness";
public static final String DOWNLOAD_DETAILS = "downloaddetails";
public static final String UTILIZATION = "utilization";
Expand Down Expand Up @@ -517,6 +523,7 @@ public class ApiConstants {
public static final String TRUST_STORE_PASSWORD = "truststorepass";
public static final String URL = "url";
public static final String USAGE_INTERFACE = "usageinterface";
public static final String USED = "used";
public static final String USED_SUBNETS = "usedsubnets";
public static final String USED_IOPS = "usediops";
public static final String USER_DATA = "userdata";
Expand Down Expand Up @@ -561,6 +568,7 @@ public class ApiConstants {
public static final String IS_DEDICATED = "isdedicated";
public static final String TAKEN = "taken";
public static final String VM_AVAILABLE = "vmavailable";
public static final String VM_DETAILS = "vmdetails";
public static final String VM_LIMIT = "vmlimit";
public static final String VM_TOTAL = "vmtotal";
public static final String VM_TYPE = "vmtype";
Expand Down Expand Up @@ -744,6 +752,7 @@ public class ApiConstants {
public static final String LIST_ALL = "listall";
public static final String LIST_ONLY_REMOVED = "listonlyremoved";
public static final String LIST_SYSTEM_VMS = "listsystemvms";
public static final String LIST_VM_DETAILS = "listvmdetails";
public static final String IP_RANGES = "ipranges";
public static final String IPV4_ROUTING = "ip4routing";
public static final String IPV4_ROUTES = "ip4routes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ List<TemplateResponse> createTemplateResponses(ResponseView view, VirtualMachine

UserDataResponse createUserDataResponse(UserData userData);

BackupResponse createBackupResponse(Backup backup);
BackupResponse createBackupResponse(Backup backup, Boolean listVmDetails);

BackupScheduleResponse createBackupScheduleResponse(BackupSchedule backup);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ public int compare(CapacityResponse resp1, CapacityResponse resp2) {
int res = resp1.getZoneName().compareTo(resp2.getZoneName());
if (res != 0) {
return res;
} else if (getSortBy() != null) {
Copy link
Member

Choose a reason for hiding this comment

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

makes sense
will you create a separated pr for 4.19/4.20 ? @abh1sar

return 0;
} else {
return resp1.getCapacityType().compareTo(resp2.getCapacityType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class AddObjectStoragePoolCmd extends BaseCmd {
@Parameter(name = ApiConstants.TAGS, type = CommandType.STRING, description = "the tags for the storage pool")
private String tags;

@Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, description = "the total size of the object store in GiB. Used for tracking capacity and sending alerts", since = "4.21")
private Long size;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand All @@ -68,6 +71,10 @@ public String getName() {
return name;
}

public Long getTotalSize() {
return size;
}

public Map<String, String> getDetails() {
Map<String, String> detailsMap = null;
if (details != null && !details.isEmpty()) {
Expand Down Expand Up @@ -112,7 +119,7 @@ public long getEntityOwnerId() {
@Override
public void execute(){
try{
ObjectStore result = _storageService.discoverObjectStore(getName(), getUrl(), getProviderName(), getDetails());
ObjectStore result = _storageService.discoverObjectStore(getName(), getUrl(), getTotalSize(), getProviderName(), getDetails());
ObjectStoreResponse storeResponse = null;
if (result != null) {
storeResponse = _responseGenerator.createObjectStoreResponse(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class UpdateObjectStoragePoolCmd extends BaseCmd {
@Parameter(name = ApiConstants.URL, type = CommandType.STRING, description = "the url for the object store")
private String url;

@Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, description = "the total size of the object store in GiB. Used for tracking capacity and sending alerts", since = "4.21")
private Long size;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
Expand All @@ -61,6 +63,10 @@ public String getUrl() {
return url;
}

public Long getSize() {
return size;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public class CreateBackupCmd extends BaseAsyncCreateCmd {
description = "ID of the VM")
private Long vmId;

@Parameter(name = ApiConstants.NAME,
type = CommandType.STRING,
description = "the name of the backup",
since = "4.21.0")
private String name;

@Parameter(name = ApiConstants.DESCRIPTION,
type = CommandType.STRING,
description = "the description for the backup",
since = "4.21.0")
private String description;

@Parameter(name = ApiConstants.SCHEDULE_ID,
type = CommandType.LONG,
entityType = BackupScheduleResponse.class,
Expand All @@ -77,6 +89,14 @@ public Long getVmId() {
return vmId;
}

public String getName() {
return name;
}

public String getDescription() {
return description;
}

public Long getScheduleId() {
if (scheduleId != null) {
return scheduleId;
Expand All @@ -92,7 +112,7 @@ public Long getScheduleId() {
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
try {
boolean result = backupManager.createBackup(getVmId(), getScheduleId());
boolean result = backupManager.createBackup(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
response.setResponseName(getCommandName());
Expand Down
Loading
Loading