Skip to content

Commit 53f93b5

Browse files
abh1sarDaanHooglandlucas-a-martinsLucas Martinsborisstoyanov
authored andcommitted
UI improvements (apache#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 (apache#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 7b1214e commit 53f93b5

File tree

20 files changed

+212
-76
lines changed

20 files changed

+212
-76
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
@@ -454,7 +454,6 @@ public class ApiConstants {
454454
public static final String SENT = "sent";
455455
public static final String SENT_BYTES = "sentbytes";
456456
public static final String SERIAL = "serial";
457-
public static final String SERVICE_IP = "serviceip";
458457
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
459458
public static final String SESSIONKEY = "sessionkey";
460459
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")
@@ -130,8 +130,8 @@ public Date getLastBoot() {
130130
return lastBoot;
131131
}
132132

133-
public String getServiceIp() {
134-
return serviceIp;
133+
public String getIpAddress() {
134+
return ipAddress;
135135
}
136136

137137
public Long getAgentsCount() {
@@ -186,8 +186,8 @@ public void setKernelVersion(String kernelVersion) {
186186
this.kernelVersion = kernelVersion;
187187
}
188188

189-
public void setServiceIp(String serviceIp) {
190-
this.serviceIp = serviceIp;
189+
public void setIpAddress(String ipAddress) {
190+
this.ipAddress = ipAddress;
191191
}
192192

193193
public void setAgentsCount(Long agentsCount) {

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
@@ -5497,7 +5497,6 @@ protected ManagementServerResponse createManagementServerResponse(ManagementServ
54975497
mgmtResponse.setLastServerStart(mgmt.getLastJvmStart());
54985498
mgmtResponse.setLastServerStop(mgmt.getLastJvmStop());
54995499
mgmtResponse.setLastBoot(mgmt.getLastSystemBoot());
5500-
mgmtResponse.setServiceIp(mgmt.getServiceIP());
55015500
if (listPeers) {
55025501
List<ManagementServerHostPeerJoinVO> peers = mshostPeerJoinDao.listByOwnerMshostId(mgmt.getId());
55035502
for (ManagementServerHostPeerJoinVO peer: peers) {
@@ -5506,6 +5505,7 @@ protected ManagementServerResponse createManagementServerResponse(ManagementServ
55065505
}
55075506
mgmtResponse.setAgentsCount((long) hostDao.countByMs(mgmt.getMsid()));
55085507
mgmtResponse.setPendingJobsCount(jobManager.countPendingNonPseudoJobs(mgmt.getMsid()));
5508+
mgmtResponse.setIpAddress(mgmt.getServiceIP());
55095509
mgmtResponse.setObjectName("managementserver");
55105510
return mgmtResponse;
55115511
}

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

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

527527
// Advanced
528528
EventPurgeInterval(
@@ -690,8 +690,8 @@ public enum Config {
690690
ManagementServer.class,
691691
String.class,
692692
"hypervisor.list",
693-
HypervisorType.Hyperv + "," + HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," +
694-
HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3,
693+
HypervisorType.KVM + "," + HypervisorType.VMware + "," + HypervisorType.XenServer + "," + HypervisorType.Hyperv + "," +
694+
HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC + "," + HypervisorType.Ovm3,
695695
"The list of hypervisors that this deployment will use.",
696696
"hypervisorList",
697697
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;
@@ -381,9 +382,14 @@ public VMSnapshot allocVMSnapshot(Long vmId, String vsDisplayName, String vsDesc
381382
//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
382383
//Other Storage volume plugins could integrate this with their own functionality for group snapshots
383384
VMSnapshotStrategy snapshotStrategy = storageStrategyFactory.getVmSnapshotStrategy(userVmVo.getId(), rootVolumePool.getId(), snapshotMemory);
384-
385385
if (snapshotStrategy == null) {
386-
String message = "KVM does not support the type of snapshot requested";
386+
String message;
387+
if (!SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
388+
message = "Creating a snapshot of a running KVM instance without memory is not supported";
389+
} else {
390+
message = "KVM does not support the type of snapshot requested";
391+
}
392+
387393
logger.debug(message);
388394
throw new CloudRuntimeException(message);
389395
}

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"label.action": "Action",
7474
"label.action.attach.disk": "Attach disk",
7575
"label.action.attach.iso": "Attach ISO",
76+
"label.action.attach.to.instance": "Attach to Instance",
7677
"label.action.bulk.delete.egress.firewall.rules": "Bulk delete egress firewall rules",
7778
"label.action.bulk.delete.firewall.rules": "Bulk delete firewall rules",
7879
"label.action.bulk.delete.ip.v6.firewall.rules": "Bulk remove IPv6 firewall rules",
@@ -421,10 +422,12 @@
421422
"label.associatednetworkid": "Associated Network ID",
422423
"label.associatednetworkname": "Network name",
423424
"label.asyncbackup": "Async backup",
425+
"label.attach.vol.to.instance": "Attach the created Volume to an existing Instance",
424426
"label.attaching": "Attaching",
425427
"label.authentication.method": "Authentication Method",
426428
"label.authentication.sshkey": "System SSH Key",
427429
"label.automigrate.volume": "Automatically migrate volumes to another storage pool if necessary",
430+
"label.use.existing.vcenter.credentials.from.zone": "Use existing vCenter credentials from the Zone",
428431
"label.autoscale": "AutoScale",
429432
"label.autoscalevmgroupname": "AutoScaling Group",
430433
"label.author.email": "Author e-mail",
@@ -2061,7 +2064,6 @@
20612064
"label.schedule": "Schedule",
20622065
"label.schedule.add": "Add schedule",
20632066
"label.scheduled.backups": "Scheduled backups",
2064-
"label.scheduled.snapshots": "Scheduled Snapshots",
20652067
"label.schedules": "Schedules",
20662068
"label.scope": "Scope",
20672069
"label.scope.tooltip": "Primary Storage Pool Scope",

ui/public/locales/ja_JP.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,6 @@
19691969
"label.scaleup.policy": "スケールアップポリシー",
19701970
"label.schedule": "スケジュール",
19711971
"label.scheduled.backups": "スケジュールされたバックアップ",
1972-
"label.scheduled.snapshots": "スケジュールされたスナップショット",
19731972
"label.scope": "スコープ",
19741973
"label.search": "検索",
19751974
"label.secondary.isolated.vlan.type.isolated": "隔離",

ui/public/locales/pt_BR.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,6 @@
14301430
"label.scale.vm": "Escalar VM",
14311431
"label.schedule": "Programar",
14321432
"label.scheduled.backups": "Backups programados",
1433-
"label.scheduled.snapshots": "Snapshots programados",
14341433
"label.scope": "Escopo",
14351434
"label.search": "Pesquisar",
14361435
"label.secondary.isolated.vlan.type.isolated": "Isolada",

ui/public/locales/zh_CN.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2248,7 +2248,6 @@
22482248

22492249
"label.schedule": "\u65E5\u7A0B",
22502250
"label.scheduled.backups": "\u5B9A\u65F6\u5907\u4EFD",
2251-
"label.scheduled.snapshots": "\u8BA1\u5212\u5FEB\u7167",
22522251
"label.scope": "\u8303\u56F4",
22532252
"label.search": "\u641C\u7D22",
22542253

ui/src/config/section/compute.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,10 @@ export default {
229229
docHelp: 'adminguide/virtual_machines.html#virtual-machine-snapshots',
230230
dataView: true,
231231
popup: true,
232-
show: (record) => {
233-
return ((['Running'].includes(record.state) && record.hypervisor !== 'LXC') ||
234-
(['Stopped'].includes(record.state) && !['KVM', 'LXC'].includes(record.hypervisor)))
232+
show: (record, store) => {
233+
return (record.hypervisor !== 'KVM') ||
234+
['Stopped', 'Destroyed'].includes(record.state) ||
235+
store.features.kvmsnapshotenabled
235236
},
236237
disabled: (record) => { return record.hostcontrolstate === 'Offline' && record.hypervisor === 'KVM' },
237238
component: shallowRef(defineAsyncComponent(() => import('@/views/compute/CreateSnapshotWizard.vue')))

ui/src/config/section/infra/managementServers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ export default {
2626
permission: ['listManagementServersMetrics'],
2727
resourceType: 'ManagementServer',
2828
columns: () => {
29-
const fields = ['name', 'state', 'serviceip', 'version', 'osdistribution', 'pendingjobscount', 'agentscount']
29+
const fields = ['name', 'state', 'ipaddress', 'version', 'osdistribution', 'pendingjobscount', 'agentscount']
3030
const metricsFields = ['collectiontime', 'availableprocessors', 'cpuload', 'heapmemoryused']
3131
if (store.getters.metrics) {
3232
fields.push(...metricsFields)
3333
}
3434
return fields
3535
},
36-
details: ['collectiontime', 'usageislocal', 'dbislocal', 'lastserverstart', 'lastserverstop', 'lastboottime', 'version', 'loginfo', 'systemtotalcpucycles', 'systemloadaverages', 'systemcycleusage', 'systemmemorytotal', 'systemmemoryfree', 'systemmemoryvirtualsize', 'availableprocessors', 'javadistribution', 'javaversion', 'osdistribution', 'kernelversion', 'pendingjobscount', 'agentscount', 'sessions', 'heapmemoryused', 'heapmemorytotal', 'threadsblockedcount', 'threadsdeamoncount', 'threadsnewcount', 'threadsrunnablecount', 'threadsterminatedcount', 'threadstotalcount', 'threadswaitingcount'],
36+
details: ['ipaddress', 'collectiontime', 'usageislocal', 'dbislocal', 'lastserverstart', 'lastserverstop', 'lastboottime', 'version', 'loginfo', 'systemtotalcpucycles', 'systemloadaverages', 'systemcycleusage', 'systemmemorytotal', 'systemmemoryfree', 'systemmemoryvirtualsize', 'availableprocessors', 'javadistribution', 'javaversion', 'osdistribution', 'kernelversion', 'pendingjobscount', 'agentscount', 'sessions', 'heapmemoryused', 'heapmemorytotal', 'threadsblockedcount', 'threadsdeamoncount', 'threadsnewcount', 'threadsrunnablecount', 'threadsterminatedcount', 'threadstotalcount', 'threadswaitingcount'],
3737
tabs: [
3838
{
3939
name: 'details',

ui/src/config/section/storage.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,10 @@ export default {
182182
label: 'label.action.take.snapshot',
183183
dataView: true,
184184
show: (record, store) => {
185-
return record.state === 'Ready' && (record.hypervisor !== 'KVM' ||
186-
record.hypervisor === 'KVM' && record.vmstate === 'Running' && store.features.kvmsnapshotenabled ||
187-
record.hypervisor === 'KVM' && record.vmstate !== 'Running')
185+
return record.state === 'Ready' &&
186+
(record.hypervisor !== 'KVM' ||
187+
['Stopped', 'Destroyed'].includes(record.vmstate) ||
188+
store.features.kvmsnapshotenabled)
188189
},
189190
popup: true,
190191
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/TakeSnapshot.vue')))
@@ -196,9 +197,10 @@ export default {
196197
label: 'label.action.recurring.snapshot',
197198
dataView: true,
198199
show: (record, store) => {
199-
return record.state === 'Ready' && (record.hypervisor !== 'KVM' ||
200-
record.hypervisor === 'KVM' && record.vmstate === 'Running' && store.features.kvmsnapshotenabled ||
201-
record.hypervisor === 'KVM' && record.vmstate !== 'Running')
200+
return record.state === 'Ready' &&
201+
(record.hypervisor !== 'KVM' ||
202+
(['Stopped', 'Destroyed'].includes(record.vmstate)) ||
203+
(store.features.kvmsnapshotenabled))
202204
},
203205
popup: true,
204206
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/RecurringSnapshotVolume.vue'))),

0 commit comments

Comments
 (0)