Greg Padgett has uploaded a new change for review.
Change subject: WIP webadmin: Changes for CPU Overcommit (5/5)
......................................................................
WIP webadmin: Changes for CPU Overcommit (5/5)
This patch series adds support for CPU Overcommitment based on counting
host threads as cores for the purpose of VM startup/shutdown/migration.
Patch 5: UI changes:
Hosts > General tab - add CPU Sockets, CPU Hyperthreading, change core
display to CPU Cores per Socket
Clusters > Add/Edit dialog - new setting in Optimization tab (renamed
from "Memory Optimization", hidden if CV < 3.2
Cluster > Configure Local Storage dialog - same as above
Change-Id: Iefa963606074133b3dfcfc1b54fd623519e4ec9e
Signed-off-by: Greg Padgett <[email protected]>
---
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.ui.xml
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java
11 files changed, 453 insertions(+), 212 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/10170/1
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
index d313b00..d7576f6 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java
@@ -2606,6 +2606,11 @@
return 100;
}
+ public static boolean GetClusterDefaultCountThreadsAsCores()
+ {
+ return false;
+ }
+
public static ArrayList<VolumeType> GetVolumeTypeList()
{
return new ArrayList<VolumeType>(Arrays.asList(new VolumeType[] {
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java
index 05a71f7..2d6e18d 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java
@@ -525,6 +525,8 @@
cluster.setcpu_name(((ServerCpu)
model.getCPU().getSelectedItem()).getCpuName());
}
cluster.setmax_vds_memory_over_commit(model.getMemoryOverCommit());
+ cluster.setcount_threads_as_cores(((Boolean)
model.getVersionSupportsCPUOvercommit().getEntity())
+ && ((Boolean)
model.getCountThreadsAsCores().getEntity()));
cluster.setTransparentHugepages(version.compareTo(new Version("3.0"))
>= 0); //$NON-NLS-1$
cluster.setcompatibility_version(version);
cluster.setMigrateOnError(model.getMigrateOnErrorOption());
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
index b708073..2207a06 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
@@ -31,7 +31,6 @@
public class ClusterModel extends Model
{
-
private int privateServerOverCommit;
public int getServerOverCommit()
@@ -56,16 +55,16 @@
privateDesktopOverCommit = value;
}
- private int privateDefaultOverCommit;
+ private int privateDefaultMemoryOvercommit;
- public int getDefaultOverCommit()
+ public int getDefaultMemoryOvercommit()
{
- return privateDefaultOverCommit;
+ return privateDefaultMemoryOvercommit;
}
- public void setDefaultOverCommit(int value)
+ public void setDefaultMemoryOvercommit(int value)
{
- privateDefaultOverCommit = value;
+ privateDefaultMemoryOvercommit = value;
}
private VDSGroup privateEntity;
@@ -358,6 +357,30 @@
privateOptimizationCustom_IsSelected = value;
}
+ private EntityModel privateCountThreadsAsCores;
+
+ public EntityModel getCountThreadsAsCores()
+ {
+ return privateCountThreadsAsCores;
+ }
+
+ public void setCountThreadsAsCores(EntityModel value)
+ {
+ privateCountThreadsAsCores = value;
+ }
+
+ private EntityModel privateVersionSupportsCPUOvercommit;
+
+ public EntityModel getVersionSupportsCPUOvercommit()
+ {
+ return privateVersionSupportsCPUOvercommit;
+ }
+
+ public void setVersionSupportsCPUOvercommit(EntityModel value)
+ {
+ privateVersionSupportsCPUOvercommit = value;
+ }
+
private EntityModel privateMigrateOnErrorOption_NO;
public EntityModel getMigrateOnErrorOption_NO()
@@ -613,7 +636,11 @@
// Optimization methods:
// default value =100;
-
setDefaultOverCommit(AsyncDataProvider.GetClusterDefaultMemoryOverCommit());
+
setDefaultMemoryOvercommit(AsyncDataProvider.GetClusterDefaultMemoryOverCommit());
+
+ setCountThreadsAsCores(new
EntityModel(AsyncDataProvider.GetClusterDefaultCountThreadsAsCores()));
+
+ setVersionSupportsCPUOvercommit(new EntityModel(true));
AsyncQuery _asyncQuery = new AsyncQuery();
_asyncQuery.setModel(this);
@@ -636,10 +663,10 @@
EntityModel temp;
temp = clusterModel1.getOptimizationNone();
- temp.setEntity(clusterModel1.getDefaultOverCommit());
+
temp.setEntity(clusterModel1.getDefaultMemoryOvercommit());
// res1, res2 is used for conversion purposes.
- boolean res1 = clusterModel1.getDesktopOverCommit() !=
clusterModel1.getDefaultOverCommit();
- boolean res2 = clusterModel1.getServerOverCommit() !=
clusterModel1.getDefaultOverCommit();
+ boolean res1 = clusterModel1.getDesktopOverCommit() !=
clusterModel1.getDefaultMemoryOvercommit();
+ boolean res2 = clusterModel1.getServerOverCommit() !=
clusterModel1.getDefaultMemoryOvercommit();
temp = clusterModel1.getOptimizationNone_IsSelected();
setIsSelected(res1 && res2);
temp.setEntity(getIsSelected());
@@ -647,12 +674,12 @@
temp = clusterModel1.getOptimizationForServer();
temp.setEntity(clusterModel1.getServerOverCommit());
temp =
clusterModel1.getOptimizationForServer_IsSelected();
- temp.setEntity(clusterModel1.getServerOverCommit() ==
clusterModel1.getDefaultOverCommit());
+ temp.setEntity(clusterModel1.getServerOverCommit() ==
clusterModel1.getDefaultMemoryOvercommit());
temp = clusterModel1.getOptimizationForDesktop();
temp.setEntity(clusterModel1.getDesktopOverCommit());
temp = temp =
clusterModel1.getOptimizationForDesktop_IsSelected();
- temp.setEntity(clusterModel1.getDesktopOverCommit() ==
clusterModel1.getDefaultOverCommit());
+ temp.setEntity(clusterModel1.getDesktopOverCommit() ==
clusterModel1.getDefaultMemoryOvercommit());
temp = clusterModel1.getOptimizationCustom();
temp.setIsAvailable(false);
@@ -752,6 +779,8 @@
{
getDescription().setEntity(getEntity().getdescription());
setMemoryOverCommit(getEntity().getmax_vds_memory_over_commit());
+
+ getCountThreadsAsCores().setEntity((boolean)
getEntity().getcount_threads_as_cores());
AsyncQuery _asyncQuery = new AsyncQuery();
_asyncQuery.setModel(this);
@@ -881,6 +910,9 @@
};
AsyncDataProvider.GetCPUList(_asyncQuery, version);
+ // CPU Overcommit is only available for clusters of version 3.2 or
greater
+
getVersionSupportsCPUOvercommit().setEntity(version.compareTo(Version.v3_2) >=
0);
+
}
private void InitCPU()
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java
index fb3db2e..0cb6232 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java
@@ -131,6 +131,8 @@
super.setEntity(value);
}
+ // 1st column in General tab
+
private String os;
public String getOS()
@@ -244,6 +246,8 @@
}
}
+ // 2nd column in General tab
+
private Integer activeVms;
public Integer getActiveVms()
@@ -261,62 +265,6 @@
{
activeVms = value;
OnPropertyChanged(new PropertyChangedEventArgs("ActiveVms"));
//$NON-NLS-1$
- }
- }
-
- private Boolean memoryPageSharing;
-
- public Boolean getMemoryPageSharing()
- {
- return memoryPageSharing;
- }
-
- public void setMemoryPageSharing(Boolean value)
- {
- if (memoryPageSharing == null && value == null)
- {
- return;
- }
- if (memoryPageSharing == null || !memoryPageSharing.equals(value))
- {
- memoryPageSharing = value;
- OnPropertyChanged(new
PropertyChangedEventArgs("MemoryPageSharing")); //$NON-NLS-1$
- }
- }
-
- private Object automaticLargePage;
-
- public Object getAutomaticLargePage()
- {
- return automaticLargePage;
- }
-
- public void setAutomaticLargePage(Object value)
- {
- if (automaticLargePage != value)
- {
- automaticLargePage = value;
- OnPropertyChanged(new
PropertyChangedEventArgs("AutomaticLargePage")); //$NON-NLS-1$
- }
- }
-
- private Integer numberOfCPUs;
-
- public Integer getNumberOfCPUs()
- {
- return numberOfCPUs;
- }
-
- public void setNumberOfCPUs(Integer value)
- {
- if (numberOfCPUs == null && value == null)
- {
- return;
- }
- if (numberOfCPUs == null || !numberOfCPUs.equals(value))
- {
- numberOfCPUs = value;
- OnPropertyChanged(new PropertyChangedEventArgs("NumberOfCPUs"));
//$NON-NLS-1$
}
}
@@ -351,6 +299,68 @@
OnPropertyChanged(new PropertyChangedEventArgs("CpuType"));
//$NON-NLS-1$
}
}
+
+ private Integer numberOfSockets;
+
+ public Integer getNumberOfSockets()
+ {
+ return numberOfSockets;
+ }
+
+ public void setNumberOfSockets(Integer value)
+ {
+ if (numberOfSockets == null && value == null)
+ {
+ return;
+ }
+ if (numberOfSockets == null || !numberOfSockets.equals(value))
+ {
+ numberOfSockets = value;
+ OnPropertyChanged(new
PropertyChangedEventArgs("NumberOfSockets")); //$NON-NLS-1$
+ }
+ }
+
+ private Integer coresPerSocket;
+
+ public Integer getCoresPerSocket()
+ {
+ return coresPerSocket;
+ }
+
+ public void setCoresPerSocket(Integer value)
+ {
+ if (coresPerSocket == null && value == null)
+ {
+ return;
+ }
+ if (coresPerSocket == null || !coresPerSocket.equals(value))
+ {
+ coresPerSocket = value;
+ OnPropertyChanged(new PropertyChangedEventArgs("CoresPerSocket"));
//$NON-NLS-1$
+ }
+ }
+
+ private String cpuHyperthreading;
+
+ public String getCpuHyperthreading()
+ {
+ return cpuHyperthreading;
+ }
+
+ public void setCpuHyperthreading(String value)
+ {
+ if (cpuHyperthreading == null && value == null)
+ {
+ return;
+ }
+ if (cpuHyperthreading == null || !cpuHyperthreading.equals(value))
+ {
+ cpuHyperthreading = value;
+ OnPropertyChanged(new
PropertyChangedEventArgs("CpuHyperthreading")); //$NON-NLS-1$
+ }
+ }
+
+ // 3rd column in General tab
private Integer sharedMemory;
@@ -497,6 +507,44 @@
public Float getMaxSchedulingMemory() {
return maxSchedulingMemory;
}
+
+ private Boolean memoryPageSharing;
+
+ public Boolean getMemoryPageSharing()
+ {
+ return memoryPageSharing;
+ }
+
+ public void setMemoryPageSharing(Boolean value)
+ {
+ if (memoryPageSharing == null && value == null)
+ {
+ return;
+ }
+ if (memoryPageSharing == null || !memoryPageSharing.equals(value))
+ {
+ memoryPageSharing = value;
+ OnPropertyChanged(new
PropertyChangedEventArgs("MemoryPageSharing")); //$NON-NLS-1$
+ }
+ }
+
+ private Object automaticLargePage;
+
+ public Object getAutomaticLargePage()
+ {
+ return automaticLargePage;
+ }
+
+ public void setAutomaticLargePage(Object value)
+ {
+ if (automaticLargePage != value)
+ {
+ automaticLargePage = value;
+ OnPropertyChanged(new
PropertyChangedEventArgs("AutomaticLargePage")); //$NON-NLS-1$
+ }
+ }
+
+ // Alert section in general tab
private boolean hasAnyAlert;
@@ -846,16 +894,24 @@
setVdsmVersion(vds.getVersion());
setSpiceVersion(vds.getspice_version());
setIScsiInitiatorName(vds.getIScsiInitiatorName());
+
setActiveVms(vds.getvm_active());
- setMemoryPageSharing(vds.getksm_state());
- setAutomaticLargePage(vds.getTransparentHugePagesState());
- setNumberOfCPUs(vds.getcpu_cores());
setCpuName(vds.getCpuName() != null ? vds.getCpuName().getCpuName() :
null);
setCpuType(vds.getcpu_model());
- setSharedMemory(vds.getmem_shared_percent());
+ setNumberOfSockets(vds.getcpu_sockets());
+ setCoresPerSocket((vds.getcpu_cores() != null && vds.getcpu_sockets()
!= null)
+ ? vds.getcpu_cores() / vds.getcpu_sockets() : null);
+ // vdsm may be accounting for hyperthreading already by doubling the
core count
+ setCpuHyperthreading(vds.getvdsm_count_threads_as_cores() == null ?
"Unknown" //$NON-NLS-1$
+ : (vds.getvdsm_count_threads_as_cores() ? "Virtual (vdsm.conf
setting)" //$NON-NLS-1$
+ : (vds.getcpu_ht_enabled() ? "Enabled" : "Disabled")));
//$NON-NLS-1$ //$NON-NLS-2$
+
setPhysicalMemory(vds.getphysical_mem_mb());
setSwapTotal(vds.getswap_total());
setSwapFree(vds.getswap_free());
+ setSharedMemory(vds.getmem_shared_percent());
+ setMemoryPageSharing(vds.getksm_state());
+ setAutomaticLargePage(vds.getTransparentHugePagesState());
}
private void UpdateAlerts()
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
index 1e58204..9d880d0 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
@@ -547,32 +547,26 @@
@DefaultStringValue("Compatibility Version")
String clusterPopupVersionLabel();
- @DefaultStringValue("Memory Optimization")
- String clusterPopupMemoryOptimizationTabLabel();
+ @DefaultStringValue("Optimization")
+ String clusterPopupOptimizationTabLabel();
- @DefaultStringValue("None")
+ @DefaultStringValue("Memory Optimization")
+ String clusterPopupMemoryOptimizationPanelTitle();
+
+ @DefaultStringValue("Allow VMs to run on the hosts up to the specified
overcommit threshold. Higher values conserve memory at the expense of greater
host CPU usage.")
+ String clusterPopupMemoryOptimizationExplanationLabel();
+
+ @DefaultStringValue("None - Disable memory page sharing")
String clusterPopupOptimizationNoneLabel();
- @DefaultStringValue("For Server Load")
- String clusterPopupOptimizationForServerLabel();
+ @DefaultStringValue("CPU Hyperthreading")
+ String clusterPopupCpuOvercommitPanelTitle();
- @DefaultStringValue("For Desktop Load")
- String clusterPopupOptimizationForDesktopLabel();
+ @DefaultStringValue("Allow guests to use host threads as virtual CPU
cores. Enabling this may be useful for less CPU-intensive workloads.")
+ String clusterPopupCpuOvercommitExplanationLabel();
- @DefaultStringValue("Custom Value")
- String clusterPopupOptimizationCustomLabel();
-
- @DefaultStringValue("Memory Page Sharing is Disabled")
- String clusterPopupOptimizationNoneExplainationLabel();
-
- @DefaultStringValue("Memory Page Sharing Threshold set to %1$s. Allow VMs
to run on the Host up to the overcommit threshold")
- String clusterPopupOptimizationForServerExplainationLabel();
-
- @DefaultStringValue("Memory Page Sharing Threshold set to %1$s. Allow VMs
to run on the Host up to the overcommit threshold")
- String clusterPopupOptimizationForDesktopExplainationLabel();
-
- @DefaultStringValue("Memory Page Sharing Threshold set to %1$s via
API/CLI")
- String clusterPopupOptimizationCustomExplainationLabel();
+ @DefaultStringValue("Count Threads As Cores")
+ String clusterPopupCountThreadsAsCoresLabel();
@DefaultStringValue("Resilience Policy")
String clusterPopupResiliencePolicyTabLabel();
@@ -1086,20 +1080,20 @@
@DefaultStringValue("Active VMs")
String activeVmsHostGeneral();
- @DefaultStringValue("Memory Page Sharing")
- String memPageSharingHostGeneral();
-
- @DefaultStringValue("Automatic Large Pages")
- String autoLargePagesHostGeneral();
-
- @DefaultStringValue("Number of CPUs")
- String numOfCpusHostGeneral();
-
@DefaultStringValue("CPU Name")
String cpuNameHostGeneral();
@DefaultStringValue("CPU Type")
String cpuTypeHostGeneral();
+
+ @DefaultStringValue("CPU Sockets")
+ String numOfSocketsHostGeneral();
+
+ @DefaultStringValue("CPU Cores per Socket")
+ String numOfCoresPerSocketHostGeneral();
+
+ @DefaultStringValue("CPU Hyperthreading")
+ String cpuHyperthreadingHostGeneral();
@DefaultStringValue("Physical Memory")
String physMemHostGeneral();
@@ -1110,6 +1104,12 @@
@DefaultStringValue("Max free Memory for scheduling new VMs")
String maxSchedulingMemory();
+ @DefaultStringValue("Memory Page Sharing")
+ String memPageSharingHostGeneral();
+
+ @DefaultStringValue("Automatic Large Pages")
+ String autoLargePagesHostGeneral();
+
@DefaultStringValue("Shared Memory")
String sharedMemHostGeneral();
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java
index 555169d..178b876 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationMessages.java
@@ -45,14 +45,14 @@
@DefaultMessage("All references to objects that belong to Data Center {0}
in the database will be removed. You may need to manually clean the Storage
Domains in order to reuse them.")
String detaCenterForceRemovePopupMessageLabel(String dcName);
- @DefaultMessage("Memory Page Sharing Threshold set to {0}. Allow VMs to
run on the Host up to the overcommit threshold")
- String clusterPopupOptimizationForServerExplainationLabel(String a);
+ @DefaultMessage("For Server Load - Enable memory page sharing to {0}%")
+ String clusterPopupMemoryOptimizationForServerLabel(String a);
- @DefaultMessage("Memory Page Sharing Threshold set to {0}. Allow VMs to
run on the Host up to the overcommit threshold")
- String clusterPopupOptimizationForDesktopExplainationLabel( String a);
+ @DefaultMessage("For Desktop Load - Enable memory page sharing to {0}%")
+ String clusterPopupMemoryOptimizationForDesktopLabel(String a);
- @DefaultMessage("Memory Page Sharing Threshold set to {0} via API/CLI")
- String clusterPopupOptimizationCustomExplainationLabel(String a);
+ @DefaultMessage("Custom Overcommit Threshold - Set to {0}% via API/CLI")
+ String clusterPopupMemoryOptimizationCustomLabel(String a);
@DefaultMessage("The Network will be added to the Data Center {0} as
well.")
String theNetworkWillBeAddedToTheDataCenterAsWell(String dcName);
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java
index 3ca5adf..07fe42c 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.java
@@ -126,43 +126,51 @@
@UiField
@WithElementId
- DialogTab memoryOptimizationTab;
+ DialogTab optimizationTab;
+
+ @UiField
+ @Ignore
+ Label memoryOptimizationPanelTitle;
+
+ @UiField
+ @Ignore
+ Label memoryOptimizationExplanationLabel;
@UiField(provided = true)
@Path(value = "optimizationNone_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationNoneEditor;
- @UiField
- @Ignore
- Label optimizationNoneExplanationLabel;
-
@UiField(provided = true)
@Path(value = "optimizationForServer_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationForServerEditor;
-
- @UiField
- @Ignore
- Label optimizationForServerExplanationLabel;
@UiField(provided = true)
@Path(value = "optimizationForDesktop_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationForDesktopEditor;
- @UiField
- @Ignore
- Label optimizationForDesktopExplanationLabel;
-
@UiField(provided = true)
@Path(value = "optimizationCustom_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationCustomEditor;
- @UiField(provided = true)
+ @UiField
+ FlowPanel cpuOvercommitPanel;
+
+ @UiField
@Ignore
- Label optimizationCustomExplanationLabel;
+ Label cpuOvercommitPanelTitle;
+
+ @UiField
+ @Ignore
+ Label cpuOvercommitExplanationLabel;
+
+ @UiField(provided = true)
+ @Path(value = "countThreadsAsCores.entity")
+ @WithElementId
+ EntityModelCheckBoxEditor countThreadsAsCoresEditor;
@UiField
@WithElementId
@@ -205,6 +213,13 @@
migrateOnErrorOption_NOEditor.addContentWidgetStyleName(style.label());
migrateOnErrorOption_YESEditor.addContentWidgetStyleName(style.label());
migrateOnErrorOption_HA_ONLYEditor.addContentWidgetStyleName(style.label());
+
+ optimizationNoneEditor.setContentWidgetStyleName(style.fullWidth());
+
optimizationForServerEditor.setContentWidgetStyleName(style.fullWidth());
+
optimizationForDesktopEditor.setContentWidgetStyleName(style.fullWidth());
+ optimizationCustomEditor.setContentWidgetStyleName(style.fullWidth());
+
+ countThreadsAsCoresEditor.setContentWidgetStyleName(style.fullWidth());
}
private void localize(ApplicationConstants constants) {
@@ -224,14 +239,15 @@
glusterHostFingerprintEditor.setLabel(constants.hostPopupHostFingerprintLabel());
glusterHostPasswordEditor.setLabel(constants.hostPopupRootPasswordLabel());
-
memoryOptimizationTab.setLabel(constants.clusterPopupMemoryOptimizationTabLabel());
+ optimizationTab.setLabel(constants.clusterPopupOptimizationTabLabel());
+
memoryOptimizationPanelTitle.setText(constants.clusterPopupMemoryOptimizationPanelTitle());
+
memoryOptimizationExplanationLabel.setText(constants.clusterPopupMemoryOptimizationExplanationLabel());
optimizationNoneEditor.setLabel(constants.clusterPopupOptimizationNoneLabel());
-
optimizationForServerEditor.setLabel(constants.clusterPopupOptimizationForServerLabel());
-
optimizationForDesktopEditor.setLabel(constants.clusterPopupOptimizationForDesktopLabel());
-
optimizationCustomEditor.setLabel(constants.clusterPopupOptimizationCustomLabel());
-
optimizationNoneExplanationLabel.setText(constants.clusterPopupOptimizationNoneExplainationLabel());
+
cpuOvercommitPanelTitle.setText(constants.clusterPopupCpuOvercommitPanelTitle());
+
cpuOvercommitExplanationLabel.setText(constants.clusterPopupCpuOvercommitExplanationLabel());
+
countThreadsAsCoresEditor.setLabel(constants.clusterPopupCountThreadsAsCoresLabel());
resiliencePolicyTab.setLabel(constants.clusterPopupResiliencePolicyTabLabel());
@@ -250,9 +266,6 @@
migrateOnErrorOption_YESEditor = new
EntityModelRadioButtonEditor("2"); //$NON-NLS-1$
migrateOnErrorOption_HA_ONLYEditor = new
EntityModelRadioButtonEditor("2"); //$NON-NLS-1$
migrateOnErrorOption_NOEditor = new EntityModelRadioButtonEditor("2");
//$NON-NLS-1$
-
- optimizationCustomExplanationLabel = new Label();
- optimizationCustomExplanationLabel.setVisible(false);
}
private void initListBoxEditors() {
@@ -282,12 +295,14 @@
private void initCheckBoxEditors()
{
importGlusterConfigurationEditor = new
EntityModelCheckBoxEditor(Align.RIGHT);
+
+ countThreadsAsCoresEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
private void applyModeCustomizations() {
if (ApplicationModeHelper.getUiMode() == ApplicationMode.GlusterOnly)
{
- memoryOptimizationTab.setVisible(false);
+ optimizationTab.setVisible(false);
resiliencePolicyTab.setVisible(false);
dataCenterPanel.addStyleName(style.generalTabTopDecoratorEmpty());
}
@@ -302,40 +317,43 @@
public void edit(final ClusterModel object) {
Driver.driver.edit(object);
+ optimizationForServerFormatter(object);
+ optimizationForDesktopFormatter(object);
+ optimizationCustomFormatter(object);
+
object.getOptimizationForServer().getEntityChangedEvent().addListener(new
IEventListener() {
-
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
-
optimizationForServerExplanationLabel.setText(messages.clusterPopupOptimizationForServerExplainationLabel(
object.getOptimizationForServer().getEntity().toString() + "%")); //$NON-NLS-1$
+ optimizationForServerFormatter(object);
}
});
+
object.getOptimizationForDesktop().getEntityChangedEvent().addListener(new
IEventListener() {
-
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
-
optimizationForDesktopExplanationLabel.setText(messages.clusterPopupOptimizationForDesktopExplainationLabel(object.getOptimizationForDesktop().getEntity().toString()
+ "%")); //$NON-NLS-1$
+ optimizationForDesktopFormatter(object);
}
});
-
object.getOptimizationCustom_IsSelected().getEntityChangedEvent().addListener(new
IEventListener() {
+
object.getOptimizationCustom_IsSelected().getEntityChangedEvent().addListener(new
IEventListener() {
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
if ((Boolean)
object.getOptimizationCustom_IsSelected().getEntity()) {
-
optimizationCustomExplanationLabel.setText(messages.clusterPopupOptimizationCustomExplainationLabel(object.getOptimizationCustom().getEntity().toString()
+ "%")); //$NON-NLS-1$
- optimizationCustomExplanationLabel.setVisible(true);
+ optimizationCustomFormatter(object);
+ optimizationCustomEditor.setVisible(true);
}
}
});
- object.getDataCenter().getSelectedItemChangedEvent().addListener(new
IEventListener() {
+ object.getDataCenter().getSelectedItemChangedEvent().addListener(new
IEventListener() {
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
resiliencePolicyTab.setVisible(object.getisResiliencePolicyTabAvailable());
applyModeCustomizations();
}
});
-
object.getEnableGlusterService().getEntityChangedEvent().addListener(new
IEventListener() {
+
object.getEnableGlusterService().getEntityChangedEvent().addListener(new
IEventListener() {
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
importGlusterExplanationLabel.setVisible((Boolean)
object.getEnableGlusterService().getEntity()
@@ -344,6 +362,38 @@
});
importGlusterExplanationLabel.setVisible((Boolean)
object.getEnableGlusterService().getEntity()
&& object.getIsNew());
+
+
object.getVersionSupportsCPUOvercommit().getEntityChangedEvent().addListener(new
IEventListener() {
+ @Override
+ public void eventRaised(Event ev, Object sender, EventArgs args) {
+ cpuOvercommitPanel.setVisible((Boolean)
object.getVersionSupportsCPUOvercommit().getEntity());
+ }
+ });
+ }
+
+ private void optimizationForServerFormatter(ClusterModel object) {
+ if (object.getOptimizationForServer() != null
+ && object.getOptimizationForServer().getEntity() != null) {
+
optimizationForServerEditor.setLabel(messages.clusterPopupMemoryOptimizationForServerLabel(
+ object.getOptimizationForServer().getEntity().toString()));
+ }
+ }
+
+ private void optimizationForDesktopFormatter(ClusterModel object) {
+ if (object.getOptimizationForDesktop() != null
+ && object.getOptimizationForDesktop().getEntity() != null) {
+
optimizationForDesktopEditor.setLabel(messages.clusterPopupMemoryOptimizationForDesktopLabel(
+
object.getOptimizationForDesktop().getEntity().toString()));
+ }
+ }
+
+ private void optimizationCustomFormatter(ClusterModel object) {
+ if (object.getOptimizationCustom() != null
+ && object.getOptimizationCustom().getEntity() != null) {
+ // use current value because
object.getOptimizationCustom.getEntity() can be null
+
optimizationCustomEditor.setLabel(messages.clusterPopupMemoryOptimizationCustomLabel(
+ String.valueOf(object.getMemoryOverCommit())));
+ }
}
@Override
@@ -363,6 +413,8 @@
String generalTabTopDecoratorEmpty();
String editorContentWidget();
+
+ String fullWidth();
}
}
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml
index 9c47ba8..910ad80 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterPopupView.ui.xml
@@ -52,6 +52,23 @@
width: 350px;
margin-top: 10px;
}
+
+ .fullWidth {
+ float: right;
+ width: 460px;
+ padding: 0 5px;
+ line-height: 26px;
+ }
+ .panelTitle {
+ font-size: 14px;
+ padding-left: 3px;
+ }
+ .nestedSubsequentPanel {
+ padding-top: 24px;
+ }
+ .optimizationExplanationLabel {
+ padding: 8px 8px 8px 12px;
+ }
</ui:style>
<d:SimpleDialogPanel width="610px" height="530px">
@@ -81,17 +98,22 @@
</t:DialogTab>
</t:tab>
<t:tab>
- <t:DialogTab
ui:field="memoryOptimizationTab">
+ <t:DialogTab ui:field="optimizationTab">
<t:content>
- <g:FlowPanel
addStyleNames="{style.radioButtonsTabContent}">
-
<e:EntityModelRadioButtonEditor ui:field="optimizationNoneEditor" />
- <g:Label
ui:field="optimizationNoneExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
-
<e:EntityModelRadioButtonEditor ui:field="optimizationForServerEditor" />
- <g:Label
ui:field="optimizationForServerExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
-
<e:EntityModelRadioButtonEditor ui:field="optimizationForDesktopEditor" />
- <g:Label
ui:field="optimizationForDesktopExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
-
<e:EntityModelRadioButtonEditor ui:field="optimizationCustomEditor" />
- <g:Label
ui:field="optimizationCustomExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
+ <g:FlowPanel>
+ <g:FlowPanel
addStyleNames="{style.radioButtonsTabContent}">
+
<g:Label ui:field="memoryOptimizationPanelTitle"
addStyleNames="{style.panelTitle}" />
+
<g:Label ui:field="memoryOptimizationExplanationLabel"
addStyleNames="generalDialogComment,{style.optimizationExplanationLabel}" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationNoneEditor" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationForServerEditor" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationForDesktopEditor" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationCustomEditor" />
+ </g:FlowPanel>
+ <g:FlowPanel
ui:field="cpuOvercommitPanel" addStyleNames="{style.nestedSubsequentPanel}">
+
<g:Label ui:field="cpuOvercommitPanelTitle" addStyleNames="{style.panelTitle}"
/>
+
<g:Label ui:field="cpuOvercommitExplanationLabel"
addStyleNames="generalDialogComment,{style.optimizationExplanationLabel}" />
+
<e:EntityModelCheckBoxEditor ui:field="countThreadsAsCoresEditor" />
+ </g:FlowPanel>
</g:FlowPanel>
</t:content>
</t:DialogTab>
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.java
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.java
index a35048d..1defa40 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.java
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.java
@@ -4,19 +4,21 @@
import org.ovirt.engine.core.compat.Event;
import org.ovirt.engine.core.compat.EventArgs;
import org.ovirt.engine.core.compat.IEventListener;
-import org.ovirt.engine.core.compat.StringFormat;
import org.ovirt.engine.core.compat.Version;
import org.ovirt.engine.ui.common.idhandler.ElementIdHandler;
import org.ovirt.engine.ui.common.idhandler.WithElementId;
import org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView;
+import org.ovirt.engine.ui.common.widget.Align;
import org.ovirt.engine.ui.common.widget.dialog.SimpleDialogPanel;
import org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab;
+import org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor;
import org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor;
import org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxEditor;
import org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor;
import org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer;
import org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel;
import org.ovirt.engine.ui.webadmin.ApplicationConstants;
+import org.ovirt.engine.ui.webadmin.ApplicationMessages;
import org.ovirt.engine.ui.webadmin.ApplicationResources;
import
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.host.ConfigureLocalStoragePopupPresenterWidget;
@@ -25,9 +27,11 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.resources.client.CssResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Anchor;
+import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.inject.Inject;
@@ -55,6 +59,14 @@
return constants;
}
+ private final ApplicationMessages messages;
+
+ private ApplicationMessages getMessages() {
+ return messages;
+ }
+
+ @UiField
+ WidgetStyle style;
@UiField
DialogTab generalTab;
@@ -114,55 +126,64 @@
@UiField
@WithElementId
- DialogTab memoryOptimizationTab;
+ DialogTab optimizationTab;
+
+ @UiField
+ @Ignore
+ Label memoryOptimizationPanelTitle;
+
+ @UiField
+ @Ignore
+ Label memoryOptimizationExplanationLabel;
@UiField(provided = true)
@Path(value = "cluster.optimizationNone_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationNoneEditor;
- @UiField
- @Ignore
- Label optimizationNoneExplanationLabel;
-
@UiField(provided = true)
@Path(value = "cluster.optimizationForServer_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationForServerEditor;
-
- @UiField
- @Ignore
- Label optimizationForServerExplanationLabel;
@UiField(provided = true)
@Path(value = "cluster.optimizationForDesktop_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationForDesktopEditor;
- @UiField
- @Ignore
- Label optimizationForDesktopExplanationLabel;
-
@UiField(provided = true)
@Path(value = "cluster.optimizationCustom_IsSelected.entity")
@WithElementId
EntityModelRadioButtonEditor optimizationCustomEditor;
- @UiField(provided = true)
- @Ignore
- Label optimizationCustomExplanationLabel;
+ @UiField
+ FlowPanel cpuOvercommitPanel;
+ @UiField
+ @Ignore
+ Label cpuOvercommitPanelTitle;
+
+ @UiField
+ @Ignore
+ Label cpuOvercommitExplanationLabel;
+
+ @UiField(provided = true)
+ @Path(value = "cluster.countThreadsAsCores.entity")
+ @WithElementId
+ EntityModelCheckBoxEditor countThreadsAsCoresEditor;
@Inject
- public HostConfigureLocalStoragePopupView(EventBus eventBus,
ApplicationResources resources, ApplicationConstants constants) {
+ public HostConfigureLocalStoragePopupView(EventBus eventBus,
ApplicationResources resources, ApplicationConstants constants,
ApplicationMessages messages) {
super(eventBus, resources);
this.constants = constants;
+ this.messages = messages;
initialize();
initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));
ViewIdHandler.idHandler.generateAndSetIds(this);
+ addStyles();
localize();
Driver.driver.initialize(this);
@@ -232,14 +253,23 @@
optimizationForDesktopEditor = new EntityModelRadioButtonEditor("1");
//$NON-NLS-1$
optimizationCustomEditor = new EntityModelRadioButtonEditor("1");
//$NON-NLS-1$
- optimizationCustomExplanationLabel = new Label();
- optimizationCustomExplanationLabel.setVisible(false);
+ optimizationCustomEditor.setVisible(false);
+
+ countThreadsAsCoresEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
+ }
+
+ private void addStyles() {
+ optimizationNoneEditor.setContentWidgetStyleName(style.fullWidth());
+
optimizationForServerEditor.setContentWidgetStyleName(style.fullWidth());
+
optimizationForDesktopEditor.setContentWidgetStyleName(style.fullWidth());
+ optimizationCustomEditor.setContentWidgetStyleName(style.fullWidth());
+
+ countThreadsAsCoresEditor.setContentWidgetStyleName(style.fullWidth());
}
void localize() {
generalTab.setLabel(getConstants().hostPopupGeneralTabLabel());
-
memoryOptimizationTab.setLabel(getConstants().hostPopupMemoryOptimizationTabLabel());
dataCenterButton.setText(getConstants().editText());
dataCenterNameEditor.setLabel(getConstants().nameLabel());
@@ -256,17 +286,15 @@
pathLabel.setText(getConstants().configureLocalStoragePopupPathLabel());
-
memoryOptimizationTab.setLabel(constants.clusterPopupMemoryOptimizationTabLabel());
+
optimizationTab.setLabel(getConstants().clusterPopupOptimizationTabLabel());
-
optimizationNoneEditor.setLabel(constants.clusterPopupOptimizationNoneLabel());
-
optimizationForServerEditor.setLabel(constants.clusterPopupOptimizationForServerLabel());
-
optimizationForDesktopEditor.setLabel(constants.clusterPopupOptimizationForDesktopLabel());
-
optimizationCustomEditor.setLabel(constants.clusterPopupOptimizationCustomLabel());
+
memoryOptimizationPanelTitle.setText(getConstants().clusterPopupMemoryOptimizationPanelTitle());
+
memoryOptimizationExplanationLabel.setText(getConstants().clusterPopupMemoryOptimizationExplanationLabel());
+
optimizationNoneEditor.setLabel(getConstants().clusterPopupOptimizationNoneLabel());
-
optimizationNoneExplanationLabel.setText(constants.clusterPopupOptimizationNoneExplainationLabel());
-
optimizationForServerExplanationLabel.setText(constants.clusterPopupOptimizationForServerExplainationLabel());
-
optimizationForDesktopExplanationLabel.setText(constants.clusterPopupOptimizationForDesktopExplainationLabel());
-
optimizationCustomExplanationLabel.setText(constants.clusterPopupOptimizationCustomExplainationLabel());
+
cpuOvercommitPanelTitle.setText(getConstants().clusterPopupCpuOvercommitPanelTitle());
+
cpuOvercommitExplanationLabel.setText(getConstants().clusterPopupCpuOvercommitExplanationLabel());
+
countThreadsAsCoresEditor.setLabel(getConstants().clusterPopupCountThreadsAsCoresLabel());
}
@Override
@@ -279,9 +307,9 @@
optimizationForServerFormatter(model);
optimizationForDesktopFormatter(model);
+ optimizationCustomFormatter(model);
model.getCluster().getOptimizationForServer().getEntityChangedEvent().addListener(new
IEventListener() {
-
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
optimizationForServerFormatter(model);
@@ -289,7 +317,6 @@
});
model.getCluster().getOptimizationForDesktop().getEntityChangedEvent().addListener(new
IEventListener() {
-
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
optimizationForDesktopFormatter(model);
@@ -297,14 +324,19 @@
});
model.getCluster().getOptimizationCustom_IsSelected().getEntityChangedEvent().addListener(new
IEventListener() {
-
@Override
public void eventRaised(Event ev, Object sender, EventArgs args) {
if ((Boolean)
model.getCluster().getOptimizationCustom_IsSelected().getEntity()) {
-
optimizationCustomExplanationLabel.setText(StringFormat.format(optimizationCustomExplanationLabel.getText(),
-
model.getCluster().getOptimizationCustom().getEntity().toString() + "%"));
//$NON-NLS-1$
- optimizationCustomExplanationLabel.setVisible(true);
+ optimizationCustomFormatter(model);
+ optimizationCustomEditor.setVisible(true);
}
+ }
+ });
+
+
model.getCluster().getVersionSupportsCPUOvercommit().getEntityChangedEvent().addListener(new
IEventListener() {
+ @Override
+ public void eventRaised(Event ev, Object sender, EventArgs args) {
+ cpuOvercommitPanel.setVisible((Boolean)
model.getCluster().getVersionSupportsCPUOvercommit().getEntity());
}
});
}
@@ -312,16 +344,25 @@
private void optimizationForDesktopFormatter(ConfigureLocalStorageModel
model) {
if (model.getCluster() != null &&
model.getCluster().getOptimizationForDesktop() != null
&& model.getCluster().getOptimizationForDesktop().getEntity()
!= null) {
-
optimizationForDesktopExplanationLabel.setText(StringFormat.format(optimizationForDesktopExplanationLabel.getText(),
-
model.getCluster().getOptimizationForDesktop().getEntity().toString() + "%"));
//$NON-NLS-1$
+
optimizationForDesktopEditor.setLabel(getMessages().clusterPopupMemoryOptimizationForDesktopLabel(
+
model.getCluster().getOptimizationForDesktop().getEntity().toString()));
}
}
private void optimizationForServerFormatter(ConfigureLocalStorageModel
model) {
if (model.getCluster() != null &&
model.getCluster().getOptimizationForServer() != null
&& model.getCluster().getOptimizationForServer().getEntity()
!= null) {
-
optimizationForServerExplanationLabel.setText(StringFormat.format(optimizationForServerExplanationLabel.getText(),
-
model.getCluster().getOptimizationForServer().getEntity().toString() + "%"));
//$NON-NLS-1$
+
optimizationForServerEditor.setLabel(getMessages().clusterPopupMemoryOptimizationForServerLabel(
+
model.getCluster().getOptimizationForServer().getEntity().toString()));
+ }
+ }
+
+ private void optimizationCustomFormatter(ConfigureLocalStorageModel model)
{
+ if (model.getCluster() != null &&
model.getCluster().getOptimizationCustom() != null
+ && model.getCluster().getOptimizationCustom().getEntity() !=
null) {
+ // use current value because
object.getOptimizationCustom.getEntity() can be null
+
optimizationCustomEditor.setLabel(getMessages().clusterPopupMemoryOptimizationCustomLabel(
+ String.valueOf(model.getCluster().getMemoryOverCommit())));
}
}
@@ -333,4 +374,8 @@
@Override
public void focusInput() {
}
+
+ interface WidgetStyle extends CssResource {
+ String fullWidth();
+ }
}
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.ui.xml
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.ui.xml
index e8b3ef3..6a3fb41 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.ui.xml
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostConfigureLocalStoragePopupView.ui.xml
@@ -6,7 +6,7 @@
<ui:with field='constants'
type='org.ovirt.engine.ui.webadmin.ApplicationConstants' />
- <ui:style>
+ <ui:style
type="org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostConfigureLocalStoragePopupView.WidgetStyle">
.generalTabTopDecorator {
background-color: #D3D3D3;
width: 540px;
@@ -48,6 +48,24 @@
color: #C0C0C0;
margin: 6px;
}
+
+ .fullWidth {
+ float: right;
+ width: 460px;
+ padding: 0 5px;
+ line-height: 26px;
+ }
+ .panelTitle {
+ font-size: 14px;
+ padding-left: 3px;
+ }
+ .nestedSubsequentPanel {
+ padding-top: 24px;
+ }
+ .optimizationExplanationLabel {
+ padding: 8px 8px 8px 12px;
+ }
+
</ui:style>
<d:SimpleDialogPanel width="723px" height="500px">
@@ -101,20 +119,25 @@
</t:DialogTab>
</t:tab>
<t:tab>
- <t:DialogTab ui:field="memoryOptimizationTab">
- <t:content>
- <g:FlowPanel
addStyleNames="{style.radioButtonsTabContent}">
- <e:EntityModelRadioButtonEditor
ui:field="optimizationNoneEditor" />
- <g:Label
ui:field="optimizationNoneExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
- <e:EntityModelRadioButtonEditor
ui:field="optimizationForServerEditor" />
- <g:Label
ui:field="optimizationForServerExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
- <e:EntityModelRadioButtonEditor
ui:field="optimizationForDesktopEditor" />
- <g:Label
ui:field="optimizationForDesktopExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
- <e:EntityModelRadioButtonEditor
ui:field="optimizationCustomEditor" />
- <g:Label
ui:field="optimizationCustomExplanationLabel"
addStyleNames="{style.explanationLabel},generalDialogComment" />
- </g:FlowPanel>
- </t:content>
- </t:DialogTab>
+ <t:DialogTab ui:field="optimizationTab">
+ <t:content>
+ <g:FlowPanel>
+ <g:FlowPanel
addStyleNames="{style.radioButtonsTabContent}">
+
<g:Label ui:field="memoryOptimizationPanelTitle"
addStyleNames="{style.panelTitle}" />
+
<g:Label ui:field="memoryOptimizationExplanationLabel"
addStyleNames="generalDialogComment,{style.optimizationExplanationLabel}" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationNoneEditor" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationForServerEditor" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationForDesktopEditor" />
+
<e:EntityModelRadioButtonEditor ui:field="optimizationCustomEditor" />
+ </g:FlowPanel>
+ <g:FlowPanel
ui:field="cpuOvercommitPanel" addStyleNames="{style.nestedSubsequentPanel}">
+
<g:Label ui:field="cpuOvercommitPanelTitle" addStyleNames="{style.panelTitle}"
/>
+
<g:Label ui:field="cpuOvercommitExplanationLabel"
addStyleNames="generalDialogComment,{style.optimizationExplanationLabel}" />
+
<e:EntityModelCheckBoxEditor ui:field="countThreadsAsCoresEditor" />
+ </g:FlowPanel>
+ </g:FlowPanel>
+ </t:content>
+ </t:DialogTab>
</t:tab>
</t:DialogTabPanel>
</d:content>
diff --git
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java
index 91c0ca4..b244bbb 100644
---
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java
+++
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostGeneralView.java
@@ -57,11 +57,13 @@
TextBoxLabel iScsiInitiatorName = new TextBoxLabel();
TextBoxLabel cpuName = new TextBoxLabel();
TextBoxLabel cpuType = new TextBoxLabel();
+ TextBoxLabel cpuHyperthreading = new TextBoxLabel();
VersionLabel vdsmVersion = new VersionLabel();
PercentLabel<Integer> sharedMemory = new PercentLabel<Integer>();
BooleanLabel memoryPageSharing = new BooleanLabel("Active", "Inactive");
//$NON-NLS-1$ //$NON-NLS-2$
NullableNumberLabel<Integer> activeVms = new
NullableNumberLabel<Integer>();
- NullableNumberLabel<Integer> numberOfCPUs = new
NullableNumberLabel<Integer>();
+ NullableNumberLabel<Integer> numberOfSockets = new
NullableNumberLabel<Integer>();
+ NullableNumberLabel<Integer> coresPerSocket = new
NullableNumberLabel<Integer>();
MemorySizeLabel<Integer> physicalMemory;
MemorySizeLabel<Integer> usedMemory;
@@ -134,16 +136,18 @@
formItems.add(new FormItem(constants.isciInitNameHostGeneral(),
iScsiInitiatorName, 6, 0));
formItems.add(new FormItem(constants.activeVmsHostGeneral(),
activeVms, 0, 1));
- formItems.add(new FormItem(constants.memPageSharingHostGeneral(),
memoryPageSharing, 1, 1));
- formItems.add(new FormItem(constants.autoLargePagesHostGeneral(),
automaticLargePage, 2, 1));
- formItems.add(new FormItem(constants.numOfCpusHostGeneral(),
numberOfCPUs, 3, 1));
- formItems.add(new FormItem(constants.cpuNameHostGeneral(), cpuName, 4,
1));
- formItems.add(new FormItem(constants.cpuTypeHostGeneral(), cpuType, 5,
1));
+ formItems.add(new FormItem(constants.cpuNameHostGeneral(), cpuName, 1,
1));
+ formItems.add(new FormItem(constants.cpuTypeHostGeneral(), cpuType, 2,
1));
+ formItems.add(new FormItem(constants.numOfSocketsHostGeneral(),
numberOfSockets, 3, 1));
+ formItems.add(new FormItem(constants.numOfCoresPerSocketHostGeneral(),
coresPerSocket, 4, 1));
+ formItems.add(new FormItem(constants.cpuHyperthreadingHostGeneral(),
cpuHyperthreading, 5, 1));
formItems.add(new FormItem(constants.physMemHostGeneral(),
physicalMemoryDetails, 0, 2));
formItems.add(new FormItem(constants.swapSizeHostGeneral(),
swapSizeDetails, 1, 2));
formItems.add(new FormItem(constants.sharedMemHostGeneral(),
sharedMemory, 2, 2));
formItems.add(new FormItem(constants.maxSchedulingMemory(),
maxSchedulingMemory, 3, 2));
+ formItems.add(new FormItem(constants.memPageSharingHostGeneral(),
memoryPageSharing, 4, 2));
+ formItems.add(new FormItem(constants.autoLargePagesHostGeneral(),
automaticLargePage, 5, 2));
applyModeCustomizations(formItems);
--
To view, visit http://gerrit.ovirt.org/10170
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iefa963606074133b3dfcfc1b54fd623519e4ec9e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches