Skip to content

api,ui: multi arch improvements #10289

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

Merged
merged 64 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e7ff4ed
wip
shwstppr Jan 28, 2025
67042ce
ui: multi-arch improvements
shwstppr Jan 28, 2025
126dfa9
api,ui: filter resources by arch
shwstppr Jan 29, 2025
8f48da3
ui: show arch tag in infocard
shwstppr Jan 29, 2025
13f3f14
ui: add arch display and filter for kubernetes iso
shwstppr Jan 29, 2025
b017025
simulator: allow adding hosts with arch
shwstppr Jan 29, 2025
ee59e61
api,ui: allow filtering vms by arch
shwstppr Jan 29, 2025
13ced5e
ui: make arch filter a list
shwstppr Jan 29, 2025
16282dd
wip
shwstppr Feb 4, 2025
bed9666
wip
shwstppr Feb 5, 2025
969660a
change for downloading templates if allowed
shwstppr Feb 20, 2025
f74355f
move download method to httputils
shwstppr Feb 20, 2025
9073ec1
remove unnecssary
shwstppr Feb 21, 2025
48c9d29
fix build
shwstppr Feb 21, 2025
bc5f734
fix
shwstppr Feb 22, 2025
60dc9d9
remove unnecessary change
shwstppr Feb 22, 2025
0ac96d6
fixes
shwstppr Mar 6, 2025
33bb563
wip: try system vm deployment with different arch templates
shwstppr Mar 6, 2025
42598f7
fix checkstyle
shwstppr Mar 6, 2025
59f2608
wip: try VR deployment with arch specific template
shwstppr Mar 6, 2025
a2a7f5d
fix systemvm deployment retry
shwstppr Mar 10, 2025
582187a
preferred arch config
shwstppr Mar 11, 2025
6c95e90
ui: changes for arch auto selection in deploy vm
shwstppr Mar 11, 2025
3069929
CPUArch as an enum, make config select
shwstppr Mar 11, 2025
c98ef69
fix persiting ilbvm
shwstppr Mar 11, 2025
ce43205
refactor to use searchbuilder/critera for distinct pair
shwstppr Mar 12, 2025
5d696f0
cpu test
shwstppr Mar 12, 2025
a6bdd52
refactor fetch arch types
shwstppr Mar 12, 2025
499b861
fix
shwstppr Mar 12, 2025
c1750c8
fix
shwstppr Mar 13, 2025
ab07a12
fixes
shwstppr Mar 13, 2025
8d3d9eb
exception fix
shwstppr Mar 13, 2025
cac8a11
refactor and fixes
shwstppr Mar 13, 2025
27f3119
method rename
shwstppr Mar 13, 2025
8475604
refactor
shwstppr Mar 13, 2025
0003b96
add tests
shwstppr Mar 17, 2025
45fc1e1
Revert "add tests"
shwstppr Mar 17, 2025
f8ecb5d
add tests
shwstppr Mar 17, 2025
82ef924
more tests
shwstppr Mar 18, 2025
d86eb34
Merge branch '4.20' into multiarchzones-improvements
shwstppr Mar 18, 2025
6b374a6
fix trailing space
shwstppr Mar 18, 2025
8c8a56a
fix tests
shwstppr Mar 18, 2025
d81d77b
Merge remote-tracking branch 'apache/4.20' into multiarchzones-improv…
shwstppr Mar 19, 2025
38a4fe6
more tests
shwstppr Mar 19, 2025
a04a3a1
add tests
shwstppr Mar 19, 2025
4ff7c4a
change preferred arch config default
shwstppr Mar 19, 2025
11d5ba9
allow same name template for different arch
shwstppr Mar 19, 2025
affd3d8
address config comment, refactor, add arch to sysvm, routers
shwstppr Mar 19, 2025
f0cc075
fix
shwstppr Mar 19, 2025
aface0e
user vm arch
shwstppr Mar 19, 2025
d81283a
set permissions for systemvm template folder
shwstppr Mar 20, 2025
8f3099d
own templates directory itself
shwstppr Mar 24, 2025
ca02558
Update packaging/el8/cloud.spec
shwstppr Mar 27, 2025
68eb611
fix
shwstppr Mar 27, 2025
a096439
change perm on upgrade
shwstppr Mar 27, 2025
f940220
fix for k8s iso arch
shwstppr Apr 10, 2025
b62472d
fix k8s iso response
shwstppr Apr 10, 2025
f58253c
fix tests
shwstppr Apr 10, 2025
daac0d9
fix for cluster arch change
shwstppr Apr 23, 2025
8ce28e7
fix lint
shwstppr Apr 23, 2025
69db12a
allow specifying arch for edge cluster
shwstppr Apr 23, 2025
a15aeb3
fix DISTINCT class field
shwstppr Apr 23, 2025
3807f17
tests
shwstppr Apr 23, 2025
d8da081
Merge remote-tracking branch 'apache/4.20' into multiarchzones-improv…
shwstppr Apr 24, 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
Prev Previous commit
Next Next commit
api,ui: filter resources by arch
Signed-off-by: Abhishek Kumar <[email protected]>
  • Loading branch information
