Aprovisionamiento de Fedora CoreOS sobre OpenStack

Este guía muestra como aprovisionar los nuevos nodos Fedora CoreOS (FCOS) sobre un entorno en la nube OpenStack, tanto privado como público (como VEXXHOST).

Los pasos de abajo están probados con la versión OpenStack Victoria.

Requisitos previos

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

Fedora CoreOS tiene un usuario core predeterminado que puede ser usado para explorar el SO. Si usted desea utilizarlo finalice su configuración proporcionando una clave SSH.

Si no desea usar Ignition para empezar, puede usar Soporte Afterburn.

También necesita tener acceso a un entorno OpenStack y una marcha openstack CLI. Normalmente,usted configurará el cliente usando un archivo clouds.yaml o por medio de variables de entorno. Si está comenzando desde cero, este entorno puede necesitar ajustes de redes, pares de claves SSH, grupos de seguridad, etc…​ Por favor consulte Documentación OpenStack par aprender más.

Downloading an OpenStack Image

Fedora CoreOS is designed to be updated automatically, with different schedules per stream. Once you have picked the relevant stream, download, verify, and decompress the latest OpenStack image:

For more information on FCOS stream offerings see Update Streams.
STREAM='stable'
coreos-installer download --decompress -s $STREAM -p openstack -f qcow2.xz

Alternatively, you can manually download an OpenStack image from the download page. Verify the download, following the instructions on that page, and decompress it.

Uploading the Image to OpenStack

Create the FCOS image in OpenStack
FILE=fedora-coreos-XX.XXXXXXXX.X.X-openstack.x86_64.qcow2
IMAGE=${FILE:0:-6} # pull off .qcow2
openstack image create --disk-format=qcow2 --min-disk=10 --min-ram=2 --progress --file=$FILE $IMAGE
If you’re uploading an aarch64 disk image then add --property architecture=aarch64.
Monitor image creation progress by listing the image
openstack image list --name=$IMAGE

Once the image is listed as active, it’s ready to be used.

Lanzar una instancia de Máquina Virtual

Now that you have an image created in your account you can launch a VM instance. You’ll have to specify several pieces of information in the command, such as instance flavor, network information, SSH key, etc…​

You’ll also need the Ignition config you created earlier. Here it is represented in the example command as ./example.ign, which indicates a file in the current directory named example.ign.

Lanzar una instancia de Máquina Virtual
OPENSTACK_NETWORK=private
OPENSTACK_KEYPAIR=mykeypair # optional
OPENSTACK_FLAVOR=v1-standard-2
INSTANCE_NAME=myinstance # choose a name
openstack server create            \
     --key-name=$OPENSTACK_KEYPAIR \
     --network=$OPENSTACK_NETWORK  \
     --flavor=$OPENSTACK_FLAVOR    \
     --image=$IMAGE                \
     --user-data ./example.ign     \
     $INSTANCE_NAME
Specifying --key-name is optional if you provide an SSH key in your Ignition config.
Monitor progress of the instance creation with openstack server show $INSTANCE_NAME. You can also use the --wait parameter when calling openstack server create to block until the instance is active.

Next, if the instance’s network isn’t externally facing and you’d like to SSH into it from outside the OpenStack environment, you will have to assign a public IP to the instance:

Create and Assign a Floating IP
OPENSTACK_NETWORK=public
openstack floating ip create $OPENSTACK_NETWORK

FLOATING_IP=1.1.1.1  # from just created floating IP
openstack server add floating ip $INSTANCE_NAME $FLOATING_IP

You now should be able to SSH into the instance using the floating IP address.

Ejemplo de conexión
ssh core@<ip address>