Provisioning devices
Provisioning Red Hat Edge Manager devices
Abstract
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.
Provisioning requires cluster administrator access.
Additional resources
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.
Additional resources
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
flightctlCLI is installed, and you are logged in to your Red Hat Edge Manager service instance. -
The
ocCLI 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
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
Create a cloud configuration user data file called
cloud-config.yamlthat 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
Create a Kubernetes
Secretthat contains the cloud configuration user data file:oc create secret generic enrollment-secret --from-file=userdata=cloud-config.yaml
Create a file that contains the
VirtualMachineresource 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 EOFApply 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
Additional resources