Install SUSE Manager in a Virtual Machine Environment Using SUSE Manager VM Image

1. Virtual Machine Manager Settings

This chapter provides the required Kernel Virtual Machine (KVM) settings for SUSE Manager. KVM combined with Virtual Machine Manager (virt-manager) will be used as a sandbox for this installation.

You will find the VM images for SUSE Manager 4.3 in various formats. They include SUSE Linux Enterprise Server 15 SP4 as the underlying operating system and the SUSE Manager software current at the time of build. Download the appropriate SUSE Manager image for your environment from https://download.suse.com/.

This table specifies the minimum requirements. These are suitable for a quick test installation, such as a server with one client. If you want to use a production environment, review the requirements listed in Hardware Requirements.

Virtual machine settings overview

Installation Method

Import Existing Disk Image

OS:

SUSE Linux Enterprise 15 SP4

Memory:

16 GB

CPU’s:

4

Virtual Disks:

VirtIO Disk 1

SUSE-Manager-Server.x86_64-4.3.10-KVM.qcow2

VirtIO Disk 2

101 GB for /var/spacewalk

VirtIO Disk 3

50 GB for /var/lib/pgsql

VirtIO Disk 4

4 GB for swap

CDROM

Ignition or Cloud Init configuration disk

Name:

suse-manager-test-setup

Network

Bridge br0

For more information on SUSE Linux Enterprise Virtualization, see https://documentation.suse.com/sles/15-SP4/html/SLES-all/book-virtualization.html.

SUSE Manager VM image does not set up root or any other user account. User or root authentications need to be set up during first boot. This can be done using Ignition or Cloud-Init methods.

2. SUSE Manager basic configuration using Ignition

Ignition is a provisioning tool that enables you to configure a system according to your specification on the first boot. When the system is booted for the first time, Ignition is loaded as part of an initramfs and searches for a configuration file within a specific directory (on a USB flash disk, or you can provide a URL).

Ignition uses a configuration file in the JSON format. The file is called config.ign.

The config.ign is a JSON configuration file that provides prescriptions for Ignition. You can either create the file manually in JSON, or you can use the Fuel Ignition tool to generate a basic set of prescriptions. The Fuel Ignition tool does not provide a full set of options, so you might have to modify the file manually. For more information, see https://ignite.opensuse.org/.

When installing, the configuration file config.ign must reside in the ignition subdirectory on the configuration media labeled ignition. The directory structure must look as follows:

<root directory>
└── ignition
    └── config.ign

If you intend to configure a QEMU/KVM virtual machine, provide the path to the config.ign file as an attribute of the qemu command. For example:

-fw_cfg name=opt/com.coreos/config,file=PATH_TO_config.ign

The config.ign file contains various data types: objects, strings, integers, booleans, and lists of objects. For the complete specification, see https://coreos.github.io/ignition/configuration-v3_3/.

2.1. Set Root Password Using Ignition

The SUSE Manager VM image does not set up root or any other user account. User or root authentications need to be set up during first boot. The passwd attribute is used to add users. If you intend to log in the system, create root and set the root’s password and/or add the SSH key to the Ignition configuration. You need to hash the root password, for example, by using the openssl command:

openssl passwd -6

The command creates a hash of the password you chose. Use this hash as the value of the passwordHash attribute.

The users attribute must contain at least one name attribute. ssh_authorized_keys is a list of ssh keys for the user.

Create the root/ignition/config.ign file with the following content:

{
  "ignition": {
    "version": "3.2.0"
  },
  "passwd": {
    "users": [
      {
        "name": "root",
        "passwordHash": "$2a$10$qV298UV11u9lCFDjpHpCUe1cErBiVR.G3shukxs3.2PAO1xhJWs0K"
      }
    ]
  }
}

Prepare the Ignition ISO file using the command:

mkisofs -full-iso9660-filenames -o suma_ignition.iso -V ignition root

Attach the created suma_ignition.iso file as a volume to the virtual machine at first boot. This particular example is setting the root password to linux. Substitute your password hash for the one in this example.

3. SUSE Manager basic configuration using Cloud Init disk

Cloud Init is a provisioning tool that enables you to configure a system according to your specification on the first boot. When the system is booted for the first time, Cloud Init service is loaded and searches for a configuration file within a specific directory (on a USB flash disk, or you can provide a URL).

Cloud Init uses few configuration files in the YAML format. Used files are named meta-data, network-config and user-data.

Cloud Init allows numerous sources where to store configuration data. In this guide we use local iso image with volume id cidata as a source. The directory structure must look as follows:

<root directory>
└── meta-data
└── network-config
└── user-data

If you intend to configure a QEMU/KVM virtual machine, provide the path to the config.ign as an attribute of the qemu command. For example:

-fw_cfg name=opt/com.coreos/config,file=PATH_TO_config.ign

