Provisioning devices

Red Hat Edge Manager 1.2

Provisioning Red Hat Edge Manager devices

Red Hat Edge Manager Documentation Team

Abstract

This document provides information about Provisioning Red Hat Edge Manager devices

Preface

You can provision physical and virtual edge devices for enrollment into Red Hat Edge Manager. Depending on your target environment, you can provision a device by using an ISO disk image on bare metal or a QCow2 container disk image on OpenShift Virtualization.

Chapter 1. Provisioning devices

You can provision devices with Red Hat Edge Manager in different environments. Use the operating system image or disk image that you built and, depending on your target environment, provision a physical or virtual device. You can also use images created with the simplified image building workflow to provision devices.

When you install a bootc image from the Software Catalog to a device that is not yet enrolled, the Flight Control web console provides scenario-specific provisioning guidance. The guidance includes links to download the required artifacts, for example, ISO or QCow2. Use that guidance together with the provisioning procedures.

Note

Provisioning requires cluster administrator access.

1.1. Provisioning physical devices

When you build an ISO disk image from an operating system image by using the bootc-image-builder tool, the image is similar to the RHEL ISO images available for download. However, the ISO disk image embeds your operating system image content.

To install the ISO disk image to a bare metal system without having access to the network, see Deploying a custom ISO container image.

For information about installing the ISO through the network, see Deploying an ISO bootc image over PXE boot.

1.2. Provision devices on OpenShift Virtualization

You can provision a virtual machine on OpenShift Virtualization by using a QCow2 container disk image hosted on an OCI container registry. If your operating system image does not already contain the Red Hat Edge Manager agent enrollment configuration, you can inject the configuration through the cloud-init user data during provisioning.

Prerequisites

  • OpenShift Virtualization is installed on your OpenShift Container Platform cluster.
  • You have built a QCow2 container disk image and pushed it to an OCI container registry.
  • The flightctl CLI is installed, and you are logged in to your Red Hat Edge Manager service instance.
  • The oc CLI is installed, you are logged in to your OpenShift Container Platform cluster instance, and you have changed to the project in which you want to create your virtual machine.

Procedure

  1. Request a new Red Hat Edge Manager agent enrollment configuration and store it in a file called config.yaml. Run the following command:

    flightctl certificate request --signer=enrollment --expiration=365d --output=embedded > config.yaml
  2. Create a cloud configuration user data file called cloud-config.yaml that places the agent configuration in the correct location during the first boot. Run the following command:

    cat <<EOF > cloud-config.yaml
    #cloud-config
    write_files:
    - path: /etc/flightctl/config.yaml
      content: $(cat config.yaml | base64 -w0)
      encoding: b64
      permissions: '0600'
    EOF
  3. Create a Kubernetes Secret that contains the cloud configuration user data file:

    oc create secret generic enrollment-secret --from-file=userdata=cloud-config.yaml
  4. Create a file that contains the VirtualMachine resource manifest. Replace <your_registry>/<your_repo>:<your_tag> with the location of your QCow2 container disk image. Run the following command:

    cat <<'EOF' > my-bootc-vm.yaml
    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    metadata:
      name: my-bootc-vm
    spec:
      runStrategy: RerunOnFailure
      template:
        spec:
          domain:
            cpu:
              cores: 1
            memory:
              guest: 1024M
            devices:
              disks:
                - name: containerdisk
                  disk:
                    bus: virtio
                - name: cloudinitdisk
                  disk:
                    bus: virtio
          volumes:
            - name: containerdisk
              containerDisk:
                image: <your_registry>/<your_repo>:<your_tag>
            - name: cloudinitdisk
              cloudInitConfigDrive:
                secretRef:
                  name: enrollment-secret
    EOF
  5. Apply the resource manifest to your cluster by running the following command:

    oc apply -f my-bootc-vm.yaml

Verification

  • Verify that the virtual machine was created and is running:

    oc get vm my-bootc-vm

Legal Notice

Copyright © Red Hat.
Except as otherwise noted below, the text of and illustrations in this documentation are licensed by Red Hat under the Creative Commons Attribution–Share Alike 3.0 Unported license . If you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, the Red Hat logo, JBoss, Hibernate, and RHCE are trademarks or registered trademarks of Red Hat, LLC. or its subsidiaries in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS is a trademark or registered trademark of Hewlett Packard Enterprise Development LP or its subsidiaries in the United States and other countries.
The OpenStack® Word Mark and OpenStack logo are trademarks or registered trademarks of the Linux Foundation, used under license.
All other trademarks are the property of their respective owners.