Академический Документы
Профессиональный Документы
Культура Документы
## Step by step tutorial for deploying OpenStack using Packstack from RDO.
```bash
# Modify the network config, the name might differ
~ $ sudo vim /etc/sysconfig/network-scripts/ifcfg-en-device-name
```
```vim
TYPE=Ethernet
BOOTPROTO=static # Set it to static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME="device-name"
UUID="the-uid"
DEVICE="device-name"
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPADDR=10.0.2.22 # Set the IP Address that should be used by the mahcine
NETMASK=255.255.255.0
GATEWAY=10.0.2.2
DNS1=10.0.2.2
DNS2=8.8.8.8
```
## Configure the network_init
```bash
# Restart the network
~ $ sudo service network restart
# Get the network setup script
~ $ wget https://raw.githubusercontent.com/stefan-caraiman/packstack-tutorial/ma
ster/network_init.sh
~ $ chmod +x network_init.sh
# Also don't forget to modify the values from the script
# Next we need to have the network_init run at startup
# Add "bash /home/work/network_init.sh" to the end of the following file
~ $ sudo vim /etc/rc.local
~ $ sudo chmod +x /etc/rc.local
# Now reboot the system
~ $ sudo reboot
```
###Installing Openstack with Packstack
```bash
# Install Openstack using our customized answer file.
# Also do not forget to modify the HOST IP fields found in the file.
~ $ wget https://raw.githubusercontent.com/stefan-caraiman/packstack-tutorial/ma
ster/packstack-answers.txt
~ $ sudo packstack --answer-file=packstack.txt
# After the install you can find the ```keystonerc_admin``` in your home folder
~ $ sudo su
~ $ source ~/keystonerc_admin
# Copy in the working user home directory
~ $ sudo cp /root/keystonerc_admin ~/
~ $ sudo chown $USER ~/keystonerc_admin
# The password can be found in ```keystonerc_admin``` or by simply echo-ing it
~ $ echo $OS_PASSWORD
# Add the port for the br-ex
~ $ sudo ovs-vsctl add-port br-ex "the-eno-name"
```
You can find `the-eno-name` with `ip a` of `ifconfig`.
## Configure the network with neutron
```bash
# Clear the router gateway
(keystonerc_admin) ~ $ neutron router-gateway-clear router1
# Delete the default public network
(keystonerc_admin) ~ $ neutron net-delete public
# Create a new public network
(keystonerc_admin) ~ $ neutron net-create --shared --router:external public
# Configure the newly created public network
(keystonerc_admin) ~ $ neutron subnet-create public 10.0.2.0/24 --name public_su
bnet --enable-dhcp=False --allocation-pool start=10.0.2.140,end=10.0.2.160 --gat
eway 10.0.2.2
# Create a new router and set the gateway for it
(keystonerc_admin) ~ $ neutron router-create router
(keystonerc_admin) ~ $ neutron router-gateway-set $router_id $public_network_id
# Add the private subnet to the routers interfaces
(keystonerc_admin) ~ $ neutron router-interface-add router private_subnet
# Update the private_subnet DNS nameserver
# Run ```neutron subnet-list``` to see the subnets IDs.
(keystonerc_admin) ~ $ neutron subnet-update --dns-nameserver 8.8.8.8 "private_s
ubnet_id"
```
# Update nova.conf
**IMPORTANT 1:** It might happen that nova.conf virt_type value is set on qemu i
nstead of kvm(Windows instaces won't be able to boot up if that's the case). In
that case please do the following:
In `/etc/nova/nova.conf` you need to have this configurations set in order to bo
ot windows instances.
```ini
...
virt_type=kvm # by default it might be qemu
...
cpu_model=host-passthrough # by default if might be none
..
```
```bash
# You can then either reboot the machine or restart the services
~ $ sudo openstack-service restart
```
## Other details
**IMPORTANT 2:** In case you wish to re-run packstack with a updated answerfile
you can simply run the following:
####NOTE: by default ```$youranswerfile``` is called packstack-answer-$date-$tim
e.txt
```bash
~ $ sudo packstack --answer-file=$youranswerfile
```
**IMPORTANT 3:** In the case of Windows 10 and Windows Server 2016 there are som
e CPU features that have to be enabled.In nova.conf search for the `cpu_mode` fi
eld and set it to host-passthrough. Restart the service.
**IMPORTANT 4:** If you encounter issues with generating the tempest config, you
can also generate it as it follows:
```bash
#Create your tempest directory and change into it
~ $ mkdir ~/tempest && cd ~/tempest
#Initialize the directory by running
~ $ /usr/share/openstack-tempest-10.0.0/tools/configure-tempest-directory
#Configure tempest
~ $ tools/config_tempest.py --deployer-input ~/tempest-deployer-input.conf \
--create identity.uri $OS_AUTH_URL identity.admin_password $OS_PASSWORD
```
**IMPORTANT 5:** To avoid some errors with running tests, read permissions shoul
d be added to the "/etc/neutron" folder.