Operations¶
Scope
Production deployment patterns, operational procedures, performance tuning, and troubleshooting for OpenNebula.
Deployment¶
Frontend Installation¶
# Install OpenNebula frontend (Debian/Ubuntu)
apt-get install opennebula opennebula-sunstone opennebula-fireedge
# Start services
systemctl start opennebula opennebula-sunstone opennebula-fireedge
# Default admin access
cat /var/lib/one/.one/one_auth # oneadmin:password
KVM Node Setup¶
# Install on compute nodes
apt-get install opennebula-node-kvm
# Add node to cluster
onehost create node1 -i kvm -v kvm
VM Management¶
# Create VM from template
onetemplate instantiate mytemplate --name myvm
# VM lifecycle
onevm resume <id>
onevm suspend <id>
onevm poweroff <id>
onevm shutdown <id>
# Live migration
onevm migrate <id> <target_host> --live
Monitoring¶
# Check host status
onehost list
onehost show <id>
# Check VM status
onevm list
onevm show <id>
# Cluster monitoring
onecluster list
Common Issues¶
| Issue | Diagnosis | Fix |
|---|---|---|
| VM stuck in PENDING | onevm show <id> |
Check host capacity, scheduler |
| Migration fails | Check libvirt connectivity | Verify SSH keys between hosts |
| Sunstone login fails | Check sunstone.log | Restart sunstone service |
| Storage full | onedatastore list |
Clean up images, add storage |
Commands & Recipes¶
VM Lifecycle¶
# Create VM from template
onevm create --name myvm --template "My Template"
# List VMs
onevm list
# Show VM details
onevm show myvm
# Suspend / Resume
onevm suspend myvm
onevm resume myvm
# Live migrate
onevm migrate --live myvm target-host
# Snapshot
onevm disk-snapshot-create myvm 0 snap-01
# Terminate
onevm terminate myvm
Template Management¶
# Create template
onetemplate create <<EOF
NAME = "ubuntu-24"
CPU = 2
VCPU = 2
MEMORY = 4096
DISK = [
IMAGE = "Ubuntu 24.04",
SIZE = 20480
]
NIC = [
NETWORK = "Private"
]
CONTEXT = [
SSH_PUBLIC_KEY = "\$USER[SSH_PUBLIC_KEY]",
NETWORK = "YES"
]
EOF
# List templates
onetemplate list
onetemplate instantiate "ubuntu-24"
Host Management¶
# Add host
onehost create kvm-host-01 --im kvm --vm kvm
# List hosts with status
onehost list
# Enable / Disable (maintenance)
onehost disable kvm-host-01
onehost enable kvm-host-01
# Monitor host resources
onehost monitoring kvm-host-01
Networking¶
# Create virtual network
onevnet create <<EOF
NAME = "Private"
VN_MAD = "bridge"
BRIDGE = "br0"
AR = [
TYPE = "IP4",
IP = "10.0.0.100",
SIZE = "100"
]
EOF
# List networks
onevnet list
# Reserve IP range
onevnet addar Private --ip 10.0.0.200 --size 10
Storage¶
# Create datastore (Ceph)
onedatastore create <<EOF
NAME = "ceph-ds"
TM_MAD = "ceph"
DS_MAD = "ceph"
CEPH_HOST = "ceph-mon1 ceph-mon2 ceph-mon3"
CEPH_USER = "libvirt"
CEPH_SECRET = "uuid-here"
POOL_NAME = "one"
EOF
# List images
oneimage list
# Upload image
oneimage create --name "Ubuntu 24.04" \
--path /var/tmp/ubuntu-24.04.qcow2 \
--driver qcow2 \
--datastore default
OneFlow (Services)¶
# Create multi-tier service
oneflow-template create service.json
oneflow create "My Service"
oneflow list
oneflow scale "My Service" "web" 5 # scale web tier
System Administration¶
# Check daemon status
systemctl status opennebula opennebula-scheduler opennebula-sunstone
# View oned logs
tail -f /var/log/one/oned.log
# Database backup
onedb backup /var/lib/one/backup/one.db.$(date +%Y%m%d)
# Upgrade check
onedb version
onedb fsck # consistency check