Compare commits

...

4 Commits

7 changed files with 442 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -0,0 +1,249 @@
# CloneEngine Module
## Introduction
CloneEngine is the component responsible for executing cloning, partitioning, creation, and restoration operations of images on clients registered in OpenGnsys. It acts as an execution engine that receives instructions from the web interface and translates them into commands that are executed on client computers.
It does not have its own visual interface, but operates transparently as a backend for management modules. Among its main functionalities are:
- Disk and partition preparation.
- Image creation and restoration.
- Boot configuration (BIOS/UEFI).
- Cache and inventory management.
- Execution of custom scripts.
These operations are executed in real-time or in a scheduled manner, and their results are reported through the web interface.
## Disk and Partition Management
### Introduction to partitioning in OpenGnsys
Disk partitioning is one of the most delicate operations that the administrator can execute from the OpenGnsys web console. Its correct definition is essential to ensure compatibility with the images to be restored and guarantee that operating systems can boot properly.
The web interface allows you to remotely define the partition table of one or several disks of registered clients, using the visual partitioning wizard. Internally, the CloneEngine motor is responsible for applying this structure on the client, removing previous content and creating new partitions with the defined sizes and types.
!!! warning "Warning"
Incorrect partitioning can render the client system inoperative, delete existing systems, or prevent restorations due to type or size incompatibilities.
### Previous considerations
Before defining a partition table, it is recommended to consider:
- **Disk size**: verify that the total detected space is usable. It is recommended to test first on a model computer.
- **Environment (classroom or computer group)**: maintaining homogeneous partitioning structures facilitates maintenance.
- **Operating systems to restore**: ensure that the size and partition type is compatible with the corresponding image.
- **CACHE partition size**: dimension correctly if you want to use it as an intermediate container or for ogLive.
- **Partition table type**: the wizard automatically detects if it is MSDOS (BIOS) or GPT (UEFI) type, but its recreation can be forced.
- **Previous partitioning**: old structures or those created with external software may interfere. It is always recommended to test on a model.
- Partition types and file systems:
The interface allows you to configure for each partition:
- Partition type (e.g., LINUX, WINDOWS, CACHE, EMPTY, EXTENDED, etc.).
- File system type (e.g., EXT4, NTFS, CACHE, etc.).
- Size in MB or percentage.
- Format option.
Compatibility summary table
| Partition type | Allowed file systems | Description |
|------------------------|-----------------------------------------|----------------------------------------------------------|
| EMPTY | EMPTY | Reserved space with no defined use |
| CACHE | CACHE | Used as intermediate container by OpenGnsys |
| LINUX | EXT4, BTRFS, XFS, ... | For GNU/Linux systems |
| WINDOWS | NTFS, FAT32, HFAT32, ... | For Windows systems |
| LINUX-SWAP | LINUX-SWAP | Linux swap area |
| EXTENDED | | BIOS only, allows adding more logical partitions (not implemented)|
| FREEBSD, SOLARIS, … | Corresponding native systems | For alternative systems (not common) |
!!! note "Note"
The system identifies CACHE partition as such, but internally uses an EXT4 file system with specific configuration.
### The CACHE partition
The CACHE partition is a special type of partition managed by OpenGnsys, which offers several essential functionalities for system efficiency:
- Intermediate image container:
Allows saving operating system images locally, reducing time in subsequent restorations. It also acts as a buffer in Torrent-type transfers.
- Auxiliary container for ogLive:
During PXE boot with ogLiveAdmin, the system can copy the kernel and initrd to this partition to reduce server dependency and improve boot times.
!!! warning "Warning"
If the CACHE partition is formatted, images and ogLive temporary data are lost. It will be necessary to restart from ogLiveAdmin to regenerate them.
### Rules and recommendations
- Only one CACHE partition should exist per computer.
- In MSDOS partitions it must be in position 4 and be primary.
- In GPT partitions it can occupy any order, but its identifier will be the fourth.
- The minimum recommended size is 1.5 GB if it will only be used for ogLive.
If you want to store images, dimension according to the estimated number and size of these.
### Accessing the wizard
To access the partitioning wizard:
- Go to the Groups section from the side menu.
- Select an Organizational Unit.
- Click the ⋮ button on any client.
- In the dropdown menu, select the Partition and Format option.
This will open the wizard in a new view.
![oggui-cloneengine-particionar-acceso.png.png](../assets/images/screenshots/oggui-cloneengine-particionar-acceso.png)
### Form structure
The wizard is divided into three main blocks:
- Selected clients
At the top, the client (or group of clients) where the partition table will be applied is shown.
- Design of the new partition table
Here the disk structure is defined:
- Available disk and its size.
- Firmware type (BIOS/UEFI).
- Partition table type: automatically detected (MSDOS or GPT).
- Editable partition list: type, file system, size (MB or %), and format option.
- Graphical disk distribution:
On the right, a circular graph is shown with the total, free, and used space according to the current configuration.
![oggui-cloneengine-particionar.png](../assets/images/screenshots/oggui-cloneengine-particionar.png)
### Partition table design
The following details the steps to design a partition table:
1. Select computers
In case you have selected several computers in the previous window when selecting Partition, these computers will appear in the upper dropdown. Clicking on a computer you can select or deselect in case you don't want to apply the partitioning command on a specific computer. The **Model** checkbox indicates that the selected computer will be used as a partitioning model and will load its partition table to the view dynamically. You can select a computer as Model and deselect it in case you don't want to partition it again but want to apply its partitioning configuration to the rest of the machines.
![oggui-cloneengine-particionar.png](../assets/images/screenshots/oggui-cloneengine-particionar.png)
1. Select disk
In the upper left dropdown, choose the disk to partition (example: Disk 1 (80.00 GB)).
2. Firmware type and partition table
- Firmware: indicates if the computer is in BIOS or UEFI mode.
- Partition table: can be MSDOS or GPT, and is automatically assigned according to the firmware.
3. Add partitions
- Click the Add partition button if you are using GPT table.
4. For each partition:
- Define the partition type (e.g., LINUX, CACHE, WINDOWS, etc.).
- Select the file system (e.g., EXT4, NTFS, etc.).
- Enter the size, in MB or percentage.
- Format: if you want to format the partition after its creation.
5. Disk usage graph
- Make sure the free space is not negative.
- Leave free margin (recommended ≥ 1 GB) on large disks to avoid precision failures during the process.
![oggui-cloneengine-particionar-estructura.png](../assets/images/screenshots/oggui-cloneengine-particionar-estructura.png)
!!! note "Note"
In systems with MSDOS partition table, the maximum number of primary partitions is four. In GPT there is no such limit, but the identification of the CACHE partition as the fourth must be respected.
Execution options
Once the disk structure is defined, you can:
- Execute the command directly on the computer.
- Generate instructions to apply them later (in a scheduled manner).
- Access advanced scheduling options if you want to include it in an action queue.
In case instructions are generated, these are shown in an editable block that can be reviewed before execution.
![oggui-cloneengine-particionar-generar-instruccion.png](../assets/images/screenshots/oggui-cloneengine-particionar-generar-instruccion.png)
# Cloning Engine
The Cloning Engine is a fundamental component that manages the complete image cloning process in our system. This component integrates several critical procedures that are described below.
It manages the complete lifecycle of images, from their creation to their deployment in production environments. This system automates complex tasks and guarantees consistency across all environments.
## Main Procedures
### Image Creation
For the detailed image creation procedure, consult the specific documentation:
[Create Image](DocumentacionCrearImage.md)
### Image Deployment
Image deployment follows a standardized protocol that ensures system integrity:
[Deploy Image](DocumentacionDeployImage.md)
## Integrated Workflow
The complete cloning process follows these steps:
1. Engine initialization
1. Dependency verification
2. Configuration loading
3. Permission validation
2. Image creation (see [detailed documentation](DocumentacionCrearImage.md))
1. Base template selection
2. Parameter configuration
3. Image generation
3. Integrity validation
1. Checksum verification
2. Automated testing
3. Manual approval (if necessary)
4. Image deployment (see [detailed documentation](DocumentacionDeployImage.md))
1. Target environment selection
2. Deployment sequence
3. Post-deployment verification
## Troubleshooting
To resolve common problems during the cloning process, consult:
- [Create Image - Troubleshooting](DocumentacionCrearImage.md#troubleshooting)
- [Deploy Image - Troubleshooting](DocumentacionDeployImage.md#troubleshooting)
## Additional References
For additional information about the Cloning Engine, consult:
- System administration guide
- Cloning API documentation
- Change logs and updates

View File

@ -1,3 +1,196 @@
# Módulo CloneEngine
## Introducción
CloneEngine es el componente encargado de ejecutar las operaciones de clonado, particionado, creación y restauración de imágenes en los clientes registrados en OpenGnsys. Actúa como un motor de ejecución que recibe instrucciones desde la interfaz web y las traduce en comandos que se ejecutan en los equipos cliente.
No cuenta con interfaz visual propia, sino que opera de forma transparente como backend de los módulos de gestión. Entre sus funcionalidades principales se incluyen:
- Preparación de discos y particiones.
- Creación y restauración de imágenes.
- Configuración del arranque (BIOS/UEFI).
- Gestión de caché e inventario.
- Ejecución de scripts personalizados.
Estas operaciones son ejecutadas en tiempo real o de forma programada, y su resultado es reportado a través de la interfaz web.
## Gestión de Discos y Particiones
### Introducción al particionado en OpenGnsys
El particionado de discos es una de las operaciones más delicadas que puede ejecutar el administrador desde la consola web de OpenGnsys. Su correcta definición es esencial para asegurar la compatibilidad con las imágenes a restaurar y garantizar que los sistemas operativos puedan arrancar adecuadamente.
La interfaz web permite definir de forma remota la tabla de particiones de uno o varios discos de los clientes registrados, usando el asistente visual de particionado. Internamente, el motor CloneEngine se encarga de aplicar esta estructura en el cliente, eliminando el contenido previo y creando las nuevas particiones con los tamaños y tipos definidos.
!!! warning "Advertencia"
Un particionado incorrecto puede dejar inoperativo el sistema del cliente, eliminar sistemas existentes o impedir restauraciones debido a incompatibilidades de tipo o tamaño.
### Consideraciones previas
Antes de definir una tabla de particiones se recomienda tener en cuenta:
- **Tamaño del disco**: comprobar que el espacio total detectado es utilizable. Se recomienda probar primero sobre un equipo modelo.
- **Entorno (aula o grupo de ordenadores)**: mantener estructuras de particionado homogéneas facilita el mantenimiento.
- **Sistemas operativos a restaurar**: asegurar que el tamaño y tipo de partición es compatible con la imagen correspondiente.
- **Tamaño de la partición CACHE**: dimensionar correctamente si se desea usar como contenedor intermedio o para ogLive.
- **Tipo de tabla de particiones**: el asistente detecta automáticamente si es de tipo MSDOS (BIOS) o GPT (UEFI), pero se puede forzar su recreación.
- **Particionado previo**: estructuras antiguas o creadas con software externo pueden interferir. Se recomienda probar siempre en un modelo.
- Tipos de partición y sistemas de archivos:
La interfaz permite configurar para cada partición:
- Tipo de partición (ej. LINUX, WINDOWS, CACHE, EMPTY, EXTENDED, etc.).
- Tipo de sistema de archivos (ej. EXT4, NTFS, CACHE, etc.).
- Tamaño en MB o porcentaje.
- Opción de formateo.
Tabla resumen de compatibilidad
| Tipo de partición | Sistemas de archivos permitidos | Descripción |
|------------------------|-----------------------------------------|----------------------------------------------------------|
| EMPTY | EMPTY | Espacio reservado sin uso definido |
| CACHE | CACHE | Usada como contenedor intermedio por OpenGnsys |
| LINUX | EXT4, BTRFS, XFS, ... | Para sistemas GNU/Linux |
| WINDOWS | NTFS, FAT32, HFAT32, ... | Para sistemas Windows |
| LINUX-SWAP | LINUX-SWAP | Área de intercambio de Linux |
| EXTENDED | | Solo para BIOS, permite añadir más particiones lógicas (no implementado)|
| FREEBSD, SOLARIS, … | Sistemas nativos correspondientes | Para sistemas alternativos (no habituales) |
!!! note "Nota"
El sistema identifica partición CACHE como tal, pero internamente utiliza un sistema de archivos EXT4 con configuración específica.
### La partición CACHE
La partición CACHE es un tipo especial de partición gestionada por OpenGnsys, que ofrece varias funcionalidades esenciales para la eficiencia del sistema:
- Contenedor intermedio de imágenes:
Permite guardar imágenes de sistema operativo localmente, reduciendo el tiempo en restauraciones posteriores. También actúa como búfer en transferencias tipo Torrent.
- Contenedor auxiliar de ogLive:
Durante el arranque PXE con ogLiveAdmin, el sistema puede copiar el kernel e initrd a esta partición para reducir la dependencia del servidor y mejorar los tiempos de arranque.
!!! warning "Advertencia"
Si la partición CACHE se formatea, se pierden las imágenes y los datos temporales de ogLive. Será necesario reiniciar desde ogLiveAdmin para regenerarlos.
### Reglas y recomendaciones
- Solo debe existir una partición CACHE por equipo.
- En particiones MSDOS debe estar en la posición 4 y ser primaria.
- En particiones GPT puede ocupar cualquier orden, pero su identificador será el cuarto.
- El tamaño mínimo recomendado es de 1.5 GB si solo se va a usar para ogLive.
Si se desea almacenar imágenes, dimensionar según el número y tamaño estimado de estas.
### Acceso al asistente
Para acceder al asistente de particionado:
- Ve al apartado Grupos desde el menú lateral.
- Selecciona una Unidad Organizativa.
- Haz clic en el botón ⋮ de cualquier cliente.
- En el menú desplegable, selecciona la opción Particionar y Formatear.
Esto abrirá el asistente en una nueva vista.
![oggui-cloneengine-particionar-acceso.png.png](../assets/images/screenshots/oggui-cloneengine-particionar-acceso.png)
### Estructura del formulario
El asistente está dividido en tres bloques principales:
- Clientes seleccionados
En la parte superior, se muestra el cliente (o grupo de clientes) donde se aplicará la tabla de particiones.
- Diseño de la nueva tabla de particiones
Aquí se define la estructura del disco:
- Disco disponible y su tamaño.
- Tipo de firmware (BIOS/UEFI).
- Tipo de tabla de particiones: detectada automáticamente (MSDOS o GPT).
- Listado editable de particiones: tipo, sistema de archivos, tamaño (MB o %), y opción de formateo.
- Distribución gráfica del disco:
A la derecha, se muestra un gráfico circular con el espacio total, libre y utilizado según la configuración actual.
![oggui-cloneengine-particionar.png](../assets/images/screenshots/oggui-cloneengine-particionar.png)
### Diseño de la tabla de particiones
A continuación, se detallan los pasos para diseñar una tabla de particiones:
1. Seleccionar equipos
En caso de que has seleccionado varios equipos en la ventana previa al seleccionar Particionar estos equipos aparecerán en el desplegable superior. Pulsando un equipo podrás seleccionar o deseleccionar en caso de que no quieras aplicar el comando de particionado sobre un equipo en concreto. El checkbox de **Modelo** indica que ese ordenador seleccionado será usado como modelo de particionado y cargará su tabla de particiones a la vista de forma dinámica. Puedes seleccionar un ordenador como Modelo y deseleccionarlo en caso de que no quieras volver a particionarlo pero quieras aplicar su configuración de particionado al resto de las máquina.
![oggui-cloneengine-particionar.png](../assets/images/screenshots/oggui-cloneengine-particionar.png)
1. Seleccionar disco
En el desplegable superior izquierdo, elige el disco a particionar (ejemplo: Disco 1 (80.00 GB)).
2. Tipo de firmware y tabla de particiones
- Firmware: indica si el equipo está en modo BIOS o UEFI.
- Tabla de particiones: puede ser MSDOS o GPT, y se asigna automáticamente según el firmware.
3. Añadir particiones
- Pulsa el botón Añadir partición si estás usando tabla GPT.
4. Para cada partición:
- Define el tipo de partición (ej. LINUX, CACHE, WINDOWS, etc.).
- Selecciona el sistema de ficheros (ej. EXT4, NTFS, etc.).
- Introduce el tamaño, en MB o en porcentaje.
- Formateo: si deseas formatear la partición tras su creación.
5. Gráfico de uso del disco
- Asegúrate de que el espacio libre no sea negativo.
- Dejar margen libre (recomendado ≥ 1 GB) en discos grandes para evitar fallos de precisión durante el proceso.
![oggui-cloneengine-particionar-estructura.png](../assets/images/screenshots/oggui-cloneengine-particionar-estructura.png)
!!! note "Nota"
En sistemas con tabla de particiones MSDOS, el número máximo de particiones primarias es cuatro. En GPT no hay este límite, pero sí debe respetarse la identificación de la partición CACHE como la cuarta.
Opciones de ejecución
Una vez definida la estructura del disco, puedes:
- Ejecutar la orden directamente sobre el equipo.
- Generar instrucciones para aplicarlas más tarde (de forma programada).
- Acceder a opciones avanzadas de programación si se desea incluir en una cola de acciones.
En el caso de que se generen instrucciones, estas se muestran en un bloque editable que puede ser revisado antes de su ejecución.
![oggui-cloneengine-particionar-generar-instruccion.png](../assets/images/screenshots/oggui-cloneengine-particionar-generar-instruccion.png)
# Motor de Clonación
El Motor de Clonación es un componente fundamental que gestiona el proceso completo de clonación de imágenes en nuestro sistema. Este componente integra varios procedimientos críticos que se describen a continuación.