shwstppr committed Feb 21, 2025
commit 126dfa975b37dba9ad8fcf4da0054043405e6830
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public class ListClustersCmd extends BaseListCmd {
@Parameter(name = ApiConstants.SHOW_CAPACITIES, type = CommandType.BOOLEAN, description = "flag to display the capacity of the clusters")
private Boolean showCapacities;

@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING,
description = "CPU arch of the clusters",
since = "4.20.1")
private String arch;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -112,6 +117,10 @@ public Boolean getShowCapacities() {
return showCapacities;
}

public String getArch() {
return arch;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public class ListHostsCmd extends BaseListCmd {
@Parameter(name = ApiConstants.HYPERVISOR, type = CommandType.STRING, description = "hypervisor type of host: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
private String hypervisor;

@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING, description = "CPU Arch of the host", since = "4.20.1")
private String arch;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -189,6 +192,10 @@ public String getHostOutOfBandManagementPowerState() {
return outOfBandManagementPowerState;
}

public String getArch() {
return arch;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2346,6 +2346,7 @@ public Pair<List<Long>, Integer> searchForServerIdsAndCount(ListHostsCmd cmd) {
Long startIndex = cmd.getStartIndex();
Long pageSize = cmd.getPageSizeVal();
Hypervisor.HypervisorType hypervisorType = cmd.getHypervisor();
String arch = cmd.getArch();

Filter searchFilter = new Filter(HostVO.class, "id", Boolean.TRUE, startIndex, pageSize);

Expand All @@ -2361,6 +2362,7 @@ public Pair<List<Long>, Integer> searchForServerIdsAndCount(ListHostsCmd cmd) {
hostSearchBuilder.and("clusterId", hostSearchBuilder.entity().getClusterId(), SearchCriteria.Op.EQ);
hostSearchBuilder.and("resourceState", hostSearchBuilder.entity().getResourceState(), SearchCriteria.Op.EQ);
hostSearchBuilder.and("hypervisor_type", hostSearchBuilder.entity().getHypervisorType(), SearchCriteria.Op.EQ);
hostSearchBuilder.and("arch", hostSearchBuilder.entity().getArch(), SearchCriteria.Op.EQ);

if (keyword != null) {
hostSearchBuilder.and().op("keywordName", hostSearchBuilder.entity().getName(), SearchCriteria.Op.LIKE);
Expand Down Expand Up @@ -2441,6 +2443,10 @@ public Pair<List<Long>, Integer> searchForServerIdsAndCount(ListHostsCmd cmd) {
sc.setParameters("hypervisor_type", hypervisorType);
}

if (StringUtils.isNotBlank(arch)) {
sc.setParameters("arch", arch);
}

Pair<List<HostVO>, Integer> uniqueHostPair = hostDao.searchAndCount(sc, searchFilter);
Integer count = uniqueHostPair.second();
List<Long> hostIds = uniqueHostPair.first().stream().map(HostVO::getId).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,7 @@ public Pair<List<? extends Cluster>, Integer> searchForClusters(final ListCluste
final Object clusterType = cmd.getClusterType();
final Object allocationState = cmd.getAllocationState();
final String keyword = cmd.getKeyword();
final String arch = cmd.getArch();
zoneId = _accountMgr.checkAccessAndSpecifyAuthority(CallContext.current().getCallingAccount(), zoneId);

final Filter searchFilter = new Filter(ClusterVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal());
Expand All @@ -1286,6 +1287,7 @@ public Pair<List<? extends Cluster>, Integer> searchForClusters(final ListCluste
sb.and("hypervisorType", sb.entity().getHypervisorType(), SearchCriteria.Op.EQ);
sb.and("clusterType", sb.entity().getClusterType(), SearchCriteria.Op.EQ);
sb.and("allocationState", sb.entity().getAllocationState(), SearchCriteria.Op.EQ);
sb.and("arch", sb.entity().getArch(), SearchCriteria.Op.EQ);

final SearchCriteria<ClusterVO> sc = sb.create();
if (id != null) {
Expand Down Expand Up @@ -1325,6 +1327,10 @@ public Pair<List<? extends Cluster>, Integer> searchForClusters(final ListCluste
sc.addAnd("name", SearchCriteria.Op.SC, ssc);
}

if (StringUtils.isNotBlank(arch)) {
sc.setParameters("arch", arch);
}

final Pair<List<ClusterVO>, Integer> result = _clusterDao.searchAndCount(sc, searchFilter);
return new Pair<>(result.first(), result.second());
}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/config/section/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {
return fields
},
searchFilters: () => {
var filters = ['name', 'zoneid', 'tags']
var filters = ['name', 'zoneid', 'tags', 'arch']
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
filters.push('storageid')
filters.push('imagestoreid')
Expand Down Expand Up @@ -235,7 +235,7 @@ export default {
},
details: ['name', 'id', 'displaytext', 'checksum', 'ostypename', 'size', 'arch', 'bootable', 'isready', 'passwordenabled', 'directdownload', 'isextractable', 'ispublic', 'isfeatured', 'isdynamicallyscalable', 'crosszones', 'account', 'domain', 'created', 'userdatadetails', 'userdatapolicy', 'url'],
searchFilters: () => {
var filters = ['name', 'zoneid', 'tags']
var filters = ['name', 'zoneid', 'tags', 'arch']
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
filters.push('storageid')
filters.push('imagestoreid')
Expand Down
2 changes: 1 addition & 1 deletion ui/src/config/section/infra/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
icon: 'cluster-outlined',
docHelp: 'conceptsandterminology/concepts.html#about-clusters',
permission: ['listClustersMetrics'],
searchFilters: ['name', 'zoneid', 'podid', 'hypervisor'],
searchFilters: ['name', 'zoneid', 'podid', 'arch', 'hypervisor'],
columns: () => {
const fields = ['name', 'state', 'allocationstate', 'clustertype', 'arch', 'hypervisortype', 'hosts']
const metricsFields = ['cpuused', 'cpumaxdeviation', 'cpuallocated', 'cputotal', 'memoryused', 'memorymaxdeviation', 'memoryallocated', 'memorytotal', 'drsimbalance']
Expand Down
2 changes: 1 addition & 1 deletion ui/src/config/section/infra/hosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
icon: 'database-outlined',
docHelp: 'conceptsandterminology/concepts.html#about-hosts',
permission: ['listHostsMetrics'],
searchFilters: ['name', 'zoneid', 'podid', 'clusterid', 'hypervisor'],
searchFilters: ['name', 'zoneid', 'podid', 'clusterid', 'arch', 'hypervisor'],
resourceType: 'Host',
filters: () => {
const filters = ['enabled', 'disabled', 'maintenance', 'up', 'down', 'disconnected', 'alert']
Expand Down