- Mastering OpenStack(Second Edition)
- Omar Khedher Chandan Dutta Chowdhury
- 486字
- 2021-07-02 23:52:48
Setting up the development machine
Although OpenStack Ansible automates the complete process of setting up a dev and test OpenStack environment, it requires a machine with the correct hardware and software installed to start with. That leaves getting the development machine up and running with basic software such as the correct operating system and hardware still a manual job.
This is where tools such as Vagrant comes in handy. Vagrant helps automate the process of creating a reproducible development environment. Vagrant does this by launching virtual machines with the right operating system image. It also sets up SSH access to the virtual machine. With Vagrant, it is easy to quickly bring up a development and test environment on your laptop.
Vagrant uses VirtualBox as the default hypervisor, but can also work with other providers such as VMware and HyperV to launch virtual machines.
To start a development machine, all we need is an image for the operating system. Other hardware configuration and customization of the development machine can be described in the Vagrant configuration file. With this, Vagrant can start a development environment in a virtual machine.
Let's look at the process of creating the development machine:
- To start using Vagrant, we need the Vagrant installer, which can be downloaded from the Vagrant website at: https://www.vagrantup.com/downloads.html
- Install Vagrant on your host machine.
- Vagrant starts the virtual machines based on images of the operating system, which it calls boxes. So next we will find the suitable operating system image for our development machine and add it to Vagrant:
# vagrant init ubuntu/trusty64
- The preceding command will download Ubuntu Trusty 14.04 for amd64 architecture and create a Vagrant file with default values. An example of the Vagrant file is shown here:

- Vagrant provides various other customization features through the Vagrantfile; the defaults for those configuration options are provided in the generated file.
- Next, we have to customize the hardware for our development machine using the Vagrantfile. Edit the Vagrantfile and add the following settings:
config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 8
end
The preceding settings will set up root access to the development virtual machine and set the memory and CPU requirements.
- Finally, you can start and log in to the development machine using the following Vagrant commands:
# vagrant up --provider virtualbox
# vagrant ssh
With the above, you should be able to log in as a Vagrant user. Use sudo -I to become root and proceed with the next steps to create the Ansible OpenStack All-In-One development setup as described in the next section.
Due to the large disk requirement of the development environment, you will have to extend the size of the virtual machine started by Vagrant. You can always generate your own Vagrant image with a bigger disk size to fit the requirements of the development machine. The steps to create a Vagrant box are detailed at https://www.vagrantup.com/docs/virtualbox/boxes.html.
- Ansible Configuration Management
- 腦動力:Linux指令速查效率手冊
- Zabbix Network Monitoring(Second Edition)
- 可編程控制器技術應用(西門子S7系列)
- 讓每張照片都成為佳作的Photoshop后期技法
- OpenStack Cloud Computing Cookbook(Second Edition)
- AWS Certified SysOps Administrator:Associate Guide
- 傳感器與物聯網技術
- 人工智能實踐錄
- 基于敏捷開發的數據結構研究
- 智能鼠原理與制作(進階篇)
- Keras Reinforcement Learning Projects
- 實戰突擊
- 傳感器原理及應用(第二版)
- 單片機C語言編程實踐