eva.tuczai

Workload Rightsizing: Resize to Template and Template Utilization Factors

Blog Post created by eva.tuczai on Feb 14, 2015

VMTurbo: Resize VM to Template & Modify Consumption Instructions

 

In many environments there may be a need to align all VMs to standard sizes or configurations with regards to vCPU and vMemory. These are often referred to as standard VM “templates”. However, the default behavior of Operations Manager is to recommend vCPU and vMemory changes in accordance with the specific calculated need. This default behavior can be changed so that all resize recommendations are in line with a defined list of VM template sizes.

 

Note: this is the default behavior for adding OpenStack and Cloudstack targets.

 

The following is a description of the steps to take to enable the VMTurbo Economic Scheduling Engine to make a recommended action to right size a VM to match the nearest TEMPLATE that will get the VM to the desired state.  For more information on Workload Rightsizing with VMTurbo refer to this Green Circle Post: https://greencircle.vmturbo.com/community/products/blog/2015/02/15/workload-rightsizing-and-vmturbo

 

 

Configuration

Steps are:

  1. Create the VM template in the VMTurbo UI (can use the editor in the Deploy tab or in the Plan tab when adding a VM template).   NOTE: The commodities you need to specify are VMem, VCPU and VStorage.  Other commodities such as Network, IO and IOPS are not traded in this analysis.

      

  1. Log into the VMTurbo server. SSH using the user id: root  and the password: vmturbo (which is the default).
  2. Edit the file that contains the template profiles /srv/tomcat/data/topology/ServiceEntityProfiles.profiles.topology on the VMTurbo server as root
    1. First make a backup of the original
    2. Edit the file by looking for the entity of the VM Template by name and add the parameter enableResizeMatch="true"
    3. This is an example: <profiles xsi:type="ServiceEntityProfiles:VirtualMachineProfile" uuid="_31G1wL6IEeKQ55_kljWXYA" name="VirtualMachine::VSI-1-2" displayName="VSI-1-2" enableResizeMatch="true" numVCPUs="2" vCPUSpeed="2266.0" vMemSize="1048576.0" vStorageSize="102400.0" vendor="anything here" description="1 Gg RAM 2vCPU anything here">
    4. Note this file may be copied to other VMTurbo servers in an aggregated server environment.
  3. Save the file and restart the tomcat service
  4. Resize to templates will start to appear within 24 – 48 hours of the changes introduced and you may see entries like this:

 

 

Considerations

Important notes when doing resize to template:

  • You must carefully consider the upper and lower bounds, or the smallest and largest Templates. It is recommended that you have at least 3 templates defined in order to not waste resources.  For best results, have a range of templates.
  • These are Global settings and will apply to all VMs in all VCs/Clusters. However, there is still an option to disable resize recommendations on a per group/cluster basis if certain groups of VMs should not/cannot be resized.
  • EVERY commodity needs to be matched: VMem, vCPU and Storage.  If you have VMs that have various storage requirements, consider making your resize templates to the maximum storage amount, because if a VM cannot fit a template because the storage defined is smaller than the VM is now, then VMTurbo will resize to the largest template available among all 3 commodities, causing some very high increment rightsizing recommendations in VMem and VCPU.  Therefore watch your vStorageSize or Storage size values in the templates.
  • Enabling TEMPLATES will not automatically resize all VMs in the environment, only those that are at risk which produces a valid recommendation or need to resize
  • Any resize action will match to the NEAREST template (see reduce vMem example above. Because there are no templates between 16Gb to 12 Gb VMem, you saw a recommendation to basically leave it as is in terms of the VMem value – actually in this case the vCPU goes up from 4 to 6, which is not seen because VCPU is not the commodity that is responsible for the desired state).  Note that you may see a resize action to then go from one template to the same one, and the tool tip in the action will tell you what the desired value is even if there is no template.
  • Will not resize down below peak, and other resizing refer to the Workload Rightsizing post here https://greencircle.vmturbo.com/community/products/blog/2015/02/15/workload-rightsizing-and-vmturbo
  • If the current VM configuration does NOT equal a template (that is resize enabled) then the FROM is blank in the UI and in the VM Rightsizing Report.  You can mouse over the descriptions to see more info.
  • Resize to template is automatically enabled if there is a CloudStack or OpenStack target and the CloudStack/OpenStack VM templates are used for all workload being managed by that VMTurbo server. If you wish to separate these, then set up CloudStack/OpenStack targets to be in a separate VMTurbo, which can be aggregated.
  • If you have workloads defined with reservations or limits, those resources are right-sized based on those values and not templates. These screenshots show this behavior:

 

Performance Assurance Examples:

Efficiency Recommendations Example:

 

 

 

Other Template Modification Options: Utilization Factors.

Since you are modifying the templates configuration files for Resizing, you can also consider if you would like to modify the template to represent a specific utilization value for vMEM and vCPU commodities that will be a factor when these templates are used for Planning purposes and for VM Headroom analysis.

 

Turbo-Tip: If you want to specify utilization factors, which are a key factor on how the VM consumes resources and therefore market actions and resulting resource utilization, then consider creating your templates using the REST API.  Refer to the API document here VMTURBO REST API GUIDE 5.1 pdf format and the series on using the REST API here VMTurbo REST API Series Part 1: Introduction to Use Cases

 

Proceed if you would like to modify an existing template.  To see examples of VM Templates that show customized utilization values see the Out Of The Box templates provided with your VMTurbo Server.  Go to Plan, then select the +/- button to modify workload:

Note you do not need to actually scope and run a plan to see templates.

 

Select a template:

And then click Edit to see allocated values.  Mouse over VMEM, VCPU and VSTORAGE to see how much of these values are being consumed to represent utilization of that commodity:

(Note you can also see a list of templates in the Deploy tab, or for v4.5+ in the Policy tab for Cluster Capacity configuration).

 

Another template type will be ones that you create or are imported from your system. Those will be assigned higher utilization values by default with typical values of 50% for vCPU, 70% for vMem, and 100% for vStorage utilization.  Consider this when you use templates and understand that VMTurbo places and sizes supply based on utilization.

 

The steps to modify the utilization values are:

  1. Log into the VMTurbo server. SSH using the user id: root  and the password: vmturbo (which is the default).
  2. Edit the file containing the template profiles: /srv/tomcat/data/topology/ServiceEntityProfiles.profiles.topology on the VMTurbo server as root
  3. First make a backup of the original
  4. Edit the file by looking for the entity of the VM Template by name and then either add or modify the parameters: memConsumedFactor=0.XX (to modify the VMEM value being consumed) or cpuConsumedFactor=0.XX (to modify the VCPU value being consumed) where 0.XX is the utilization percentage values you want to use.  For example 0.20 will equal 20%.
  5. This is an example: <profiles xsi:type="ServiceEntityProfiles:VirtualMachineProfile" uuid="_31G1wL6IEeKQ55_kljWXYA" name="VirtualMachine::VSI-1-2" displayName="VSI-1-2" enableResizeMatch="true" numVCPUs="2" cpuConsumedFactor=0.20 vCPUSpeed="2266.0" vMemSize="1048576.0" memConsumedFactor=0.25 vStorageSize="102400.0" vendor="anything here" description="1 Gg RAM 2vCPU anything here">
  6. Note this file may be copied to other VMTurbo servers in an aggregated server environment.
  7. Save the file and restart the tomcat service

Attachments

Outcomes