Skip to content

Commit c5afee2

Browse files
abh1sarDaanHooglandlucas-a-martinsLucas Martinsborisstoyanov
authored
UI improvements (#9773)
* Show Usage Server configuration in a separate pane * UI: Option to attach volume to an instance during create volume * Show service ip in management server details tab * change Schedule Snapshots to Recurring Snapshots * Change the hypervisor order so that kvm, vmware, xenserver show up first * Remove extra space in hypervisor names in config.java * Fix `updateTemplatePermission` when the UI is set to a language other than English (#9766) * Fix updateTemplatePermission UI in non-english language * Improve fix --------- Co-authored-by: Lucas Martins <[email protected]> * Autofill vcenter details in add cluster form * UI: condition to display create vm-vol-snapshots to same as create vol-snapshots * Fix alignment on wrapping in global settings tabs * rename Autofill vCenter credentials to Autofill vCenter credentials from Zone * Rename Service Ip to Ip Address in management server response * Change description of kvm.snapshot.enabled to say that it applies to volume snapshots * Return error when kvm vm snapshot is taken withoutsnapshot memory * Minor naming changes and grammar * Fix tooltip for attach volume to instance button * Show Usage Server configuration in a separate pane * UI: Option to attach volume to an instance during create volume * Show service ip in management server details tab * change Schedule Snapshots to Recurring Snapshots * Change the hypervisor order so that kvm, vmware, xenserver show up first * Remove extra space in hypervisor names in config.java * Autofill vcenter details in add cluster form * UI: condition to display create vm-vol-snapshots to same as create vol-snapshots * Fix alignment on wrapping in global settings tabs * rename Autofill vCenter credentials to Autofill vCenter credentials from Zone * Rename Service Ip to Ip Address in management server response * Change description of kvm.snapshot.enabled to say that it applies to volume snapshots * Return error when kvm vm snapshot is taken withoutsnapshot memory * Minor naming changes and grammar * Fix tooltip for attach volume to instance button * Show Usage Server configuration in a separate pane * UI: Option to attach volume to an instance during create volume * Show service ip in management server details tab * change Schedule Snapshots to Recurring Snapshots * Change the hypervisor order so that kvm, vmware, xenserver show up first * Remove extra space in hypervisor names in config.java * Autofill vcenter details in add cluster form * UI: condition to display create vm-vol-snapshots to same as create vol-snapshots * Fix alignment on wrapping in global settings tabs * rename Autofill vCenter credentials to Autofill vCenter credentials from Zone * Rename Service Ip to Ip Address in management server response * Change description of kvm.snapshot.enabled to say that it applies to volume snapshots * Return error when kvm vm snapshot is taken withoutsnapshot memory * Minor naming changes and grammar * Fix tooltip for attach volume to instance button * UI: Option to attach volume to an instance during create volume * UI: condition to display create vm-vol-snapshots to same as create vol-snapshots * moved db changes from 41900to42000 to 42000to42010 * Update group_id in already present usage configuration settings * remove "schedule" from message in create Recurring Snapshots form * Update server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java --------- Co-authored-by: Daan Hoogland <[email protected]> Co-authored-by: Lucas Martins <[email protected]> Co-authored-by: Lucas Martins <[email protected]> Co-authored-by: Boris Stoyanov - a.k.a Bobby <[email protected]> Co-authored-by: Andrija Panic <[email protected]>
1 parent 986ec81 commit c5afee2

File tree

21 files changed

+213
-78
lines changed

21 files changed

+213
-78
lines changed

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ public class ApiConstants {
447447
public static final String SENT = "sent";
448448
public static final String SENT_BYTES = "sentbytes";
449449
public static final String SERIAL = "serial";
450-
public static final String SERVICE_IP = "serviceip";
451450
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
452451
public static final String SESSIONKEY = "sessionkey";
453452
public static final String SHOW_CAPACITIES = "showcapacities";

api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public class ManagementServerResponse extends BaseResponse {
7474
@Param(description = "the running OS kernel version for this Management Server")
7575
private String kernelVersion;
7676

77-
@SerializedName(ApiConstants.SERVICE_IP)
77+
@SerializedName(ApiConstants.IP_ADDRESS)
7878
@Param(description = "the IP Address for this Management Server")
79-
private String serviceIp;
79+
private String ipAddress;
8080

8181
@SerializedName(ApiConstants.PEERS)
8282
@Param(description = "the Management Server Peers")
@@ -122,8 +122,8 @@ public Date getLastBoot() {
122122
return lastBoot;
123123
}
124124

125-
public String getServiceIp() {
126-
return serviceIp;
125+
public String getIpAddress() {
126+
return ipAddress;
127127
}
128128

129129
public void setId(String id) {
@@ -170,8 +170,8 @@ public void setKernelVersion(String kernelVersion) {
170170
this.kernelVersion = kernelVersion;
171171
}
172172

173-
public void setServiceIp(String serviceIp) {
174-
this.serviceIp = serviceIp;
173+
public void setIpAddress(String ipAddress) {
174+
this.ipAddress = ipAddress;
175175
}
176176

177177
public String getKernelVersion() {

engine/schema/src/main/resources/META-INF/db/schema-42000to42010.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user', 'api_key_access', 'boolean DE
2424
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.account', 'api_key_access', 'boolean DEFAULT NULL COMMENT "is api key access allowed for the account" ');
2525
CALL `cloud_usage`.`IDEMPOTENT_ADD_COLUMN`('cloud_usage.account', 'api_key_access', 'boolean DEFAULT NULL COMMENT "is api key access allowed for the account" ');
2626

27+
-- Create a new group for Usage Server related configurations
28+
INSERT INTO `cloud`.`configuration_group` (`name`, `description`, `precedence`) VALUES ('Usage Server', 'Usage Server related configuration', 9);
29+
UPDATE `cloud`.`configuration_subgroup` set `group_id` = (SELECT `id` FROM `cloud`.`configuration_group` WHERE `name` = 'Usage Server'), `precedence` = 1 WHERE `name`='Usage';
30+
UPDATE `cloud`.`configuration` SET `group_id` = (SELECT `id` FROM `cloud`.`configuration_group` WHERE `name` = 'Usage Server') where `subgroup_id` = (SELECT `id` FROM `cloud`.`configuration_subgroup` WHERE `name` = 'Usage');
31+
32+
-- Update the description to indicate this setting applies only to volume snapshots on running instances
33+
UPDATE `cloud`.`configuration` SET `description`='whether volume snapshot is enabled on running instances on KVM hosts' WHERE `name`='kvm.snapshot.enabled';
34+
2735
-- Modify index for mshost_peer
2836
DELETE FROM `cloud`.`mshost_peer`;
2937
CALL `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY`('cloud.mshost_peer','fk_mshost_peer__owner_mshost');

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5413,13 +5413,13 @@ protected ManagementServerResponse createManagementServerResponse(ManagementServ
54135413
mgmtResponse.setLastServerStart(mgmt.getLastJvmStart());
54145414
mgmtResponse.setLastServerStop(mgmt.getLastJvmStop());
54155415
mgmtResponse.setLastBoot(mgmt.getLastSystemBoot());
5416-
mgmtResponse.setServiceIp(mgmt.getServiceIP());
54175416
if (listPeers) {
54185417
List<ManagementServerHostPeerJoinVO> peers = mshostPeerJoinDao.listByOwnerMshostId(mgmt.getId());
54195418
for (ManagementServerHostPeerJoinVO peer: peers) {
54205419
mgmtResponse.addPeer(createPeerManagementServerNodeResponse(peer));
54215420
}
54225421
}
5422+
mgmtResponse.setIpAddress(mgmt.getServiceIP());
54235423
mgmtResponse.setObjectName("managementserver");
54245424
return mgmtResponse;
54255425
}

server/src/main/java/com/cloud/configuration/Config.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ public enum Config {
506506
"The time interval in seconds when the management server polls for snapshots to be scheduled.",
507507
null),
508508
SnapshotDeltaMax("Snapshots", SnapshotManager.class, Integer.class, "snapshot.delta.max", "16", "max delta snapshots between two full snapshots.", null),
509-
KVMSnapshotEnabled("Hidden", SnapshotManager.class, Boolean.class, "kvm.snapshot.enabled", "false", "whether snapshot is enabled for KVM hosts", null),
509+
KVMSnapshotEnabled("Hidden", SnapshotManager.class, Boolean.class, "kvm.snapshot.enabled", "false", "Whether volume snapshot is enabled on running instances on a KVM host", null),
510510

511511
// Advanced
512512
EventPurgeInterval(
@@ -665,8 +665,8 @@ public enum Config {
665665
ManagementServer.class,
666666
String.class,
667667
"hypervisor.list",
668-
HypervisorType.Hyperv + "," + HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," +
669-
HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3,
668+
HypervisorType.KVM + "," + HypervisorType.VMware + "," + HypervisorType.XenServer + "," + HypervisorType.Hyperv + "," +
669+
HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3,
670670
"The list of hypervisors that this deployment will use.",
671671
"hypervisorList",
672672
ConfigKey.Kind.CSV,

server/src/main/java/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ private void validateVpnConnectionDoesntExist(Site2SiteCustomerGateway customerG
343343
private void validatePrerequisiteVpnGateway(Site2SiteVpnGateway vpnGateway) {
344344
// check if gateway has been defined on the VPC
345345
if (_vpnGatewayDao.findByVpcId(vpnGateway.getVpcId()) == null) {
346-
throw new InvalidParameterValueException("we can not create a VPN connection for a VPC that does not have a VPN gateway defined");
346+
throw new InvalidParameterValueException("We can not create a VPN connection for a VPC that does not have a VPN gateway defined");
347347
}
348348
}
349349

@@ -590,7 +590,7 @@ public boolean deleteVpnConnection(DeleteVpnConnectionCmd cmd) throws ResourceUn
590590
private void stopVpnConnection(Long id) throws ResourceUnavailableException {
591591
Site2SiteVpnConnectionVO conn = _vpnConnectionDao.acquireInLockTable(id);
592592
if (conn == null) {
593-
throw new CloudRuntimeException("Unable to acquire lock for stopping of VPN connection with ID " + id);
593+
throw new CloudRuntimeException("Unable to acquire lock for stopping VPN connection with ID " + id);
594594
}
595595
try {
596596
if (conn.getState() == State.Pending) {

server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import javax.inject.Inject;
2828
import javax.naming.ConfigurationException;
2929

30+
import com.cloud.storage.snapshot.SnapshotManager;
3031
import org.apache.cloudstack.annotation.AnnotationService;
3132
import org.apache.cloudstack.annotation.dao.AnnotationDao;
3233
import org.apache.cloudstack.api.ApiConstants;
@@ -377,9 +378,14 @@ public VMSnapshot allocVMSnapshot(Long vmId, String vsDisplayName, String vsDesc
377378
//StorageVMSnapshotStrategy - allows volume snapshots without memory; VM has to be in Running state; No limitation of the image format if the storage plugin supports volume snapshots; "kvm.vmstoragesnapshot.enabled" has to be enabled
378379
//Other Storage volume plugins could integrate this with their own functionality for group snapshots
379380
VMSnapshotStrategy snapshotStrategy = storageStrategyFactory.getVmSnapshotStrategy(userVmVo.getId(), rootVolumePool.getId(), snapshotMemory);
380-
381381
if (snapshotStrategy == null) {
382-
String message = "KVM does not support the type of snapshot requested";
382+
String message;
383+
if (!SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
384+
message = "Creating a snapshot of a running KVM instance without memory is not supported";
385+
} else {
386+
message = "KVM does not support the type of snapshot requested";
387+
}
388+
383389
logger.debug(message);
384390
throw new CloudRuntimeException(message);
385391
}

ui/public/locales/de_DE.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,6 @@
12651265
"label.save.new.rule": "Neue Regel Speichern",
12661266
"label.schedule": "Zeitplan",
12671267
"label.scheduled.backups": "geplante Backups",
1268-
"label.scheduled.snapshots": "geplante Schnappschüsse",
12691268
"label.scope": "Geltungsbereich",
12701269
"label.search": "Suche",
12711270
"label.secondary.isolated.vlan.type.isolated": "Isoliert",

ui/public/locales/el_GR.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,6 @@
15171517
"label.scale.vm": "Κλίμακα εικονικής μηχανής",
15181518
"label.schedule": "Πρόγραμμα",
15191519
"label.scheduled.backups": "Προγραμματισμένα αντίγραφα ασφαλείας",
1520-
"label.scheduled.snapshots": "Προγραμματισμένα στιγμιότυπα",
15211520
"label.scope": "Πεδίο εφαρμογής",
15221521
"label.search": "Αναζήτηση",
15231522
"label.secondary.isolated.vlan.type.isolated": "Απομονωμένες",

ui/public/locales/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"label.action": "Action",
5555
"label.action.attach.disk": "Attach disk",
5656
"label.action.attach.iso": "Attach ISO",
57+
"label.action.attach.to.instance": "Attach to Instance",
5758
"label.action.bulk.delete.egress.firewall.rules": "Bulk delete egress firewall rules",
5859
"label.action.bulk.delete.firewall.rules": "Bulk delete firewall rules",
5960
"label.action.bulk.delete.ip.v6.firewall.rules": "Bulk remove IPv6 firewall rules",
@@ -399,9 +400,11 @@
399400
"label.associatednetworkid": "Associated Network ID",
400401
"label.associatednetworkname": "Network name",
401402
"label.asyncbackup": "Async backup",
403+
"label.attach.vol.to.instance": "Attach the created Volume to an existing Instance",
402404
"label.attaching": "Attaching",
403405
"label.authentication.method": "Authentication Method",
404406
"label.authentication.sshkey": "System SSH Key",
407+
"label.use.existing.vcenter.credentials.from.zone": "Use existing vCenter credentials from the Zone",
405408
"label.autoscale": "AutoScale",
406409
"label.autoscalevmgroupname": "AutoScaling Group",
407410
"label.author.email": "Author e-mail",
@@ -1073,7 +1076,7 @@
10731076
"label.hastate": "HA state",
10741077
"label.headers": "Headers",
10751078
"label.header.backup.schedule": "You can set up recurring backup schedules by selecting from the available options below and applying your policy preference.",
1076-
"label.header.volume.snapshot": "You can set up recurring Snapshot schedules by selecting from the available options below and applying your policy preference.",
1079+
"label.header.volume.snapshot": "You can set up recurring Snapshots by selecting from the available options below and applying your policy preference.",
10771080
"label.header.volume.take.snapshot": "Please confirm that you want to take a Snapshot of this volume.",
10781081
"label.health.check": "Health check",
10791082
"label.heapmemoryused": "Heap-memory used",
@@ -1999,7 +2002,6 @@
19992002
"label.schedule": "Schedule",
20002003
"label.schedule.add": "Add schedule",
20012004
"label.scheduled.backups": "Scheduled backups",
2002-
"label.scheduled.snapshots": "Scheduled Snapshots",
20032005
"label.schedules": "Schedules",
20042006
"label.scope": "Scope",
20052007
"label.scope.tooltip": "Primary Storage Pool Scope",

0 commit comments

Comments
 (0)