OpenStack Journey

download OpenStack Journey

of 29

description

openstack

Transcript of OpenStack Journey

OpenStack Journey

My Open Stack Journey to install Kilo release on Ubuntu 14 Server

It was very uncomfortable thinking to evaluating this product, especially for a person who is more comfortable in VMware.I initially thought to drop this Idea multiple times but I never say NO so finally started this.I started reading docs.openstack.org but I was not sure that this link will actually help me to get whole things done.[NOW docs.openstack.com has everything and follow this deeply you will be able to deploy it for sure]I have created 3 vm on Esxi to start my journey, enabled promiscoused mode on vSwitch recommended on vm setup.Details of nodes:Subnet:-[11.20.13.0/24, 11.20.17.0/24, 11.20.11.0/24]

PTO

Controller- 11.20.13.200Compute - 11.20.13.250/11.20.17.250Network- 11.20.13.251/11.20.17.251External -- 11.20.11.50

Started Installation:-

Ubuntu GUI$ sudo apt-get install xorg gnome-core gnome-system-tools gnome-app-install

For all desktop feature including office $ sudo apt-get install ubuntu-gnome-desktop

[Ref link - http://www.htpcbeginner.com/install-gui-on-ubuntu-server-14-04-gnome/ ]

How to Setup networking in Ubuntu

Ubuntu NetworkIP address :/etc/network/interfacesEg:iface eth0 inet statichwaddress ether 01:02:03:04:05:06 address 192.168.3.3 netmask 255.255.255.0 gateway 192.168.3.1 dns-search example.com dns-nameservers 192.168.3.45 192.168.8.10Hostname: /etc/hostname

Note: Do not add name server info to /etc/resolv.conf directly, it would be overwritten by parameters from /etc/network/interfaces values.

Disable ubuntu automatic updatehttps://www.garron.me/en/linux/turn-off-stop-ubuntu-automatic-update.htmlhttp://www.dbigcloud.com/component/search/?searchword=OpenStack%20desde%20cero&searchphrase=all&Itemid=160IP configuration of Nodes:-

#CONTROLLER NODE11.20.13.200 controller controller.neeraj.com11.20.13.250 compute11.20.13.251 network

# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interfaceauto eth0iface eth0 inet statichwaddress ether 00:60:48:ba:7d:49address 11.20.13.200netmask 255.255.255.0gateway 11.20.13.1dns-nameservers 11.103.5.6 11.103.8.6

#COMPUTE NODEroot@compute:~# cat /etc/hosts#127.0.0.1 localhost#127.0.1.1 Template-ubuntu1404

# The following lines are desirable for IPv6 capable hosts#::1 localhost ip6-localhost ip6-loopback#ff02::1 ip6-allnodes#ff02::2 ip6-allrouters11.20.13.200 controller11.20.13.250 compute11.20.13.251 network

root@compute:~# cat /etc/network/interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interfaceauto eth0iface eth0 inet statichwaddress ether 00:60:48:ba:33:7aaddress 11.20.13.250netmask 255.255.255.0gateway 11.20.13.1dns-nameservers 11.103.5.6 11.103.8.6

# Second network tunnel interfaceauto eth1iface eth1 inet statichwaddress ether 00:60:48:ba:2a:15address 11.20.17.250netmask 255.255.255.0

root@compute:~# ifconfigeth0 Link encap:Ethernet HWaddr 00:60:48:ba:33:7a inet addr:11.20.13.250 Bcast:11.20.13.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feba:337a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2793007 errors:0 dropped:19251 overruns:0 frame:0 TX packets:2028665 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:604805873 (604.8 MB) TX bytes:462643609 (462.6 MB)

eth1 Link encap:Ethernet HWaddr 00:60:48:ba:2a:15 inet addr:11.20.17.250 Bcast:11.20.17.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feba:2a15/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1038332 errors:0 dropped:495 overruns:0 frame:0 TX packets:2757 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:254404120 (254.4 MB) TX bytes:301851 (301.8 KB)

#NETWORK NODE

root@network:~# cat /etc/hosts#127.0.0.1 localhost#127.0.1.1 Template-ubuntu1404

# The following lines are desirable for IPv6 capable hosts#::1 localhost ip6-localhost ip6-loopback#ff02::1 ip6-allnodes#ff02::2 ip6-allrouters11.20.13.200 controller11.20.13.250 compute11.20.13.251 network

root@network:~# cat /etc/network/interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interfaceauto eth0iface eth0 inet statichwaddress ether 00:60:48:ba:26:23address 11.20.13.251netmask 255.255.255.0gateway 11.20.13.1dns-nameservers 11.103.5.6 11.103.8.6

# Second network tunnel interfaceauto eth1iface eth1 inet statichwaddress ether 00:60:48:ba:53:54address 11.20.17.251netmask 255.255.255.0

# External network interface

auto eth2iface eth2 inet manualhwaddress ether 00:60:48:ba:58:4dup ip link set dev $IFACE updown ip link set dev $IFACE down

root@network:~# ifconfigeth0 Link encap:Ethernet HWaddr 00:60:48:ba:26:23 inet addr:11.20.13.251 Bcast:11.20.13.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feba:2623/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1572176 errors:0 dropped:19243 overruns:0 frame:0 TX packets:1005245 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:131041007 (131.0 MB) TX bytes:197895053 (197.8 MB)

eth1 Link encap:Ethernet HWaddr 00:60:48:ba:53:54 inet addr:11.20.17.251 Bcast:11.20.17.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feba:5354/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1092867 errors:0 dropped:486 overruns:0 frame:0 TX packets:56736 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:257693679 (257.6 MB) TX bytes:2552238 (2.5 MB)

eth2 Link encap:Ethernet HWaddr 00:60:48:ba:58:4d inet6 addr: fe80::250:56ff:feba:584d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:12175690 errors:0 dropped:0 overruns:0 frame:0 TX packets:85885 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2225112835 (2.2 GB) TX bytes:3682504 (3.6 MB)

#ON Controller Node.To install mariadb and mysqlFirst I installed apt-get install python-mysqldb mysql-serverPasted from ThenTo install and configure the database server1. Install the packages:NoteThe Python MySQL library is compatible with MariaDB.# apt-get install mariadb-server python-mysqldb2. Choose a suitable password for the database root account.3. Create and edit the /etc/mysql/conf.d/mysqld_openstack.cnf file and completethe following actions:a. In the [mysqld] section, set the bind-address key to the management IP addressof the controller node to enable access by other nodes via the managementnetwork:[mysqld]...bind-address = 11.0.0.11b. In the [mysqld] section, set the following keys to enable useful options and theUTF-8 character set:[mysqld]...default-storage-engine = innodbinnodb_file_per_tablecollation-server = utf8_general_ciinit-connect = 'SET NAMES utf8'character-set-server = utf8To finalize installation1. Restart the database service:# service mysql restart2. Secure the database service:# mysql_secure_installationInstalling rabbitmqapt-get install rabbitmq-serverrabbitmqctl add_user openstack TestPassword@321rabbitmqctl set_permissions openstack ".*" ".*" ".*"Installing identity serviceapt-get install keystone python-openstackclient apache2 libapache2-mod-wsgi memcached python-memcache--getting error -->E: Unable to locate package libapache2-modwsgi-- ran -->apt-get updateInstalled it by sudo apt-get install libapache2-mod-wsgiPasted from Then installed rest of the thingsUsed service command(openstack service create \ --name keystone --description "OpenStack Identity" identity) to create service identity but got below error:-openstack service create: error: unrecognized arguments: keystone identityResolve created hex random number which will be used as identity token and put them keystone file.

$openssl rand -hex 10Output-- a7c518b8f8f82472c0ec [this number will be used as token value]

$vim /etc/keystone/keystone.conf$export OS_TOKEN=19a63225b9684c28ebe1$export OS_URL=http://11.20.13.200:35357/v2.0$openstack service create --name keystone --description "OpenStack Identity" identity-------------+----------------------------------+| Field | Value |+-------------+----------------------------------+| description | OpenStack Identity || enabled | True || id | 2c2341114db74c7a93c7ab9ffb137ddd || name | keystone || type | identity |

Create Openstack endpoint on controller node

root@controller:~# openstack endpoint create --publicurl http://controller:5000/v2.0 --internalurl http://controller:5000/v2.0 --adminurl http://controller:35357/v2.0 --region RegionOne identity+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| adminurl | http://controller:35357/v2.0 || id | 89f00f0fc60e47a9945364c5cbc60de6 || internalurl | http://controller:5000/v2.0 || publicurl | http://controller:5000/v2.0 || region | RegionOne || service_id | 2c2341114db74c7a93c7ab9ffb137ddd || service_name | keystone || service_type | identity |+--------------+----------------------------------+Creating Openstack project named Admin and setting its credentialsroot@controller:~# openstack --os-auth-url http://controller:35357 --os-project-name admin --os-username admin --os-auth-type password token issuePassword:+------------+----------------------------------+| Field | Value |+------------+----------------------------------+| expires | 2015-09-23T06:26:22Z || id | c950e0a9bfa446e28f4d406b40f6bd47 || project_id | 1de17d53928e46d7b06c47e1fe615fa1 || user_id | 8d913a4cc53f4e7db619489043d15022 |+------------+----------------------------------+root@controller:~# openstack --os-auth-url http://controller:35357 --os-project-domain-id default --os-user-domain-id default --os-project-name admin --os-username admin --os-auth-type password token issuePassword:+------------+----------------------------------+| Field | Value |+------------+----------------------------------+| expires | 2015-09-23T06:29:08.897085Z || id | 6f0b9fe968bf4f8395fb905235871901 || project_id | 1de17d53928e46d7b06c47e1fe615fa1 || user_id | 8d913a4cc53f4e7db619489043d15022 |+------------+----------------------------------+root@controller:~# openstack --os-auth-url http://controller:35357 \> --os-project-name admin --os-username admin --os-auth-type password \> project listPassword:+----------------------------------+---------+| ID | Name |+----------------------------------+---------+| 1de17d53928e46d7b06c47e1fe615fa1 | admin || 203839307ef4471c91e3909b1e5b40fc | service || 38e3a8c7b4d44a2d89b237deeb788669 | demo |+----------------------------------+---------+root@controller:~# openstack --os-auth-url http://controller:35357 \> --os-project-name admin --os-username admin --os-auth-type password \> user listPassword:+----------------------------------+-------+| ID | Name |+----------------------------------+-------+| 8d913a4cc53f4e7db619489043d15022 | admin || e59ebc36ec7c4a6e938cd1cef27bd744 | demo |+----------------------------------+-------+root@controller:~# openstack --os-auth-url http://controller:35357 \> --os-project-name admin --os-username admin --os-auth-type password \> role listPassword:+----------------------------------+-------+| ID | Name |+----------------------------------+-------+| 7e39b406014a4fd68134a6897108a6fe | admin || 8ca61f67c6764ab390c89141fb26fc69 | user |+----------------------------------+-------+openstack --os-auth-url http://controller:35357 \ --os-project-domain-id default --os-user-domain-id default \ --os-project-name demo --os-username demo --os-auth-type password \ token issueGlance Setup on controller node :-GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'TestPassword@321';GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'TestPassword@321';# openstack endpoint create \ --publicurl http://controller.neeraj.com:9292 \ --internalurl http://controller.neeraj.com:9292 \ --adminurl http://controller.neeraj.com:9292 \ --region RegionOne image[Above all 5 line are on single line , please remove \ and make them single line then try]auth_uri = http://controller:5000auth_url = http://controller:35357auth_plugin = passwordproject_domain_id = defaultuser_domain_id = defaultproject_name = serviceusername = glancepassword = TestPassword@321Downloading Image file:-#wget -P /app/images http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img#glance image-create --name "cirros-0.3.4-x86_64" --file /app/images/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progressCREATE DATABASE nova;GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'TestPassword@321';GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'TestPassword@321';#source admin-openrc.shopenstack user create --password-prompt novaopenstack role add --project service --user nova adminopenstack service create --name nova --description "OpenStack Compute" computeCreate endpoint for Glance image:-openstack endpoint create --publicurl http://controller:8774/v2/%\(tenant_id\)s --internalurl http://controller:8774/v2/%\(tenant_id\)s --adminurl http://controller:8774/v2/%\(tenant_id\)s --region RegionOne computeapt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient su -s /bin/sh -c "nova-manage db sync" nova got error of No handlers could be found for logger "oslo_config.cfg" opened /etc/nova/nova.conf and changed cretaed another variable log_dir and logdir remain sameThis is your host IP address: 11.20.13.200This is your host IPv6 address: ::1Horizon is now available at http://11.20.13.200/Keystone is serving at http://11.20.13.200:5000/The default users are: admin and demoThe password: redhat# apt-get install nova-compute sysfsutils Error -- Cannot initiate the connection to in.archive.ubuntu.com:80 Resolution -- this is network issue check the network and restart machine Error -- E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/x/xen/libxenstore3.0_4.4.2-0ubuntu0.14.04.1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]

Check the file source /etc/apt/sources.list and make sure source is http://in.archive.ubuntu.com/ubuntuOnce you sure run apt-get update and reboot the machine -- after reboot install nova packageCreating Database for neutron:-GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'TestPassword@321';GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'TestPassword@321';openstack user create --password-prompt neutronopenstack role add --project service --user neutron adminopenstack service create --name neutron --description "OpenStack Networking" networkopenstack endpoint create --publicurl http://controller:9696 --adminurl http://controller:9696 --internalurl http://controller:9696 --region RegionOne networkapt-get install neutron-server neutron-plugin-ml2 python-neutronclientsu -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutronErrro -- File "/usr/lib/python2.7/argparse.py", line 1868, in consume_optional take_action(action, args, option_string) File "/usr/lib/python2.7/argparse.py", line 1796, in take_action action(self, namespace, argument_values, option_string) File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 1216, in __call__ ConfigParser._parse_file(values, namespace) File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 1419, in _parse_file raise ConfigFileParseError(pe.filename, str(pe))oslo_config.cfg.ConfigFileParseError: Failed to parse /etc/neutron/plugins/ml2/ml2_conf.ini: at /etc/neutron/plugins/ml2/ml2_conf.ini:17, Unexpected continuation line: ' mechanism_drivers = openvswitch'Resolution- there was a starting space left before mechanism_drivers , removed the space and resolvedError -#neutron ext-listUnable to connect to neutrol url .I had created neutron end point and made a mistake where instead of controller I put dle2controllerThen I ran a command neutron ext-list --debug and found that hostname is not correct in endpointTo see and modify it I used below commandsroot@controller:~# openstack endpoint list+----------------------------------+-----------+--------------+--------------+| ID | Region | Service Name | Service Type |+----------------------------------+-----------+--------------+--------------+| d275d2f779c14b468f3b1cc317fee7f6 | RegionOne | neutron | network || 6409281300eb49e18624f4c41ec75480 | RegionOne | neutron | network || 39d7668e533e47d69d481aa9e849315d | RegionOne | glance | image || 77fba39464614ca1adc18dfdd670058d | RegionOne | nova | compute || da0743ca9e604ba6925f94782a3a4956 | RegionOne | neutron | network || 89f00f0fc60e47a9945364c5cbc60de6 | RegionOne | keystone | identity |+----------------------------------+-----------+--------------+--------------+root@controller:~# openstack endpoint showusage: openstack endpoint show [-h] [-f {html,json,shell,table,value,yaml}] [-c COLUMN] [--max-width ] [--prefix PREFIX] openstack endpoint show: error: too few argumentsroot@controller:~# openstack endpoint show d275d2f779c14b468f3b1cc317fee7f6+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| adminurl | http://controller:9696 || enabled | True || id | d275d2f779c14b468f3b1cc317fee7f6 || internalurl | http://controller:9696 || publicurl | http://dle2controller:9696 || region | RegionOne || service_id | 111763d6da8e4a689660e963b1489a5b || service_name | neutron || service_type | network |+--------------+----------------------------------+root@controller:~# openstack endpoint show 6409281300eb49e18624f4c41ec75480+--------------+----------------------------------+| Field | Value |+--------------+----------------------------------+| adminurl | http://controller:9696 || enabled | True || id | 6409281300eb49e18624f4c41ec75480 || internalurl | http://controller:9696 || publicurl | http://controller:9696 || region | RegionOne || service_id | 111763d6da8e4a689660e963b1489a5b || service_name | neutron || service_type | network |+--------------+----------------------------------+root@controller:~# openstack endpoint delete d275d2f779c14b468f3b1cc317fee7f6neutron net-create ext-net --router:external --provider:physical_network external --provider:network_type flatneutron subnet-create ext-net 10.202.11.0/24 --name ext-subnet --allocation-pool start=10.202.11.111,end=10.202.11.119 --disable-dhcp --gateway 10.202.11.1source demo-openrc.shneutron net-create demo-netneutron subnet-create demo-net 192.168.1.0/24 --name demo-subnet --gateway 192.168.1.1neutron router-create demo-routerneutron router-interface-add demo-router demo-subnetneutron router-gateway-set demo-router ext-netAfter setting exteranal network and IP, router tenant network and tenant subnet I was not able to ping 10.202.11.111 to 119I did lots of thing but finally restarted all the node Still not workingAfter some time it automatically started dont know the reason yetPasting some history for help from controller node#cd /root#source admin-openrc.sh#source stackrc.sh#source demo-openrc.shInstalled DashboardRemoved ubuntu-themeError -- Image status is queued forever Resolution -- this is known bug in KILO releasehttps://ask.openstack.org/en/question/68812/glance-image-upload-from-dashboard-stuck-in-queue-state-forever/Usedglance image-create --name cirros_new_without_bug --disk-format qcow2 --container-format bare --is-public True --file /tmp/images/cirros-0.3.4-x86_64-disk.imgAgain error in commandSo did apt-get updateRead this http://docs.openstack.org/developer/glance/statuses.htmlTo resolved now, issue was with the permission of /images folder , it was under root ownership so after changing it to glance it started workingchown glance. /app/chown -R glance. /app/By mistake I deleted some network so below link helpedhttp://egonzalez.org/delete-openstack-neutron-networks-solution-to-unable-to-complete-operation-on-subnet/Still not able to delete ext-net so from graphical console deleted all its associated subnethttps://ask.openstack.org/en/question/54024/how-to-delete-a-subnet-in-neutron/Created a instance but not able to associated floating ip because of port not available so created using below command on controllerhttps://ask.openstack.org/en/question/54713/no-ports-available-when-trying-to-associate-a-floating-ip/ #neutron floatingip-create ext-net

After installing Horizon started web console attaching few screenshot.

Open http://controller/horizon