> ## Documentation Index
> Fetch the complete documentation index at: https://siderolabs-fe86397c-config-evolution.mintlify.site/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-config-evolution/4b_4mgwF04BqZgyi/omni/omni-cluster-setup/images/create-a-machine-class-delete-icon-red.png?fit=max&auto=format&n=4b_4mgwF04BqZgyi&q=85&s=e65e8d541599c6ece4aceff88033f052" 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-config-evolution/4b_4mgwF04BqZgyi/omni/omni-cluster-setup/images/create-a-machine-class-amd64-red.png?fit=max&auto=format&n=4b_4mgwF04BqZgyi&q=85&s=5d1aa38b30ca2c1434304fdf982ba33b" 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-config-evolution/4b_4mgwF04BqZgyi/omni/omni-cluster-setup/images/create-a-machine-class-plus-icon-red.png?fit=max&auto=format&n=4b_4mgwF04BqZgyi&q=85&s=1f17375f191a1c67f6a5ead98bb15b85" 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-config-evolution/4b_4mgwF04BqZgyi/omni/omni-cluster-setup/images/create-a-machine-class-conditions-red.png?fit=max&auto=format&n=4b_4mgwF04BqZgyi&q=85&s=0f80149f0570bb1ca4926d937d03271b" 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>
