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 |
VirtIO Disk 3 |
50 GB for |
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 |
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.
For more information about Ignition
, see https://documentation.suse.com/sle-micro/5.4/single-html/SLE-Micro-deployment/#cha-images-ignition.
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.
virt-manager
-
In
virt-manager
, open . -
In the
Create a new virtual machine
dialog, selectImport existing disk image
and confirm with Forward. -
Enter the filename of the downloaded SUSE Manager KVM image and set
SUSE Linux Enterprise 15 SP4
as the operating system. Confirm with Forward. -
Configure RAM and number of CPUs (at least 16 GB RAM and 4 CPUs). Confirm with Forward.
-
Set the name of your VM and select the
Customize configuration before install
check box. -
With the
Network selection
drop-down menu select the configured bridge device. -
Confirm with Finish.
-
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
-
Click Add Hardware to attach a virtual CDROM device with the prepared
Ignition
orCloud Init
disk. -
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.
-
Download SUSE Manager Server
.vmdk
file then transfer a copy to your VMware storage. -
Upload the prepared Ignition or Cloud Init disk file you created using the instructions above.
-
Create and name a new virtual machine based on the Guest OS Family
Linux
and Guest OS Version SUSE Linux Enterprise 15 (64-bit). -
In
Customize settings
browse to the uploaded.vmdk
usingIDE controller 0
storage device in theController Location
. -
Add an additional
Hard Disk 2
of 500 GB (or more). -
Configure RAM and number of CPUs (at least 16 GB RAM and 4 CPUs).
-
Set the network adapter as required.
-
Set the
CD/DVD Drive 1
to use the uploaded configuration as aDatastore ISO
. Tick the box next to Connect. This drive must be present when you power on the machine initially. -
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.
-
Log in as
root
. -
Register SUSE Manager with SCC. For example, replace
<productnumber>
with4.3
and<architecture>
withx86_64
:SUSEConnect -e <EMAIL_ADDRESS> -r <SUSE_MANAGER_CODE> \ -p SUSE-Manager-Server/<productnumber>/<architecture>
-
Validate the authorized extensions by running the list extensions command:
SUSEConnect --list-extensions
-
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
-
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
-
The virtual machine is now ready for SUSE Manager to be set up.
For proceeding with SUSE Manager setup, see SUSE Manager Setup.