Skip to content

newkitlabs/sap_create_vm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EXPERIMENTAL

sap_create_vm

Use this role to create a virtual machine ready for SAP workloads (e.g. HANA, Netweaver) on an Red Hat OpenShift Virtualization (OCPv) platform. Note that there is no official support statement from SAP regarding this VMs.

Requirements

An OCPv cluster that has been configured with the sap_hypervisor_node_preconfigure role.

Role Variables

# Namespace the VMs are created in
sap_create_vm_namespace: sap

# Amount of memory [GB] the VM will have
sap_create_vm_memory: 32 # [GB]

######################################
# CPU Topology #######################
######################################
# The here defined virtual CPUs should be a subset of the physical CPUs.
# Ideally, the guest (VM) would have a full NUMA node (typically socket) minus two cores.
# E.g. a physical four socket host with 27 CPU cores (with 2 SMT threads)
# --> A guest with 25 CPU cores, 2 threads and 4 sockets. If the guest should be smaller, use less sockets.
# This settings will greatly effect performance.
#
# Number of CPU cores the VM will have
sap_create_vm_cores: 2

# Number of CPU threads
sap_create_vm_threads: 2

# Number of CPU sockets to use
sap_create_vm_sockets: 1

# Should the RHEL OS image be downloaded from Red Hat
sap_create_vm_download_rhel_images: true

# Version of the RHEL disk image to be downloaded and used as root disk, e.g. 8.6.0, 8.8.0
sap_create_vm_rhel_version: 8.8.0

# This amount of memory [GB] is reserved on top of the VM memory for the container to give it some headroom, only change with caution.
sap_create_vm_memory_overhead: 16 # [GB]

sap_create_vm_cloud_config:
      userData: >+
        #cloud-config

        user: cloud-user

        password: {{ sap_create_vm_cloud_user_passwd }}

        chpasswd:
          expire: false

        network:
          version: 2
          ethernets:
            eth0:
              dhcp4: true


# Networks the VM is attached to, see below for an example
# The OCPv cluster has to have the according NetworkAttachmentDefinitions and NetworkPolicies
sap_create_vm_networks: []

# sap_create_vm_networks:
#  - multus:
#      networkName: sapbridge-network-definition
#    name: sapbridge-network-definition
#  - multus:
#      networkName: iface-storage-sriov
#    name: storage-network-definition
#  - multus:
#      networkName: iface-multi-sriov
#    name: multi-network-definition

# Interfaces the VM has, see below for an example.
# The OCPv cluster has to have the according NetworkAttachmentDefinitions and NetworkPolicies
sap_create_vm_interfaces: []

# sap_create_vm_interfaces:
#  - name: sapbridge-network-definition
#    bridge: {}
#    model: virtio
#    networkInterfaceMultiqueue: true
#  - name: storage-network-definition
#    sriov: {}
#  - name: multi-network-definition
#    sriov: {}

Dependencies

Needs the ansible kubernetes module and the python3 kubernetes binding. On a RHEL based system the are named

  • python3-kubernetes
  • ansible-collection-kubernetes-core

Example Playbook

playbooks/sap-create-vm.yml
---
- hosts: all
  gather_facts: true
  serial: 1
  vars:
    sap_create_vm_cloud_user_passwd: MyS5perS3cureP@assW0rD
  tasks:
    - name: Include Role
      ansible.builtin.include_role:
        name: sap_create_vm

Then call the playbook with e.g.

ansible-playbook -vvv --connection=local -i localhost, playbooks/sap-create-vm.yml -e sap_create_vm_names="['sapvm01']" -e sap_create_vm_memory=24

License

Apache 2.0

Author Information

Nils Koenig (nkoenig@redhat.com)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages