Aprovisionando Fedora CoreOS sobre Microsoft Hyper-V

Esta guía muestra como aprovisionar nodos Fedora CoreOS (FCOS) nuevos sobre Microsoft Hyper-V.

Prerrequisitos

Antes de aprovisionar una máquina FCOS, usted debe tener un archivo de configuración Ignition que contenga sus personalizaciones. Si no tiene uno consulte Producir un Archivo Ignition.

También necesitarás una pequeña utilidad de libhvee llamada kvpctl. Esta conecta la configuración de Ignition a tu máquina virtual. Puedes encontrar los binarios precompilados en la página de lanzamiento del proyecto.

Descargar la imagen del disco

Las imágenes de disco Hyper-V pueden ser descargadas manualmente desde la página de descarga. Asegúrese que descomprima la imagen tras la descarga.

Arrancar una MV nueva en Microsoft Hyper-V

Crear un conmutador virtual

Primero debe crear un conmutador virtual para que su máquina virtual tenga una red a la que conectarse. Para ello, abra el Gestor de Hyper-V y seleccione su servidor en la lista:

Listado de servidor Hyper-V

Luego pulse en la Gestión de Conmutadores _Virtuales… dentro del panel Acciones:

Panel de Acciones de Gestión Hyper-V

Siga las indicaciones bajo el Nuevo conmutador de red virtual para crear el conmutador virtual del tipo que desea:

Nueva pestaña de Conmutador de Red Virtual

Creating a virtual machine

In the Actions panel of Hyper-V Manager, click New, then Virtual Machine…​:

Hyper-V Manager

This will launch the New Virtual Machine Wizard. When completing the wizard, note the following settings:

  1. If you select a Generation 2 virtual machine, see Configuring Secure Boot.

  2. When prompted to configure networking, select the virtual switch you created earlier.

  3. When prompted to connect a virtual hard disk, select Use an existing virtual disk and specify the disk image you downloaded earlier:

Hyper-V Virtual Machine Disk Wizard

Ajustar la configuración Ignition

Before starting your virtual machine for the first time, you must attach your Ignition config containing the customizations you want to apply to Fedora CoreOS.

On Hyper-V, the Ignition config is presented to the hypervisor in parts. Ignition reads the parts and reassembles them into a single config. You can use the kvpctl add-ign subcommand to create these parts and attach them to the virtual machine. The syntax for the command is as follows:

.\kvpctl.exe <name_of_vm> add-ign <path_to_ign_file>

Por ejemplo:

> .\kvpctl.exe myvm add-ign C:\Users\joe\myvm.ign
added key:  ignition.config.0
added key:  ignition.config.1
added key:  ignition.config.2
added key:  ignition.config.3
added key:  ignition.config.4
added key:  ignition.config.5
added key:  ignition.config.6

Arrancar la MV

Once you’ve attached the Ignition config to the virtual machine, right-click the virtual machine in Hyper-V Manager and select Start.

Viewing the key-value pairs assigned to your virtual machine

You can view the key-value pairs assigned to your machine with the kvpctl get subcommand. You can only get key-value pairs when the virtual machine is running.

.\kvpctl.exe <name_of_vm> get

Por ejemplo:

> .\kvpctl.exe myvm get
ignition.config.3 = th":"/etc/containers/registries.conf..."
ignition.config.4 = ,"contents":{"source":"data:,makeste..."
ignition.config.5 = nabled":false,"mask":true,"name":"do..."
ignition.config.6 = service\n\n[Service]\nExecStart=/usr..."
ignition.config.0 = {"ignition":{"config":{"replace":{"v..."
ignition.config.1 = default.target.wants","user":{"name"..."
ignition.config.2 = "user":{"name":"root"},"contents":{"..."

Configuring Secure Boot

If you configure a Generation 2 virtual machine, Fedora CoreOS will not successfully boot until you change the Secure Boot template to Microsoft UEFI Certificate Authority. You can do this in the Security tab of the virtual machine’s Settings dialog:

Virtual machine Secure Boot settings