Skip to content

Instantly share code, notes, and snippets.

@stefanozanella
Last active October 31, 2019 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stefanozanella/4749996 to your computer and use it in GitHub Desktop.
Save stefanozanella/4749996 to your computer and use it in GitHub Desktop.
Create Ubuntu server image for OpenStack

The procedure below is done on a CentOS 6.3 x86_64 hypervisor

  1. Create qcow image:
qemu-img create -f qcow2 ubuntu-12.10-server-amd64.img 5G
  1. Download Ubuntu server ISO:
wget "http://www.ubuntu.com/start-download?distro=server&bits=64&release=latest"
  1. Manually boot a VM with Ubuntu server ISO as CDROM and qcow image as disk (parameters are extracted from a running OpenStack instance on the same KVM hypervisor):
/usr/libexec/qemu-kvm -m 1024 -cdrom /media/ubuntu-12.10-server-amd64.iso 
-drive file=/root/ubuntu-12.10-server-amd64.img,if=none,id=drive-virtio-disk3,format=qcow2,cache=none 
-boot d -net nic -net user -vnc :60 -monitor unix:/tmp/file.mon,server,nowait 
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk3,id=virtio-disk3
  1. Connect on the VNC display and go through installation process. Main options:
  • Language: English
  • Country: other, Europe, Italy
  • Country to base locale: en_US.UTF-8
  • Keyboard Layout: English (US, alternative international)
  • Hostname: almost irrelevant, will be changed by cloud-init
  • New user: ec2-user
  • Password: choose one
  • Encrypt home directory? No
  • Timezone: Europe/Rome
  • Partitioning: Guided, use entire disk
  • Partitioning scheme: create single root partition, no swap
  • Proxy info: none
  • Automatic updates: no automatic updates (hoping to manage them via MCollective...)
  • Software to install: OpenSSH server
  • Install GRUB boot loader? Yes
  1. Perform initial update:
sudo apt-get update
sudo apt-get upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment