Day 1: miniONE
Goal: Install OpenNebula with a single command, set up the CLI, start the first VM, and look around in Sunstone. · Duration: approx. 60 min · Prerequisite: Day 0
Briefing
- miniONE is the official installation script for a single-machine installation. It installs the front-end and KVM host, sets up a bridge with NAT, and downloads a small Alpine Linux from the Marketplace. It is meant for testing and learning, not for production.
- What miniONE builds:
| Part | What |
|---|---|
oned |
the core: manages all objects, talks to drivers, holds the database |
| MariaDB | database of oned |
| Sunstone (FireEdge) | web UI on port 80 |
| OneFlow, OneGate | services for multi-VM services (Day 9) and for feedback from VMs (Day 11) |
Host localhost |
the KVM hypervisor on which the VMs run |
Bridge minionebr |
private network 192.168.150.0/24 with NAT to the internet |
- The administrator is called
oneadmin. OpenNebula runs under this name, and it is the first user with all permissions.
Drill 1: Installation
cd ~/one-lab
curl -fsSLO https://github.com/OpenNebula/minione/releases/download/v7.4.2/minione
sudo bash minione --yes --password lab-one-pass-123 \
--ssh-pubkey ~/.ssh/id_ed25519.pub \
--vnet-address 192.168.150.0 --vnet-gateway 192.168.150.1 \
--vnet-ar-ip-start 192.168.150.2 --vnet-ar-ip-count 50| Option | Purpose |
|---|---|
--yes |
do not ask |
--password |
password for oneadmin, a pure lab value |
--ssh-pubkey |
this key ends up in every VM |
--vnet-* |
the private network of the VMs. The default 172.16.100.0/24 collides with existing 172.16 networks in many home networks; 192.168.150.0/24 is less commonly used. |
This takes five to ten minutes. Expected (shortened):
### Checks & detection
Checking augeas is installed SKIP will try to install
...
### Main deployment steps:
Install OpenNebula frontend version 7.4
Install and configure MariaDB (MySQL backend)
Configure bridge minionebr with IP 192.168.150.1/24
Enable NAT over eth0
...
### Installation
...
Installing OpenNebula packages OK
Installing OpenNebula kvm node packages OK
...
### Configuration
...
Creating kvm host OK
Creating virtual network OK
Exporting [Alpine Linux 3.20] from Marketplace to local datastore OK
...
### Report
OpenNebula 7.4 was installed
Database backend: MySQL (MariaDB), database 'opennebula'
Sunstone is running on:
http://<VM-IP>/
Use following to login:
user: oneadmin
password: lab-one-pass-123
Save your progress? Sign up for free
Drill 2: A DNS stumbling block
The VMs get their addresses and name resolution from dnsmasq on the bridge. On Ubuntu 24.04, however, after miniONE dnsmasq lacks a server to forward queries to:
nslookup dl-cdn.alpinelinux.org 192.168.150.1Expected (shortened):
** server can't find dl-cdn.alpinelinux.org: REFUSED
dnsmasq looks for its upstream servers in a file that the
resolvconf package would create. Ubuntu uses
systemd-resolved instead, so the file stays empty. One line tells
dnsmasq to use the regular /etc/resolv.conf:
echo "IGNORE_RESOLVCONF=yes" | sudo tee -a /etc/default/dnsmasq
sudo systemctl restart dnsmasq
nslookup dl-cdn.alpinelinux.org 192.168.150.1 | tail -3Expected (the address will differ):
IGNORE_RESOLVCONF=yes
Name: dualstack.j.sni.global.fastly.net
Address: 2a04:4e42:600::644
Without this fix, the VMs can reach the internet but cannot find any
machine by name. Package installations inside the VMs then fail with
temporary error.
Save your progress? Sign up for free
Drill 3: The CLI
The CLI commands are all called one…:
onevm, onetemplate, oneimage, and
so on. They read the user and password from
~/.one/one_auth:
mkdir -p ~/.one
echo "oneadmin:lab-one-pass-123" > ~/.one/one_auth
chmod 600 ~/.one/one_auth
onehost listExpected:
ID NAME CLUSTER TVM ALLOCATED_CPU ALLOCATED_MEM STAT
0 localhost default 0 0 / 200 (0%) 0K / 3.8G (0%) on
TVMis the number of running VMs.200stands for two CPU cores. OpenNebula counts in hundredths of a core.STAT onmeans: the host is monitored and accepts VMs.
Without one_auth, every command ends with
ONE_AUTH file not present.
onetemplate listExpected (the time will differ):
ID USER GROUP NAME REGTIME
1 oneadmin oneadmin Alpine Linux 3. 11/12 18:45:16
0 oneadmin oneadmin OneKS Appliance 11/12 18:45:13
Two templates. The first is Alpine. The second, “OneKS Appliance”, builds an entire Kubernetes cluster and needs far more than 4 GB. For this book, you leave it alone.
Save your progress? Sign up for free
Drill 4: The first VM
onetemplate instantiate 1 --name ersteExpected:
VM ID: 3
Your ID may differ. From now on, you address the VM by its name:
onevm listExpected (first boot, after a few seconds
runn):
ID USER GROUP NAME STAT CPU MEM HOST TIME
3 oneadmin oneadmin erste runn 1 256M localhost 0d 00h00
onevm show erste | grep -E '^STATE|^LCM_STATE|ETH0_IP='Expected (the IP will differ):
STATE : ACTIVE
LCM_STATE : RUNNING
ETH0_IP="192.168.150.5",
OpenNebula has two states: STATE is the coarse state
(PENDING, ACTIVE, POWEROFF …),
LCM_STATE is the step in the lifecycle while the VM is
ACTIVE.
And now log in, with your key from Day 0. First, a convenience for
the lab: VMs come and go, and tomorrow an IP belongs to another VM with
a different host key. SSH would then raise an alarm every time. For the
lab networks, you turn off the check and set root as the
user:
cat >> ~/.ssh/config <<'EOF'
Host 192.168.150.* 10.10.10.*
User root
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel ERROR
EOF
chmod 600 ~/.ssh/configThis only applies to these two address ranges. Outside the lab, you always verify host keys.
ssh [email protected] cat /etc/alpine-releaseExpected:
3.20.10
Save your progress? Sign up for free
Drill 5: Sunstone
Open http://<VM-IP>/ in your browser. The address
redirects to /fireedge/sunstone. Log in as
oneadmin with lab-one-pass-123.
- On the left in the menu, Instances → VMs: there you
see
erste, with state and IP. - Clicking the VM and then the screen icon opens the VNC console. That is the way into a VM when SSH does not work.
- Infrastructure → Hosts shows
localhostwith its utilization.
Everything Sunstone shows and does also works with the CLI. This book mostly uses the CLI, because commands are easier to type and verify than clicks.
Save your progress? Sign up for free
Checkpoint
onehost listExpected: localhost with STAT
on.
onevm listExpected: the VM erste with STAT
runn.
ssh root@$(onevm show erste | grep -o 'ETH0_IP="[0-9.]*' | cut -d'"' -f2) hostnameExpected: output without errors. The grep extracts the
IP from onevm show, so you do not have to type it.
Challenge
Which states did erste go through before it was running?
Find out without Sunstone.
Note: Every VM has a log file under
/var/log/one/, named after its ID.
Solution
sudo grep 'New .*state' /var/log/one/3.logExpected (times will differ, shortened):
… [Z0][VM][I]: New state is ACTIVE
… [Z0][VM][I]: New LCM state is PROLOG
… [Z0][VM][I]: New LCM state is BOOT
… [Z0][VM][I]: New LCM state is RUNNING
| State | What happens |
|---|---|
PENDING (before ACTIVE) |
The scheduler looks for a host. |
PROLOG |
The disks are copied to the system datastore (Day 3). |
BOOT |
libvirt starts the VM. |
RUNNING |
The VM is running. |
You no longer need the VM:
onevm terminate ersteSave your progress? Sign up for free
Enterprise Note
- Installation in production: Instead of miniONE, you
install the packages from the OpenNebula repository or use the
one-deployAnsible roles. They also set up multiple hosts, shared storage, and a highly available front-end. - Credentials:
one_authwith a plaintext password is convenient for the lab. In production, admins use login tokens (oneuser token-create) with an expiration time, and Sunstone is connected to LDAP or SAML. - Community and Enterprise: The Community Edition is
free. The Enterprise Edition brings maintenance releases and support.
miniONE can install both (
--enterprise).