How to create an OpenNebula cluster

OpenNebula clusters group compatible hosts, datastores, and virtual networks so the scheduler can place VMs only on resources that work together. A named cluster is useful when different hardware generations, storage backends, or network fabrics should stay separated instead of sharing one capacity pool.

The CLI path uses onecluster to create the logical object and attach existing resources. Hosts belong to one cluster at a time, while datastores and virtual networks can belong to more than one cluster when their drivers and physical connectivity are available to every host that may use them.

Use an OpenNebula front-end shell with infrastructure administration privileges, commonly the oneadmin account. Resource names such as host01, system, and priv-ovswitch represent existing objects in the cloud; substitute names that match the prepared compute node, system datastore, and virtual network.

Steps to create an OpenNebula cluster:

  1. List the current clusters to choose an unused name.
    $ onecluster list
      ID NAME            HOSTS NETS  DATASTORES
  2. Create the cluster.
    $ onecluster create production
    ID: 100
  3. Inspect the new cluster before assigning resources.
    $ onecluster show production
    CLUSTER 100 INFORMATION
    ID             : 100
    NAME           : production
    
    HOSTS
    
    VNETS
    
    DATASTORES
  4. Add a prepared host to the cluster.
    $ onecluster addhost production host01

    A host can belong to only one cluster. Moving an active host changes where the scheduler can place workloads that need that host's resources.

  5. Add the virtual network that cluster VMs should use.
    $ onecluster addvnet production priv-ovswitch

    The network backing must exist on the hosts that will run VMs attached to this virtual network.

  6. Add a system datastore to the cluster.
    $ onecluster adddatastore production system

    An OpenNebula cluster needs at least one system datastore before the scheduler can deploy VMs into it. Use the default system datastore or a datastore created for the same storage driver and host layout.

  7. Check the cluster summary counts.
    $ onecluster list
      ID NAME            HOSTS NETS  DATASTORES
     100 production      1     1     1
  8. Verify the final cluster membership.
    $ onecluster show production
    CLUSTER 100 INFORMATION
    ID             : 100
    NAME           : production
    
    HOSTS
    0
    
    VNETS
    1
    
    DATASTORES
    0

    The ID lists should match the host, virtual network, and datastore assigned in the earlier steps.