If your servers spawned from your own image don’t resize or keep the status resize_prep then they do not shutdown correctly and don’t respond to ACPI requests Openstack sends.
First shut down the VM and then retry the resize.
Make sure that the following kernel module is loaded:
acpiphp
This is the kernel module that handles the shutdown requests and such.
Make sure your image has VirtIO Disk and NIC support.
We don’t support any other formats like IDE, SATA or e1000.
- Login to the Dashboard
- Navigate to: Images
- Click “Upload Image”
- Enter the required parameters:
- Image Name
- Type (QCOW2, RAW, VHD, VMDK, VDI, ISO9660)
- Cloud Init support (Does this image allow openstack to set the password and ssh key via cloud-init?)
- Minimum Disk
- Minimum RAM
- Image file
- Click “Upload Image”
- Wait for the upload to finish.
The image you create should have support for cloud-init.
This is the program that changes the user password, ssh key and makes sure resizes work better.
When you are installing the image, make sure it is installed along.
Follow the steps in their documentation to configure it.
First make sure you have an ISO present to upload, for example, FreeBSD:
wget http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.0/FreeBSD-10.0-RELEASE-amd64-disc1.iso
Make sure then OS has VirtIO disk and VirtIO NIC support.
- Upload it to Openstack:
glance image-create --file FreeBSD-10.0-RELEASE-amd64-disc1.iso --name "FreeBSD-10.0-RELEASE-amd64-disc1.iso" --disk-format iso --container-format bare --progress - Create the root volume:
cinder create --display-name "freebsd-10-root" 8 - Now boot a new instance with the ISO and the newly created root volume:
nova boot --image <freebsd iso image id> --flavor "Standard 1" --availability-zone NL1 --nic net-id=00000000-0000-0000-0000-000000000000 --block-device-mapping hdb=<volume freebsd-10-root id>:::0 FreeBSD-10.0-RELEASE-install - Install the OS to the new disk. Afterwards, stop the instance:
nova stop <install vm id> - Detach the volume:
nova volume-detach <install vm id> <install root volume id> - Boot a new instance with the installed OS volume as the root volume:
nova boot --block-device source=volume,id=<root volume id>,dest=volume,shutdown=preserve,bootindex=0 --flavor "Standard 1" --availability-zone NL1 --nic net-id=00000000-0000-0000-0000-000000000000 FreeBSD-10.0-RELEASEThat’s it. If you also want to create an image of this install to use for new VM’s, continue on.
- Stop the VM with the volume as root disk:
nova stop <root volume VM id> - Terminate the machine, otherwise you cannot detach the volume (ERROR: Can’t detach root device volume (HTTP 403)):
nova delete <id of root volume VM> - Convert the volume to an image:
cinder upload-to-image <root volume id> FreeBSD-10.0-RELEASE-cloudinit - This might take a while. Afterwards you can set the image parameters like Min RAM and Cloudinit Support:
glance image-update --min-disk 8 --min-ram 1024 --property architecture=x86_64 --property image_supports_keypair=true --property image_supports_password=true --property supported=false <id from the converted volume image>Afterwards you can use it as an image for new VM’s.
- Login to the Dashboard Navigate to the server you want to create an image of
- Click “Create Image”
- Fill in the required parameters
- Click “Create Image”
When creating a new server you can select this image as the base for it.
This cannot be done via the dashboard.
Install the Openstack Command line tools and create and source a computerc file.
Use the following command to get a list of images:
openstack image list
Note down the image name or UUID, and use the following command do download the actual image:
openstack image save --file CentOS7.img --progress "CentOS7"