The Cloud Init allows many management options. For a complete specification, refer to Cloud Init specification (https://cloudinit.readthedocs.io/en/latest/index.html).

3.1. Set Up Root Password Using Cloud Init

You need to hash the root password, for example, by using the openssl command:

openssl passwd -6

The command creates a hash of the password you chose. Use this hash as the value of the password attribute.

Prepare the needed configuration files using the following commands:

touch network-config
touch meta-data

Create a file named user-data with the following content:

#cloud-config
chpasswd:
  expire: false
  users:
    - name: root
      password: $2a$10$qV298UV11u9lCFDjpHpCUe1cErBiVR.G3shukxs3.2PAO1xhJWs0K

Prepare Cloud Init ISO file using the command:

mkisofs -rational-rock -joliet -o suma_cloudinit.iso -V cidata network-config meta-data user-data

Attach the created suma_cloudinit.iso file as a volume to the creating virtual machine. This particular example is setting root password to linux. Substitute your password hash for the one in this example

4. SUSE Manager Virtual Machine Settings

Create a virtual machine with three additional virtual disks required for the SUSE Manager storage partitions.

Procedure: Creating the VM and Additional Partitions with virt-manager
  1. In virt-manager, open File  New Virtual Machine.

  2. In the Create a new virtual machine dialog, select Import existing disk image and confirm with Forward.

  3. Enter the filename of the downloaded SUSE Manager KVM image and set SUSE Linux Enterprise 15 SP4 as the operating system. Confirm with Forward.

  4. Configure RAM and number of CPUs (at least 16 GB RAM and 4 CPUs). Confirm with Forward.

  5. Set the name of your VM and select the Customize configuration before install check box.

  6. With the Network selection drop-down menu select the configured bridge device.

  7. Confirm with Finish.

  8. In the overview dashboard, at the bottom of the left navigation bar, click Add Hardware to create additional virtual disks with the following specifications. These disks will be partitioned and mounted in [proc.sumavm.susemgr.prep].

    Storage size values are the absolute minimum—only suitable for a small test or demo installation. Especially /var/spacewalk/ may quickly need more space. Also consider to create a separate partition for /srv where Kiwi images are stored.

    VirtIO Storage Disks Name Sizing

    VirtIO Disk 2

    spacewalk

    500 GB

    VirtIO Disk 3

    pgsql

    100 GB

    VirtIO Disk 4

    swap

    4 GB

  9. Click Add Hardware to attach a virtual CDROM device with the prepared Ignition or Cloud Init disk.

  10. Click Begin Installation to boot the new VM from the SUSE Manager image. Wait until the login prompt is presented. Log in using credentials set by configuration disk.

5. SUSE Manager Virtual Machine Settings - VMware

This sections describes VMware configurations, focusing on the creation of an extra virtual disk essential for the SUSE Manager storage partition within VMware environments.

Procedure: Creating the VMware Virtual Machine
  1. Download SUSE Manager Server .vmdk file then transfer a copy to your VMware storage.

  2. Upload the prepared Ignition or Cloud Init disk file you created using the instructions above.

  3. Create and name a new virtual machine based on the Guest OS Family Linux and Guest OS Version SUSE Linux Enterprise 15 (64-bit).

  4. In Customize settings browse to the uploaded .vmdk using IDE controller 0 storage device in the Controller Location.

  5. Add an additional Hard Disk 2 of 500 GB (or more).

  6. Configure RAM and number of CPUs (at least 16 GB RAM and 4 CPUs).

  7. Set the network adapter as required.

  8. Set the CD/DVD Drive 1 to use the uploaded configuration as a Datastore ISO. Tick the box next to Connect. This drive must be present when you power on the machine initially.

  9. Power on the VM, and log in using credentials set by configuration disk.

6. Preparing Virtual Machine for SUSE Manager

Before starting obtain your SUSE Manager Registration Code from SUSE Customer Center - https://scc.suse.com.

Procedure: Preparing for SUSE Manager run
  1. Log in as root.

  2. Register SUSE Manager with SCC. For example, replace <productnumber> with 4.3 and <architecture> with x86_64:

    SUSEConnect -e <EMAIL_ADDRESS> -r <SUSE_MANAGER_CODE> \
      -p SUSE-Manager-Server/<productnumber>/<architecture>
  3. Validate the authorized extensions by running the list extensions command:

    SUSEConnect --list-extensions
  4. Add SUSE Manager repositories:

    SUSEConnect -p sle-module-basesystem/15.4/x86_64
    SUSEConnect -p sle-module-server-applications/15.4/x86_64
    SUSEConnect -p sle-module-web-scripting/15.4/x86_64
    SUSEConnect -p sle-module-suse-manager-server/<productnumber>/x86_64
  5. Prepare SUSE Manager storage: suma-storage command automatically prepares and configures previously created external storage for use with SUSE Manager. In the following command the first parameter is the device for SUSE Manager data, the second parameter is the device for the database.

    suma-storage /dev/vdb /dev/vdc
  6. The virtual machine is now ready for SUSE Manager to be set up.

For proceeding with SUSE Manager setup, see SUSE Manager Setup.