Virtualization

SUSE Manager allows you to autoinstall and manage Xen and KVM VM Guests on a registered VM Host Server. To autoinstall a VM Guest, an autoinstallable distribution and an autoinstallation profile (AutoYaST or Kickstart) need to exist on SUSE Manager. VM Guests registered with SUSE Manager can be managed like “regular” machines. In addition, basic VM Guest management tasks such as (re)starting and stopping or changing processor and memory allocation can be carried out using SUSE Manager.

The following documentation is valid in the context of traditional clients. Salt minions must be treated differently:

  • Autoinstallation is not supported, but creation of a guest from a template disk image is supported.

Limitation to Xen and KVM Guests

Autoinstalling and managing VM Guests via SUSE Manager is limited to Xen and KVM guests. SUSE Manager uses libvirt for virtual machine management. Currently, virtual machines from other virtualization solutions such as VMware* or VirtualBox*, are recognized as VM Guests, but cannot be managed from within SUSE Manager.

Autoinstalling VM Guests

With SUSE Manager you can automatically deploy Xen and KVM VM Guests using AutoYaST or Kickstart profiles. It is also possible to automatically register the VM Guests, so they can immediately be managed by SUSE Manager.

Requirements on SUSE Manager

Setting up and managing VM Guests with SUSE Manager does not require special configuration options. However, you need to provide activation keys for the VM Host Server and the VM Guests, an autoinstallable distribution and an autoinstallation profile. To automatically register VM Guests with SUSE Manager, a bootstrap script is needed.

Activation Keys

Just like any other client, VM Host Server and VM Guests need to be registered with SUSE Manager using activation keys. Find details on how to set up activation keys at [create.act.keys]. While there are no special requirements for a VM Guest key, at least the following requirements must be met for the VM Host Server activation key.

VM Host Server Activation Key: Minimum Requirements
  • Entitlements: Provisioning, Virtualization Platform.

  • Packages: mgr-virtualization-host, mgr-osad.

    If you want to manage the VM Host Server system from SUSE Manager (for example, by executing remote scripts), the package mgr-cfg-actions needs to be installed as well.

Setting up an Autoinstallable Distribution

To autoinstall clients from SUSE Manager, you need to provide an “autoinstallable distribution”, also referred to as autoinstallable tree or installation source. This installation source needs to be made available through the file system of the SUSE Manager host. It can for example be a mounted local or remote directory or a “loop-mounted” ISO image. It must match the following requirements:

  • Kernel and initrd location:

Red Hat Enterprise Linux / Generic RPM
  • images/pxeboot/vmlinuz

  • images/pxeboot/initrd.img

SUSE
  • boot/arch/loader/initrd

  • boot/arch/loader/linux

    • The Base Channel needs to match the autoinstallable distribution.

Autoinstallation package sources

There is a fundamental difference between Red Hat Enterprise Linux and SUSE systems regarding the package sources for autoinstallation. The packages for a Red Hat Enterprise Linux installation are being fetched from the Base Channel. Packages for installing SUSE systems are being fetched from the autoinstallable distribution.

As a consequence, the autoinstallable distribution for a SUSE system has to be a complete installation source (same as for a regular installation).

Procedure: Creating Autoinstallable Distribution
  1. Make sure an installation source is available from a local directory. The data source can be any kind of network resource, a local directory or an ISO image (which has to be “loop-mounted” ). Files and directories must be world readable.

  2. Log in to the SUSE Manager Web UI and navigate to Systems  Autoinstallation  Distributions  Create Distribution.

  3. Fill out the form Create Autoinstallable Distribution as follows:

    Distribution Label

    Choose a unique name for the distribution. Only letters, numbers, hyphens, periods, and underscores are allowed; the minimum length is 4 characters. This field is mandatory.

    Tree Path

    Absolute local disk path to installation source. This field is mandatory.

    Base Channel

    Channel matching the installation source. This channel is the package source for non-SUSE installations. This field is mandatory.

    Installer Generation

    Operating system version matching the installation source. This field is mandatory.

    Kernel Options

    Options passed to the kernel when booting for the installation. There is no need to specify the install= parameter since it will automatically be added. Moreover, the parameters self_update=0 pt.options=self_update are added automatically to prevent AutoYaST from updating itself during the system installation. This field is optional.

    Post Kernel Options

    Options passed to the kernel when booting the installed system for the first time. This field is optional.

  4. Save your settings by clicking Create Autoinstallable Distribution.

To edit an existing Autoinstallable Distribution, go to Systems  Autoinstallation  Distributions and click on a Label. Save your settings by clicking Update Autoinstallable Distribution.

Providing an Autoinstallation Profile

Autoinstallation profiles (AutoYaST or Kickstart files) contain all the installation and configuration data needed to install a system without user intervention. They may also contain scripts that will be executed after the installation has completed.

