There are few moments when you find your image does not work. It's normal, and fixing it is a way to make image works.
This file describes few debugging techniques for different types of failures.
- Check if you have your own
OS_*
credentials in shell environment. They override test.yaml/upload.yaml settings. - Check if you can spawn instance with same settings.
This is your Openstack issue. Check logs. Often this is 'No valid hosts found'. Check if you are using proper flavor, availability_zone (if you use them).
One of possible mistakes: specified 'net-id' network is full and there are no free IP left.
- Enable devuser in the
dib.elements
section for image config - Set user, password and passwordless sudo (in the
dib.environment_variables
):
DIB_DEV_USER_PWDLESS_SUDO: yes
DIB_DEV_USER_USERNAME: dibdebug
DIB_DEV_USER_PASSWORD: joj0quilUst
- Rebuild image
- Repeat test with --keep-failed-instance
It will fail again, but now you can log into instance via console and see why it didn't recieve IP (or have trouble with SSH).
(!) Do not forget to remove devuser element and rebuild image after you done, otherwise your clients/users would be really upset to find unknown user with password and sudo in their systems.
Common reasons:
- No cloud-init or no proper data-source for cloud-init.
- Security groups (which prevents incoming connection by default)
- Incorrect networks (local network instead of 'internet')
- Wrong port settings
wait_for_port
timeout is too short (common mistake for baremetal instances - they usually take more time to boot)
Use --shell
option to get shell to failed instance and inspect it.
If you want to keep instance after you log out of the shell, use exit 42
.