OpenStack Nova compute service skill for deploying, configuring, operating, and troubleshooting cloud compute infrastructure. Covers instance lifecycle management (create/stop/start/reboot/resize/migrate/evacuate), compute scheduling with filters and weights, flavor management, live migration procedures, hypervisor management (KVM/QEMU via libvirt), placement service for resource tracking, CPU pinning, NUMA topology, huge pages, cell mapping, VNC/SPICE console access, and capacity planning. Use when deploying compute via Kolla-Ansible, managing instances, debugging scheduler failures, or planning compute capacity.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
OpenStack Nova compute service skill for deploying, configuring, operating, and troubleshooting cloud compute infrastructure. Covers instance lifecycle management (create/stop/start/reboot/resize/migrate/evacuate), compute scheduling with filters and weights, flavor management, live migration procedures, hypervisor management (KVM/QEMU via libvirt), placement service for resource tracking, CPU pinning, NUMA topology, huge pages, cell mapping, VNC/SPICE console access, and capacity planning. Use when deploying compute via Kolla-Ansible, managing instances, debugging scheduler failures, or planning compute capacity.
Nova is the compute scheduler and instance lifecycle manager for OpenStack. It receives instance creation requests, selects an appropriate hypervisor through the scheduler and placement service, coordinates with Glance for images, Neutron for networking, and Cinder for volumes, then manages the full instance lifecycle through libvirt/KVM.
Nova operates in a cell-based architecture. Cell0 holds instances that failed to schedule. Cell1 (and beyond) holds running instances. The placement service tracks resource inventories (vCPUs, RAM, disk) independently from Nova, providing accurate capacity data for scheduling decisions.
Deploy
Kolla-Ansible Configuration
globals.yml settings:
# Hypervisor typenova_compute_virt_type:"kvm"# Production: hardware KVM# nova_compute_virt_type: "qemu" # Nested virt or no VT-x/AMD-V# Libvirt containerenable_nova_libvirt_container:"yes"# CPU and RAM allocation ratiosnova_cpu_allocation_ratio:4.0# 4:1 vCPU to pCPU (adjust for workload)nova_ram_allocation_ratio:1.5# 1.5:1 vRAM to pRAMnova_disk_allocation_ratio:1.0# 1:1 (do not overcommit disk)# Console accessnova_console:"novnc"# Options: novnc, spice# nova_console: "spice" # Better performance, less browser support# Metadata serviceenable_nova_metadata:"yes"# Nova database passwordnova_database_password:"{{ vault_nova_database_password }}"nova_api_database_password:"{{ vault_nova_api_database_password }}"nova_keystone_password:"{{ vault_nova_keystone_password }}"
Deployment:
# Deploy Nova (as part of full deploy or targeted)
kolla-ansible -i inventory deploy --tags nova
# Verify containers
docker ps --filter "name=nova" --format "table {{.Names}}\t{{.Status}}"# Expected: nova_api, nova_conductor, nova_scheduler, nova_novncproxy,# nova_compute, nova_libvirt (all Up)
Post-deploy verification:
source /etc/kolla/admin-openrc.sh
# Verify compute service registration
openstack compute service list
# All services should show Status=enabled, State=up# Verify cell mapping
nova-manage cell_v2 list_cells
# Expected: cell0 and cell1 with transport_url and database# Verify hypervisor
openstack hypervisor list
# Should show each compute node with vCPUs, Memory, Disk# Verify placement
openstack resource provider list
# Should match hypervisor list
Configure
Flavor Management
Flavors define instance resource profiles. Create a standard set:
# nova.conf [DEFAULT] on compute nodesvcpu_pin_set = 4-15# Pin guest vCPUs to physical cores 4-15# Reserve cores 0-3 for host OS# NUMA topology filter[filter_scheduler]enabled_filters = ...,NUMATopologyFilter
Flavor extra specs for NUMA:
openstack flavor set m1.large \
--property hw:cpu_policy=dedicated \
--property hw:numa_nodes=1
Huge Pages
# On compute host: allocate huge pagesecho 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
# Flavor with huge pages
openstack flavor set m1.large \
--property hw:mem_page_size=large
Live Migration Configuration
# globals.ymlnova_compute_virt_type:"kvm"enable_nova_libvirt_container:"yes"# For live migration, all compute nodes need:# 1. Shared storage (NFS, Ceph) or block migration# 2. Same CPU model (or cpu_mode=host-model)# 3. Matching libvirt versions
# nova.conf [libvirt]live_migration_tunnelled = false# Use native QEMU migrationlive_migration_uri = qemu+tcp://%s/system
cpu_mode = host-model # Consistent CPU features across hosts
Scheduler Filters and Weights
# nova.conf [filter_scheduler]enabled_filters = AvailabilityZoneFilter,ComputeFilter,
ComputeCapabilitiesFilter,ImagePropertiesFilter,
ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,
AggregateInstanceExtraSpecsFilter,NUMATopologyFilter
# Weight classes determine host preference after filteringweight_classes = nova.scheduler.weights.ram.RAMWeigher
ram_weight_multiplier = 1.0# Prefer hosts with more free RAM
VNC Console Configuration
# globals.ymlnova_console:"novnc"# For external access, set the proxy base URLnova_novncproxy_base_url:"http://controller:6080/vnc_auto.html"
Operate
Instance Lifecycle
# Create instance
openstack server create --flavor m1.small --image cirros \
--network private --security-group default my-instance
# Status checks
openstack server show my-instance -c status -c OS-EXT-STS:vm_state
# Power operations
openstack server stop my-instance
openstack server start my-instance
openstack server reboot my-instance # Soft reboot
openstack server reboot --hard my-instance # Hard reboot# Resize (change flavor)
openstack server resize --flavor m1.medium my-instance
openstack server resize confirm my-instance # After verification
openstack server resize revert my-instance # If problems# Live migration (to specific host or auto-select)
openstack server migrate --live controller2 my-instance
openstack server migrate --live-migration my-instance # Auto-select# Cold migration
openstack server migrate my-instance
# Evacuate (from failed host)
openstack server evacuate my-instance --host controller2
Compute Node Maintenance
# Disable compute node (stop scheduling new instances)
openstack compute service set --disable \
--disable-reason "Maintenance window" controller nova-compute
# Migrate all instances off the node
nova host-evacuate-live controller
# After maintenance
openstack compute service set --enable controller nova-compute
Orphan Instance Cleanup
# Find instances in ERROR state
openstack server list --all-projects --status ERROR
# Force delete stuck instances
openstack server delete --force <instance-id>
# Clean orphan ports (instances deleted but ports remain)
openstack port list --device-owner compute:nova --network private
# Cross-reference with server list; delete unattached ports
Symptoms: Migration starts but fails partway through, or never begins.
Diagnosis:
openstack server migration list --server <instance-id>
docker logs nova_compute 2>&1 | grep -i "migration\|migrate"
Common causes:
Cause
Diagnosis
Fix
No shared storage
"Cannot migrate with non-shared storage"
Use --block-migration or configure shared storage (NFS/Ceph)
CPU incompatibility
"Unable to connect to qemu" or CPU feature mismatch
Set cpu_mode = host-model in nova.conf, ensure same CPU vendor
libvirt version mismatch
"Incompatible libvirt" in logs
Upgrade libvirt on older node
Network config mismatch
Migration completes but instance loses connectivity
Ensure consistent OVS bridge naming and tunnel endpoints
3. "No Valid Host" Errors
Symptoms:openstack server create returns "No valid host was found."
Diagnosis:
# Check placement resource inventory
openstack resource provider inventory list <compute-rp-uuid>
# Check resource usage
openstack resource provider usage show <compute-rp-uuid>
# Verify scheduler filters are not eliminating all hosts
docker logs nova_scheduler 2>&1 | grep -i "filter\|no valid"
Fix: Identify which filter eliminated all candidates. Common: insufficient RAM/vCPU/disk in placement, availability zone mismatch, aggregate filter mismatch, anti-affinity constraint.
4. Console Access Failures
Symptoms: VNC console shows "Failed to connect" or blank screen.
Diagnosis:
# Get console URL
openstack console url show my-instance
# Check novncproxy
docker logs nova_novncproxy 2>&1 | tail -20
# Verify port 6080 is open
ss -tlnp | grep 6080
Fix:
Firewall blocking port 6080: firewall-cmd --add-port=6080/tcp --permanent
Wrong proxy base URL: Check nova_novncproxy_base_url in globals.yml
Instance not running: verify openstack server show -c status
5. Compute Service Down
Symptoms:openstack compute service list shows State=down for a compute node.