Bug 1948963

Summary: [RFE] Cluster-api-provider-ovirt should handle hugepages
Product: OpenShift Container Platform Reporter: Liran Rotenberg <lrotenbe>
Component: Cloud ComputeAssignee: Liran Rotenberg <lrotenbe>
Cloud Compute sub component: oVirt Provider QA Contact: michal <mgold>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: gzaidman, lleistne, mburman
Version: 4.7   
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Providing hugepages property into the machineset is now possible. It will make the machineset's nodes with custom property in ovirt, telling these nodes to use the hugepages of the hypervisor.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:59:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1925203    

Description Liran Rotenberg 2021-04-13 07:18:03 UTC
urrent state:
cluster-api-provider has no logic for handling hugepages configuration.

What we want:
Cluster API provider should expose logic for adding a created machine having hugepages settings by adding a field for the hugepages in the machine spec.

This means that when you create a machine set you can decide that all the machines will be created with hugepages configuration.

The UI behavior to auto configure high performance VMs with the `existing` policy is not supported.

How to test?
1. Create a machine set with the auto pinning policy, for example:
```yaml
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
  labels:
    machine.openshift.io/cluster-api-cluster: ovirt11-CLUSTERNAME
    machine.openshift.io/cluster-api-machine-role: worker
    machine.openshift.io/cluster-api-machine-type: worker
spec:
  replicas: 1
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: ovirt11-CLUSTERNAME
      machine.openshift.io/cluster-api-machineset: ovirt11-CLUSTERNAME-worker-1
  template:
    metadata:
      labels:
        machine.openshift.io/cluster-api-cluster: ovirt11-CLUSTERNAME
        machine.openshift.io/cluster-api-machine-role: worker
        machine.openshift.io/cluster-api-machine-type: worker
        machine.openshift.io/cluster-api-machineset: ovirt11-CLUSTERNAME-worker-1
    spec:
      providerSpec:
        value:
          hugepages: 2048
          apiVersion: ovirtproviderconfig.machine.openshift.io/v1beta1
          cluster_id: CLUSTERID
          cpu:
            cores: 8
            sockets: 1
            threads: 1
          credentialsSecret:
            name: ovirt-credentials
          kind: OvirtMachineProviderSpec
          memory_mb: 16000
          os_disk:
            size_gb: 31
          template_name: ovirt11-CLUSTERNAME-rhcos
          type: server
          userDataSecret:
            name: worker-user-data
```
2. Verify that 1 machine is created and added with the provided hugepages provided. In RHV you can see it under the VM's custom properties.
3. scale to 2 replicas and make sure that another machine is created and added with the same hugepages configuration.

Negative test suggestion:
- Try to run it with unsupported values(other than 2048 or 1048576).

Comment 2 michal 2021-04-27 10:24:40 UTC
verify on: 
rhv- 4.4.5.10-0.1
ocp - 4.8.0-0.nightly-2021-04-24-175929 

steps:
1) create machineset with 2048 hugepages - verify before that there is enough space in the host               
 ( vi  /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages)
2) verify that machine created in rhv with custom property - 2048kb
3) scale to 2 replicas and make sure that another machine is created and added with the same hugepages configuration.
4) create machineset with unsupported values hugepages -for example -20 
error appear: 
failed to create machine: error creating oVirt instance: The machine `hugepages` custom property must be one of the following options: 2048, 1048576. The value: 20 is not valid

Comment 5 errata-xmlrpc 2021-07-27 22:59:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438