Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
Do not retrieve VM's stats on normal VM listing#8782
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -37,6 +37,7 @@ | ||
| import com.cloud.uservm.UserVm; | ||
| import com.cloud.vm.VirtualMachine; | ||
| import com.google.gson.annotations.SerializedName; | ||
| import org.apache.commons.collections.CollectionUtils; | ||
| @SuppressWarnings("unused") | ||
| @EntityReference(value = {VirtualMachine.class, UserVm.class, VirtualRouter.class}) | ||
| @@ -269,6 +270,10 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co | ||
| @Param(description = "the hypervisor on which the template runs") | ||
| private String hypervisor; | ||
| @SerializedName(ApiConstants.IP_ADDRESS) | ||
| @Param(description = "the VM's primary IP address") | ||
| private String ipAddress; | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @SerializedName(ApiConstants.PUBLIC_IP_ID) | ||
| @Param(description = "public IP address id associated with vm via Static nat rule") | ||
| private String publicIpId; | ||
| @@ -623,6 +628,10 @@ public String getHypervisor() { | ||
| return hypervisor; | ||
| } | ||
| public String getIpAddress() { | ||
| return ipAddress; | ||
| } | ||
| public String getPublicIpId() { | ||
| return publicIpId; | ||
| } | ||
| @@ -859,6 +868,13 @@ public void setForVirtualNetwork(Boolean forVirtualNetwork) { | ||
| public void setNics(Set<NicResponse> nics) { | ||
| this.nics = nics; | ||
| setIpAddress(nics); | ||
| } | ||
| public void setIpAddress(final Set<NicResponse> nics) { | ||
| if (CollectionUtils.isNotEmpty(nics)) { | ||
| this.ipAddress = nics.iterator().next().getIpaddress(); | ||
| } | ||
| } | ||
| public void addNic(NicResponse nic) { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -125,6 +125,10 @@ public interface QueryService { | ||
| static final ConfigKey<Boolean> SharePublicTemplatesWithOtherDomains = new ConfigKey<>("Advanced", Boolean.class, "share.public.templates.with.other.domains", "true", | ||
| "If false, templates of this domain will not show up in the list templates of other domains.", true, ConfigKey.Scope.Domain); | ||
| ConfigKey<Boolean> ReturnVmStatsOnVmList = new ConfigKey<>("Advanced", Boolean.class, "return.vm.stats.on.vm.list", "true", | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "If false, changes the listVirtualMachines default details to [group, nics, secgrp, tmpl, servoff, diskoff, backoff, iso, volume, min, affgrp], so that the VMs' stats" + | ||
| " are not returned by default when listing VMs; only when the 'stats' or 'all' detail is informed.", true, ConfigKey.Scope.Global); | ||
| ListResponse<UserResponse> searchForUsers(ListUsersCmd cmd) throws PermissionDeniedException; | ||
| ListResponse<UserResponse> searchForUsers(Long domainId, boolean recursive) throws PermissionDeniedException; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -617,7 +617,6 @@ public List<VmMetricsResponse> listVmMetrics(List<UserVmResponse> vmResponses) { | ||
| } | ||
| metricsResponse.setHasAnnotation(vmResponse.hasAnnotation()); | ||
| metricsResponse.setIpAddress(vmResponse.getNics()); | ||
JoaoJandre marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| metricsResponse.setCpuTotal(vmResponse.getCpuNumber(), vmResponse.getCpuSpeed()); | ||
| metricsResponse.setMemTotal(vmResponse.getMemory()); | ||
| metricsResponse.setNetworkRead(vmResponse.getNetworkKbsRead()); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -28,7 +28,8 @@ export default { | ||
| title: 'label.instances', | ||
| icon: 'cloud-server-outlined', | ||
| docHelp: 'adminguide/virtual_machines.html', | ||
| permission: ['listVirtualMachinesMetrics'], | ||
| permission: ['listVirtualMachines', 'listVirtualMachinesMetrics'], | ||
| getApiToCall: () => store.getters.metrics ? 'listVirtualMachinesMetrics' : 'listVirtualMachines', | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| resourceType: 'UserVm', | ||
| params: () => { | ||
| var params = { details: 'servoff,tmpl,nics,backoff' } | ||
Uh oh!
There was an error while loading. Please reload this page.