> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siderolabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Machine Class

> Define a reusable group of machines based on labels and conditions for automated cluster allocation.

A machine class is a reusable group of machines defined by labels and conditions. It allows you to match machines based on criteria like architecture and core count (e.g., `amd64` architecture with more than 2 cores).

Machine classes are used for automated cluster allocation, instead of selecting individual machines, you reference a machine class, and Omni picks matching machines automatically.

You can create a machine class them via the CLI with `omnictl apply` or through the UI under the **Machine Classes** section.

<Tabs>
  <Tab title="CLI">
    This example creates a machine class named test using the CLI.

    It selects machines that meet both of the following conditions:

    * `omni.sidero.dev/arch = amd64` — The machine must use an amd64 (x86\_64) architecture
    * `omni.sidero.dev/cores > 2` — The machine must have more than 2 cores

    ```yaml theme={null}
    metadata:
      namespace: default
      type: MachineClasses.omni.sidero.dev
      id: test
    spec:
      matchlabels:
        # matches machines with amd64 architecture and more than 2 cores
        - omni.sidero.dev/arch = amd64, omni.sidero.dev/cores > 2
    ```

    Apply the configuration with:

    ```bash theme={null}
    omnictl apply -f machine-class.yaml
    ```
  </Tab>

  <Tab title="UI">
    1. Click **Machine Classes** in the left sidebar.
    2. Click **Create Machine Class**.
    3. Add match conditions by typing them into the input box, or click a label
       in the machine list to add it automatically.

    <img src="https://mintcdn.com/siderolabs-fe86397c/-KU7Qw6wWBNnp9sZ/omni/omni-cluster-setup/images/create-a-machine-class-delete-icon-red.png?fit=max&auto=format&n=-KU7Qw6wWBNnp9sZ&q=85&s=9996527a8d459f88837517239cd280be" alt="" width="3693" height="1876" data-path="omni/omni-cluster-setup/images/create-a-machine-class-delete-icon-red.png" />

    <img src="https://mintcdn.com/siderolabs-fe86397c/-KU7Qw6wWBNnp9sZ/omni/omni-cluster-setup/images/create-a-machine-class-amd64-red.png?fit=max&auto=format&n=-KU7Qw6wWBNnp9sZ&q=85&s=83724f553e3565769633f598c5962d3b" alt="" width="3693" height="1876" data-path="omni/omni-cluster-setup/images/create-a-machine-class-amd64-red.png" />

    4. To match machines using additional condition blocks joined by `OR`, click **+**.

    <img src="https://mintcdn.com/siderolabs-fe86397c/-KU7Qw6wWBNnp9sZ/omni/omni-cluster-setup/images/create-a-machine-class-plus-icon-red.png?fit=max&auto=format&n=-KU7Qw6wWBNnp9sZ&q=85&s=9d9885d64fdbc6aa5df6b37f6ff8be16" alt="" width="3697" height="1879" data-path="omni/omni-cluster-setup/images/create-a-machine-class-plus-icon-red.png" />

    <img src="https://mintcdn.com/siderolabs-fe86397c/-KU7Qw6wWBNnp9sZ/omni/omni-cluster-setup/images/create-a-machine-class-conditions-red.png?fit=max&auto=format&n=-KU7Qw6wWBNnp9sZ&q=85&s=fd3cb4eb5360ac605ca4a2b06216fde2" alt="" width="3696" height="1879" data-path="omni/omni-cluster-setup/images/create-a-machine-class-conditions-red.png" />

    5. Give the machine class a name, then click **Create Machine Class**.
  </Tab>
</Tabs>