All profiles can be uploaded to SUSE Manager and be edited afterwards. Kickstart profiles can also be created from scratch with SUSE Manager.

A minimalist AutoYaST profile including a script for registering the client with SUSE Manager is listed in [advanced.topics.app.ay.example-simple].

For more information, examples and HOWTOs on AutoYaST profiles, refer to SUSE Linux Enterprise AutoYaST (https://www.suse.com/documentation/sles-12/book_autoyast/data/book_autoyast.html). For more information on Kickstart profiles, refer to your Red Hat Enterprise Linux documentation.

SUSE Linux Enterprise 15 Systems

You need the installation media to setup the distribution. Starting with version 15, there is only one installation media. You will use the same one for SLES, SLED, and all the other SUSE Linux Enterprise 15 based products.

In the AutoYaST profile specify which product is to be installed. For installing SUSE Linux Enterprise Server use the following snippet in autoyast.xml:

<products config:type="list">
  <listentry>SLES</listentry>
</products>

Then specify all the required modules as add-on in autoyast.xml. This is a minimal SLE-Product-SLES15-Pool selection that will result in a working installation and can be managed by SUSE Manager:

  • SLE-Manager-Tools15-Pool

  • SLE-Manager-Tools15-Updates

  • SLE-Module-Basesystem15-Pool

  • SLE-Module-Basesystem15-Updates

  • SLE-Product-SLES15-Updates

It is also recommended to add the following modules:

  • SLE-Module-Server-Applications15-Pool

  • SLE-Module-Server-Applications15-Updates

Uploading an Autoinstallation Profile
  1. Log in to the SUSE Manager Web interface and open Systems  Autoinstallation  Profiles  Upload New Kickstart/AutoYaST File.

  2. Choose a unique name for the profile. Only letters, numbers, hyphens, periods, and underscores are allowed; the minimum length is 6 characters. This field is mandatory.

  3. Choose an Autoinstallable Tree from the drop-down menu. If no Autoinstallable Tree is available, you need to add an Autoinstallable Distribution. Refer to Setting up an Autoinstallable Distribution for instructions.

  4. Choose a Virtualization Type from the drop-down menu. KVM and Xen (para-virtualized and fully-virtualized) are available. Do not choose Xen Virtualized Host here.

  5. Scroll down to the File to Upload dialog, click Browse to select it, then click Upload File.

  6. The uploaded file will be displayed in the File Contents section, where you can edit it.

  7. Click Create to store the profile.

To edit an existing profile, go to Systems  Autoinstallation  Profiles and click on a Label. Make the desired changes and save your settings by clicking Create.

Editing existing Kickstart profiles

If you are changing the Virtualization Type of an existing Kickstart profile, it may also modify the bootloader and partition options, potentially overwriting any user customizations. Be sure to review the Partitioning tab to verify these settings when changing the Virtualization Type.

Creating a Kickstart Profile

Currently it is only possible to create autoinstallation profiles for Red Hat Enterprise Linux systems. If installing a SUSE Linux Enterprise Server system, you need to upload an existing AutoYaST profile as described in Uploading an Autoinstallation Profile.

  1. Log in to the SUSE Manager Web interface and go to Systems  Autoinstallation  Profiles  Create New Kickstart File.

  2. Choose a unique name for the profile. The minimum length is 6 characters. This field is mandatory.

  3. Choose a Base Channel. This channel is the package source for non-SUSE installations and must match the Autoinstallable Tree. This field is mandatory.

  4. Choose an Autoinstallable Tree from the drop-down menu. If no Autoinstallable Tree is available, you need to add an Autoinstallable Distribution. Refer to Setting up an Autoinstallable Distribution for instructions.

  5. Choose a Virtualization Type from the drop-down menu. KVM and Xen (para-virtualized and fully-virtualized) are available. Do not choose Xen Virtualized Host here.

  6. Click the Next button.

  7. Select the location of the distribution files for the installation of your VM Guests. There should already be a Default Download Location filled out and selected for you on this screen. Click the Next button.

  8. Choose a root password for the VM Guests. Click the Finish button to generate the profile.

    This completes Kickstart profile creation. After generating a profile, you are taken to the newly-created Kickstart profile. You may browse through the various tabs of the profile and modify the settings as you see fit, but this is not necessary as the default settings should work well for the majority of cases.

Adding a Registration Script to the Autoinstallation Profile

A VM Guest that is autoinstalled does not get automatically registered. Adding a section to the autoinstallation profile that invokes a bootstrap script for registration will fix this. The following procedure describes adding a corresponding section to an AutoYaST profile. Refer to your Red Hat Enterprise Linux documentation for instructions on adding scripts to a Kickstart file.

  1. First, provide a bootstrap script on the SUSE Manager:

    • Create a bootstrap script for VM Guests on the SUSE Manager as described in [generate.bootstrap.script].

    • Log in as root to the konsole of SUSE Manager and go to /srv/www/htdocs/pub/bootstrap. Copy bootstrap.sh (the bootstrap script created in the previous step) to for example, bootstrap_vm_guests.sh in the same directory.

    • Edit the newly created file according to your needs. The minimal requirement is to include the activation key for the VM Guests (see Activation Keys for details). We strongly recommend to also include one or more GPG keys (for example, your organization key and package signing keys).

  2. Log in to the SUSE Manager Web interface and go to Systems  Autoinstallation  Profiles. Click on the profile that is to be used for autoinstalling the VM Guests to open it for editing.

    Scroll down to the File Contents section where you can edit the AutoYaST XML file. Add the following snippet at the end of the XML file right before the closing </profile> tag and replace the given IP address with the address of the SUSE Manager server. See [advanced.topics.app.ay.example-simple]for an example script.

    <scripts>
      <init-scripts config:type="list">
        <script>
          <interpreter>shell </interpreter>
          <location>
            http://`192.168.1.1`/pub/bootstrap/bootstrap_vm_guests.sh
          </location>
        </script>
      </init-scripts>
    </scripts>
    Only one <scripts> section allowed
    If your AutoYaST profile already contains a <scripts> section, do not add a second one, but rather place the <script> part above within the existing <scripts> section!
  3. Click Update to save the changes.

VM Host Server Setup

A VM Host Server system serving as a target for autoinstalling VM Guests from SUSE Manager must be capable of running guest operating systems. This requires either KVM or Xen being properly set up. For installation instructions for SUSE Linux Enterprise Server systems refer to the SLES Virtualization Guide available from https://www.suse.com/documentation/sles-12/book_virt/data/book_virt.html. For instructions on setting up a Red Hat Enterprise Linux VM Host Server refer to your Red Hat Enterprise Linux documentation.

Since SUSE Manager uses libvirt for VM Guest installation and management, the libvirtd needs to run on the VM Host Server. The default libvirt configuration is sufficient to install and manage VM Guests from SUSE Manager. However, in case you want to access the VNC console of a VM Guest as a non-root user, you need to configure libvirt appropriately. Configuration instructions for libvirt on SUSE Linux Enterprise Server are available in the SLES Virtualization Guide available from https://www.suse.com/documentation/sles-12/book_virt/data/book_virt.html available from http://www.suse.com/documentation/sles11/. For instructions for a Red Hat Enterprise Linux VM Host Server refer to your Red Hat Enterprise Linux documentation.

Apart from being able to serve as a host for KVM or Xen guests, which are managed by libvirt, a VM Host Server must be registered with SUSE Manager.

  1. Make sure either KVM or Xen is properly set up.

  2. Make sure the libvirtd is running.

  3. Register the VM Host Server with SUSE Manager:

    • Create a bootstrap script on the SUSE Manager as described in [generate.bootstrap.script].

    • Download the bootstrap script from susemanager.example.com/pub/bootstrap/bootstrap.sh to the VM Host Server.

    • Edit the bootstrap script according to your needs. The minimal requirement is to include the activation key for the VM Host Server (see Activation Keys for details). We strongly recommend to also include one or more GPG keys (for example, your organization key and package signing keys).

    • Execute the bootstrap script to register the VM Host Server.

VM Host Server setup on Salt clients

If the VM Host Server is registered as a Salt minion, a final configuration step is needed in order to gather all the guest VMs defined on the VM Host Server:

  1. From the System Details  Properties page, enable the Add-on System Type Virtualization Host and confirm with Update Properties.

  2. Schedule a Hardware Refresh. On the System Details  Hardware page click Schedule Hardware Refresh.

Salt 2019.2.0 or later is required on the virtual host in order for the salt-based virtualization features to fully work on it.

VM Host Server setup on Traditional clients

Once the registration process is finished and all packages have been installed, enable osad (open source architecture daemon). On a SUSE Linux Enterprise Server system this can be achieved by running the following commands as user root:

systemctl stop rhnsd
systemctl disable rhnsd
systemctl enable osad
systemctl start osad
Using osad with rhnsd
The rhnsd daemon checks for scheduled actions every four hours, so it can take up to four hours before a scheduled action is carried out. If many clients are registered with SUSE Manager, this long interval ensures a certain level of load balancing since not all clients act on a scheduled action at the same time.

However, when managing VM Guests, you usually want actions like rebooting a VM Guest to be carried out immediately, which can be done by adding osad. The osad daemon receives commands over the jabber protocol from SUSE Manager and commands are instantly executed. Alternatively you may schedule actions to be carried out at a fixed time in the future (whereas with rhnsd you can only schedule for a time in the future plus up to four hours).

Autoinstalling VM Guests

Once all requirements on the SUSE Manager and the VM Host Server are met, you can start to autoinstall VM Guests on the host. Note that VM Guests will not be automatically registered with SUSE Manager, therefore we strongly recommend to modify the autoinstallation profile as described in Adding a Registration Script to the Autoinstallation Profile. VM Guests need to be registered to manage them with SUSE Manager. Proceed as follows to autoinstall a VM Guest.

No parallel Autoinstallations on VM Host Server

It is not possible to install more than one VM Guest at a time on a single VM Host Server. When scheduling more than one autoinstallation with SUSE Manager make sure to choose a timing, that starts the next installation after the previous one has finished. If a guest installation starts while another one is still running, the running installation will be cancelled.

  1. In the Web UI click the Main Menu  Systems  Systems tab.

  2. Click the VM Host Server’s name to open its System Status page.

  3. Open the form for creating a new VM Guest by clicking Virtualization  Provisioning. Fill out the form by choosing an autoinstallation profile and by specifying a name for the VM Guest (must not already exist on VM Host Server). Choose a proxy if applicable and enter a schedule. To change the VM Guest’s hardware profile and configuration options, click Advanced Options.

  4. Finish the configuration by clicking Schedule Autoinstallation and Finish. The Session Status page opens for you to monitor the autoinstallation process.

Checking the Installation Log

To view the installation log, click Events  History on the Session Status page. On the System History Event page you can click a Summary entry to view a detailed log.

In case an installation has failed, you can Reschedule it from this page once you have corrected the problem. You do not have to configure the installation again.

If the event log does not contain enough information to locate a problem, log in to the VM Host Server console and read the log file for your package manager. If you are using the rhnsd, you may alternatively immediately trigger any scheduled actions by calling rhn_check on the VM Host Server. Increase the command’s verbosity by using the options -v, -vv, or -vvv, respectively.

Managing VM Guests

Basic VM Guest management actions such as restarting or shutting down a virtual machine as well as changing the CPU and memory allocation can be carried out in the SUSE Manager Web interface if the following requirements are met:

  • VM Host Server must be a KVM or Xen host.

  • libvirtd must be running on VM Host Server.

  • VM Host Server must be registered with SUSE Manager.

In addition, if you want to see the profile of the VM Guest, install packages, etc., you must also register it with SUSE Manager.

All actions can be triggered in the SUSE Manager Web UI from the Virtualization page of the VM Host Server. Navigate to this page by clicking the Main Menu  Systems  Systems. On the resulting page, click the VM Host Server’s name and then on Virtualization. This page lists all VM Guests for this host, known to SUSE Manager.

Displaying a VM Guest 's Profile

Click the name of a VM Guest on the VM Host Server’s Virtualization page to open its profile page with detailed information about this guest. For details, refer to [ref.webui.systems.systems].

A profile page for a virtual system does not differ from a regular system’s profile page. You can perform the same actions (for example, installing software or changing its configuration).

Starting, Stopping, Suspending and Resuming a VM Guest

To start, stop, restart, suspend, or resume a VM Guest, navigate to the VM Host Server’s Virtualization page. Click the corresponding action button in the row of the VM Guest. Alternatively, check one or more Guests listed in the table and click the corresponding button above the table. Confirm the action on the displayed popup dialog.

Automatically restarting a VM Guest

Automatically restarting a VM Guest when the VM Host Server reboots is not enabled by default on VM Guests and cannot be configured from SUSE Manager. Refer to your KVM or Xen documentation. Alternatively, you may use libvirt to enable automatic reboots.

Changing the CPU or RAM allocation of a VM Guest

To change the CPU or RAM allocation of a VM Guest navigate to the VM Host Server’s Virtualization page. Click the Edit button on the VM Guest row. Change the values to the desired ones in the next page and click the Update button to apply.

The memory allocation can be changed on the fly, provided the memory ballooning driver is installed on the VM Guest. If this is not the case, or if you want to change the CPU allocation, you need to shutdown the guest first. Refer to Starting, Stopping, Suspending and Resuming a VM Guest for details.

You can also perform more advanced VM Guest editing tasks on Salt minions, such as adding or removing disks and network interfaces, and changing the display type.

Deleting a VM Guest

Deleting a VM Guest is only possible on Salt minions, not on traditional clients.

To delete a VM Guest, navigate to the VM Host Server’s Virtualization page. Click the Delete button on the VM Guest row. Alternatively, check one or more Guests listed in the table and click the Delete button above the table. Confirm the action on the displayed popup dialog.

Displaying VM Guest graphical console

In order to be able to display a VM Guest VNC or Spice graphical console, the virtual host corresponding port needs to be reachable by the server. The server’s 8050 port also needs to be reachable. The VM Guest graphics settings also have to listen on at least the virtual host address. This is the default for any VM Guest created using the web interface.