OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation...

70
OpenStack Liberty installation [email protected] I created this document to keep track of my experimental installation of OpenStack Liberty I made in December 2015. It is based on the official installation guide from docs.openstack.org but contains more details and comments for specific commands’ output and description of mistakes I made and errors I got. All info here is provided as is. Content 1. Basic components installation................................................................................................. 5 1.1. Packages ..................................................................................................................................................................................... 5 1.2. SQL DB ......................................................................................................................................................................................... 5 1.3. MongoDB (for Telemetry)................................................................................................................................................... 8 1.4. RabbitMQ.................................................................................................................................................................................... 8 2. Keystone................................................................................................................................. 9 2.1. Create the Keystone database ........................................................................................................................................... 9 2.2. Install packages and configure Keystone .................................................................................................................. 10 2.3. Configure Apache ................................................................................................................................................................. 11 2.4. Create the service entity and API endpoints............................................................................................................ 13 2.5. Create projects, users, and roles ................................................................................................................................... 17 2.6. Verify Keystone operation ............................................................................................................................................... 19 2.7. Create OpenStack client environment scripts ......................................................................................................... 20 3. Glance .................................................................................................................................. 21 3.1. Create Glance Database ..................................................................................................................................................... 21 3.2. Create the user and service entity and API endpoints ........................................................................................ 21 3.3. Install packages and configure Glance........................................................................................................................ 23 3.4. Verify Glance operation .................................................................................................................................................... 25 4. Nova ..................................................................................................................................... 28 4.1. Create Nova Database ........................................................................................................................................................ 28 4.2. Create the user and service entity and API endpoints ........................................................................................ 29 4.3. Install packages and configure Nova on the Controller node........................................................................... 30 4.4. Verify Nova operation on the Controller node........................................................................................................ 32 4.1. Install packages and configure Nova on the Compute node ............................................................................. 35 4.1. Verify Nova operation on the Compute node .......................................................................................................... 36 5. Neutron ................................................................................................................................ 37 5.1. Create Neutron Database ................................................................................................................................................. 37 5.1. Create the user and service entity and API endpoints ........................................................................................ 38 5.2. Install packages and configure Neutron on the Controller node .................................................................... 40 5.2.1. Configure the server component ................................................................................................................................ 40 5.2.2. Configure the Modular Layer 2 (ML2) plug-in..................................................................................................... 41 5.2.3. Configure the Linux bridge agent on the Network node ................................................................................. 42 5.2.4. Configure the layer-3 agent ......................................................................................................................................... 42 5.2.5. Configure the DHCP agent ............................................................................................................................................ 43 5.2.6. Configure the metadata agent .................................................................................................................................... 44

Transcript of OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation...

Page 1: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

3

OpenStack Liberty installation [email protected]

IcreatedthisdocumenttokeeptrackofmyexperimentalinstallationofOpenStackLibertyImadein

December2015.Itisbasedontheofficialinstallationguidefromdocs.openstack.orgbutcontainsmore

detailsandcommentsforspecificcommands’outputanddescriptionofmistakesImadeanderrorsIgot.

Allinfohereisprovidedasis.

Content

1. Basiccomponentsinstallation.................................................................................................51.1. Packages.....................................................................................................................................................................................51.2. SQLDB.........................................................................................................................................................................................51.3. MongoDB(forTelemetry)...................................................................................................................................................81.4. RabbitMQ....................................................................................................................................................................................8

2. Keystone.................................................................................................................................92.1. CreatetheKeystonedatabase...........................................................................................................................................92.2. InstallpackagesandconfigureKeystone..................................................................................................................102.3. ConfigureApache.................................................................................................................................................................112.4. CreatetheserviceentityandAPIendpoints............................................................................................................132.5. Createprojects,users,androles...................................................................................................................................172.6. VerifyKeystoneoperation...............................................................................................................................................192.7. CreateOpenStackclientenvironmentscripts.........................................................................................................203. Glance..................................................................................................................................213.1. CreateGlanceDatabase.....................................................................................................................................................213.2. CreatetheuserandserviceentityandAPIendpoints........................................................................................213.3. InstallpackagesandconfigureGlance........................................................................................................................233.4. VerifyGlanceoperation....................................................................................................................................................254. Nova.....................................................................................................................................284.1. CreateNovaDatabase........................................................................................................................................................284.2. CreatetheuserandserviceentityandAPIendpoints........................................................................................294.3. InstallpackagesandconfigureNovaontheControllernode...........................................................................304.4. VerifyNovaoperationontheControllernode........................................................................................................324.1. InstallpackagesandconfigureNovaontheComputenode.............................................................................354.1. VerifyNovaoperationontheComputenode..........................................................................................................36

5. Neutron................................................................................................................................375.1. CreateNeutronDatabase.................................................................................................................................................375.1. CreatetheuserandserviceentityandAPIendpoints........................................................................................385.2. InstallpackagesandconfigureNeutronontheControllernode....................................................................405.2.1. Configuretheservercomponent................................................................................................................................405.2.2. ConfiguretheModularLayer2(ML2)plug-in.....................................................................................................415.2.3. ConfiguretheLinuxbridgeagentontheNetworknode.................................................................................425.2.4. Configurethelayer-3agent.........................................................................................................................................425.2.5. ConfiguretheDHCPagent............................................................................................................................................435.2.6. Configurethemetadataagent....................................................................................................................................44

Page 2: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

4

5.2.7. ConfigureComputetouseNetworking...................................................................................................................445.2.8. FinalizeinstallationontheControllernode.........................................................................................................44

5.3. InstallpackagesandconfigureNeutronontheComputenode.......................................................................465.3.1. ConfiguretheLinuxbridgeagentontheComputenode.................................................................................465.3.2. ConfigureComputetouseNetworking...................................................................................................................475.3.3. FinalizeinstallationontheNetworknode............................................................................................................47

5.4. VerifyNeutronoperation.................................................................................................................................................48

6. Createnetworks...................................................................................................................506.1. Createthepublicnetwork...............................................................................................................................................506.1. Createtheprivatenetwork¶..........................................................................................................................................516.2. Createarouter......................................................................................................................................................................526.3. Verifynetworkoperation.................................................................................................................................................53

7. Addkeypairsandsecuritygroups.........................................................................................567.1. Generateakeypair.............................................................................................................................................................567.2. Addsecuritygrouprules..................................................................................................................................................56

8. Launchaninstance...............................................................................................................578.1. Launchaninstanceonthepublicnetwork...............................................................................................................578.1. Launchaninstanceontheprivatenetwork.............................................................................................................59

9. Appendix..............................................................................................................................629.1. NetworkconfiginUbuntu................................................................................................................................................629.2. UpdateUbuntu......................................................................................................................................................................629.3. CreateVMwaretemplateinUbuntu............................................................................................................................639.4. NTPconfiginUbuntu.........................................................................................................................................................659.5. AddanewdiskinUbuntu................................................................................................................................................669.6. ResizeadiskinUbuntu.....................................................................................................................................................669.7. CreateanewpartitioninUbuntu.................................................................................................................................679.8. ExpandcapacityunderLVM...........................................................................................................................................69

Page 3: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

5

1. Basiccomponentsinstallation

http://docs.openstack.org/liberty/install-guide-ubuntu/index.html AllpreparationandmaintenancestepsforUbuntuaredescribedinAppendix.

1.1. Packages

Performtheseproceduresonallnodes.

root@controller:~#apt-getinstallsoftware-properties-common…0upgraded,0newlyinstalled,0toremoveand3notupgraded.root@controller:~#add-apt-repositorycloud-archive:liberty…Processingubuntu-cloud.archive.canonical.comremovalkeyringgpg:/etc/apt/trustdb.gpg:trustdbcreatedOKroot@controller:~#apt-getupdate&&apt-getdist-upgrade…Settinguppython-requests(2.7.0-3~cloud0)...Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...root@controller:~#apt-getinstallpython-openstackclient…Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...

1.2. SQLDB

Thedatabasetypicallyrunsonthecontrollernode.

root@controller:~#apt-getinstallmariadb-serverpython-pymysql…Doyouwanttocontinue?[Y/n]Get:1http://ubuntu-cloud.archive.canonical.com/ubuntu/trusty-updates/liberty/mainpython-pymysqlall0.6.2-2~cloud0[46.5kB]…

Page 4: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

6

…Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...

Note:

TheMariaDB/MySQLtoolsreadconfigurationfilesinthefollowingorder:

1."/etc/mysql/mariadb.cnf"(thisfile)tosetglobaldefaults,

2."/etc/mysql/conf.d/*.cnf"tosetglobaloptions.

3."/etc/mysql/mariadb.conf.d/*.cnf"tosetMariaDB-onlyoptions.

4."~/.my.cnf"tosetuser-specificoptions.

Ifthesameoptionisdefinedmultipletimes,thelastonewillapply.

root@controller:~#vi/etc/mysql/conf.d/mysqld_openstack.cnf[mysqld]bind-address=10.76.246.115default-storage-engine=innodbinnodb_file_per_tablecollation-server=utf8_general_ciinit-connect='SETNAMESutf8'character-set-server=utf8

• Restartthedatabaseservice

root@controller:~#servicemysqlrestart*StoppingMariaDBdatabaseservermysqld[OK]*StartingMariaDBdatabaseservermysqld[OK]*Checkingforcorrupt,notcleanlyclosedandupgradeneedingtables.

• Securethedatabaseservice

root@controller:~#mysql_secure_installation/usr/bin/mysql_secure_installation:379:/usr/bin/mysql_secure_installation:find_mysql_client:notfoundNOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMariaDBSERVERSINPRODUCTIONUSE!PLEASEREADEACHSTEPCAREFULLY!InordertologintoMariaDBtosecureit,we'llneedthecurrentpasswordfortherootuser.Ifyou'vejustinstalledMariaDB,and

Page 5: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

7

youhaven'tsettherootpasswordyet,thepasswordwillbeblank,soyoushouldjustpressenterhere.Entercurrentpasswordforroot(enterfornone):OK,successfullyusedpassword,movingon...SettingtherootpasswordensuresthatnobodycanlogintotheMariaDBrootuserwithouttheproperauthorisation.Youalreadyhavearootpasswordset,soyoucansafelyanswer'n'.Changetherootpassword?[Y/n]Newpassword:Re-enternewpassword:Passwordupdatedsuccessfully!Reloadingprivilegetables.....Success!Bydefault,aMariaDBinstallationhasananonymoususer,allowinganyonetologintoMariaDBwithouthavingtohaveauseraccountcreatedforthem.Thisisintendedonlyfortesting,andtomaketheinstallationgoabitsmoother.Youshouldremovethembeforemovingintoaproductionenvironment.Removeanonymoususers?[Y/n]...Success!Normally,rootshouldonlybeallowedtoconnectfrom'localhost'.Thisensuresthatsomeonecannotguessattherootpasswordfromthenetwork.Disallowrootloginremotely?[Y/n]...Success!Bydefault,MariaDBcomeswithadatabasenamed'test'thatanyonecanaccess.Thisisalsointendedonlyfortesting,andshouldberemovedbeforemovingintoaproductionenvironment.Removetestdatabaseandaccesstoit?[Y/n]-Droppingtestdatabase...ERROR1008(HY000)atline1:Can'tdropdatabase'test';databasedoesn'texist...Failed!Notcritical,keepmoving...-Removingprivilegesontestdatabase......Success!Reloadingtheprivilegetableswillensurethatallchangesmadesofarwilltakeeffectimmediately.Reloadprivilegetablesnow?[Y/n]...Success!Cleaningup...

Page 6: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

8

Alldone!Ifyou'vecompletedalloftheabovesteps,yourMariaDBinstallationshouldnowbesecure.ThanksforusingMariaDB!

1.3. MongoDB(forTelemetry)

TheTelemetryserviceusesaNoSQLdatabasetostoreinformation.Thedatabasetypicallyrunsonthe

controllernode.

• InstalltheMongoDBpackages

root@controller:~#apt-getinstallmongodb-servermongodb-clientspython-pymongo…Processingtriggersforureadahead(0.100.0-16)...

• Editthe/etc/mongodb.conf

bind_ip=10.76.246.115smallfiles=true

• RestartMongoDB

root@controller:~#servicemongodbrestartmongodbstop/waitingmongodbstart/running,process21516

1.4. RabbitMQ

Themessagequeueservicetypicallyrunsonthecontrollernode.

• Installthepackage

root@controller:~#apt-getinstallrabbitmq-server…Processingtriggersforureadahead(0.100.0-16)...

• Addtheopenstackuser

root@controller:~#rabbitmqctladd_useropenstackP@ssw0rdCreatinguser"openstack"...

• Permitconfiguration,write,andreadaccessfortheopenstackuser

root@controller:~#rabbitmqctlset_permissionsopenstack".*"".*"".*"Settingpermissionsforuser"openstack"invhost"/"...

Page 7: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

9

2. Keystone

http://docs.openstack.org/liberty/install-guide-ubuntu/keystone.html TheKeystonerunsonthecontrollernode.

2.1. CreatetheKeystonedatabase

root@controller:~#mysql-uroot-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis36Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[(none)]>CREATEDATABASEkeystone;QueryOK,1rowaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONkeystone.*TO'keystone'@'localhost'IDENTIFIEDBY‘P@ssw0rd';QueryOK,0rowsaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONkeystone.*TO'keystone'@'%'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)

• CheckifkeystoneusercanconnecttosqlDB

root@controller:~#mysql-hlocalhost-P1377-Dkeystone-ukeystone-pP@ssw0rdReadingtableinformationforcompletionoftableandcolumnnamesYoucanturnoffthisfeaturetogetaquickerstartupwith-AWelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis48Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[keystone]>

Page 8: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

10

2.2. InstallpackagesandconfigureKeystone

• Disablethekeystoneservicefromstartingautomaticallyafterinstallation

root@controller:~#echo"manual">/etc/init/keystone.override

• Installthepackages

root@controller:~#apt-getinstallkeystoneapache2libapache2-mod-wsgimemcachedpython-memcacheReadingpackagelists...DoneBuildingdependencytree…Processingtriggersforufw(0.34~rc-0ubuntu2)...

• Generatearandomvaluetouseastheadministrationtokenduringinitialconfiguration

root@controller:~#opensslrand-hex10406421e15156cd3bbd43

• Editthekeystone.conffile

Parameters’detailsarehere:http://docs.openstack.org/liberty/install-guide-ubuntu/keystone-install.html

root@controller:~#vi/etc/keystone/keystone.conf[DEFAULT]admin_token=406421e15156cd3bbd43[database]…connection=mysql+pymysql://keystone:P@ssw0rd@controller/keystone[memcache]servers=localhost:11211[token]provider=uuiddriver=memcache[revoke]...driver=sql

Comment#sqlite_db=oslo.sqlite#sqlite_synchronous=true#backend=sqlalchemy

• Checkthatkeystoneisstopped(WeneedtorunthekeystoneserverwithinApacheratherthan

fromthescript)

root@controller:~#servicekeystonestopkeystonestop/waiting

Page 9: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

11

• PopulatetheIdentityservicedatabase

root@controller:~#su-s/bin/sh-c"keystone-managedb_sync"keystone2015-12-1922:08:05.62628354INFOmigrate.versioning.api[-]43->44...2015-12-1922:08:06.74028354INFOmigrate.versioning.api[-]done…2015-12-1922:08:12.19328354INFOmigrate.versioning.api[-]1->2...2015-12-1922:08:13.05228354INFOmigrate.versioning.api[-]done

Note:

IfyougettheSQLconnectionfailederror,

2015-12-2300:56:40.4397942WARNINGoslo_db.sqlalchemy.engines[-]SQLconnectionfailed.10attemptsleft.2015-12-2300:56:50.4497942WARNINGoslo_db.sqlalchemy.engines[-]SQLconnectionfailed.9attemptsleft.-Checkconnectionlinecredentialsinthekeystone.conf

-CheckpasswordyouspecifiedinGRANTALLPRIVILEGESONkeystonecommand

2.3. ConfigureApache

Forperformance,thisconfigurationdeploystheApacheHTTPservertohandlerequestsand

MemcachedtostoretokensinsteadofanSQLdatabase.

• ConfiguretheServerNameoptiontoreferencethecontrollernode

root@controller:~#vi/etc/apache2/apache2.confServerNamecontroller

• Createthewsgi-keystone.conffile

root@controller:~#vi/etc/apache2/sites-available/wsgi-keystone.confListen5000Listen35357<VirtualHost*:5000>WSGIDaemonProcesskeystone-publicprocesses=5threads=1user=keystonegroup=keystonedisplay-name=%{GROUP}WSGIProcessGroupkeystone-publicWSGIScriptAlias//usr/bin/keystone-wsgi-publicWSGIApplicationGroup%{GLOBAL}WSGIPassAuthorizationOn<IfVersion>=2.4>ErrorLogFormat"%{cu}t%M"</IfVersion>ErrorLog/var/log/apache2/keystone.logCustomLog/var/log/apache2/keystone_access.logcombined

Page 10: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

12

<Directory/usr/bin><IfVersion>=2.4>Requireallgranted</IfVersion><IfVersion<2.4>Orderallow,denyAllowfromall</IfVersion></Directory></VirtualHost><VirtualHost*:35357>WSGIDaemonProcesskeystone-adminprocesses=5threads=1user=keystonegroup=keystonedisplay-name=%{GROUP}WSGIProcessGroupkeystone-adminWSGIScriptAlias//usr/bin/keystone-wsgi-adminWSGIApplicationGroup%{GLOBAL}WSGIPassAuthorizationOn<IfVersion>=2.4>ErrorLogFormat"%{cu}t%M"</IfVersion>ErrorLog/var/log/apache2/keystone.logCustomLog/var/log/apache2/keystone_access.logcombined<Directory/usr/bin><IfVersion>=2.4>Requireallgranted</IfVersion><IfVersion<2.4>Orderallow,denyAllowfromall</IfVersion></Directory></VirtualHost>

• EnabletheIdentityservicevirtualhosts

root@controller:~#ln-s/etc/apache2/sites-available/wsgi-keystone.conf/etc/apache2/sites-enabled

• RestarttheApacheHTTPserver

Note:

Ifthereareerrorsonports5000and35357checkifkeystoneserviceisnotrunning)

Admin-roleAPI--->35357

Member-roleAPI----->5000

root@controller:~#serviceapache2start*Startingwebserverapache2

Page 11: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

13

root@controller:~#lsof–iCOMMANDPIDUSERFDTYPEDEVICESIZE/OFFNODENAMEsshd834root3uIPv4100440t0TCP*:ssh(LISTEN)sshd834root4uIPv6100460t0TCP*:ssh(LISTEN)chronyd2069root1uIPv4129050t0UDP*:ntpchronyd2069root2uIPv6129060t0UDP*:ntpchronyd2069root3uIPv4129070t0UDP*:323chronyd2069root5uIPv6129080t0UDP*:323sshd10032root3uIPv4809290t0TCPcontroller:ssh->atsasteinr2l3c.corp.emc.com:55439(ESTABLISHED)sshd10133vipr3uIPv4809290t0TCPcontroller:ssh->atsasteinr2l3c.corp.emc.com:55439(ESTABLISHED)apache212310root4uIPv6871990t0TCP*:http(LISTEN)apache212310root6uIPv6872050t0TCP*:5000(LISTEN)apache212310root8uIPv6872090t0TCP*:35357(LISTEN)apache212323www-data4uIPv6871990t0TCP*:http(LISTEN)apache212323www-data6uIPv6872050t0TCP*:5000(LISTEN)apache212323www-data8uIPv6872090t0TCP*:35357(LISTEN)apache212324www-data4uIPv6871990t0TCP*:http(LISTEN)apache212324www-data6uIPv6872050t0TCP*:5000(LISTEN)apache212324www-data8uIPv6872090t0TCP*:35357(LISTEN)mysqld20712mysql13uIPv4330770t0TCPcontroller:mysql(LISTEN)mongod21516mongodb9uIPv4340530t0TCPcontroller:27017(LISTEN)mongod21516mongodb10uIPv4340540t0TCPcontroller:28017(LISTEN)epmd22318rabbitmq3uIPv6349200t0TCP*:epmd(LISTEN)epmd22318rabbitmq4uIPv6351090t0TCPlocalhost:epmd->localhost:40665(ESTABLISHED)beam22346rabbitmq6uIPv4351060t0TCP*:25672(LISTEN)beam22346rabbitmq7uIPv4351080t0TCPlocalhost:40665->localhost:epmd(ESTABLISHED)beam22346rabbitmq16uIPv6352150t0TCP*:amqp(LISTEN)memcached26052memcache26uIPv4409890t0TCPlocalhost:11211(LISTEN)memcached26052memcache27uIPv4409900t0UDPlocalhost:11211

• RemovetheSQLitedatabasefile

Bydefault,theUbuntupackagescreateanSQLitedatabase.BecausethisconfigurationusesanSQL

databaseserver,youcanremovetheSQLitedatabasefile.

root@controller:~#rm-f/var/lib/keystone/keystone.db

2.4. CreatetheserviceentityandAPIendpoints

• Configuretheauthenticationtoken

root@controller:~#exportOS_TOKEN=406421e15156cd3bbd43• ConfiguretheendpointURL

root@controller:~#exportOS_URL=http://controller:35357/v3• ConfiguretheIdentityAPIversion

root@controller:~#exportOS_IDENTITY_API_VERSION=3

Page 12: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

14

• CreatetheserviceentityfortheIdentityservice

root@controller:~#openstackservicecreate--namekeystone--description"OpenStackIdentity"identity+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|OpenStackIdentity||enabled|True||id|8cb5a6fa6c194526b2d3456f7289fc94||name|keystone||type|identity|+-------------+----------------------------------+oot@controller:~#openstackservicelist+----------------------------------+----------+----------+|ID|Name|Type|+----------------------------------+----------+----------+|8cb5a6fa6c194526b2d3456f7289fc94|keystone|identity|+----------------------------------+----------+----------+

• CreatetheIdentityserviceAPIendpoints

oot@controller:~#openstackendpointcreate--regionRegionOneidentitypublichttp://controller:5000/v2.0+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|d52a4c6f94dc4452a033d0438d1e47bf||interface|public||region|RegionOne||region_id|RegionOne||service_id|8cb5a6fa6c194526b2d3456f7289fc94||service_name|keystone||service_type|identity||url|http://controller:5000/v2.0|+--------------+----------------------------------+root@controller:~#openstackendpointcreate--regionRegionOneidentityinternalhttp://controller:5000/v2.0+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|e46d826828554810920150b4b165b9d0||interface|internal||region|RegionOne||region_id|RegionOne||service_id|8cb5a6fa6c194526b2d3456f7289fc94||service_name|keystone||service_type|identity||url|http://controller:5000/v2.0|+--------------+----------------------------------+

Page 13: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

15

root@controller:~#openstackendpointcreate--regionRegionOneidentityadminhttp://controller:35357/v2.0+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|ce481872a0fd46ea8c93a5720c3df94f||interface|admin||region|RegionOne||region_id|RegionOne||service_id|8cb5a6fa6c194526b2d3456f7289fc94||service_name|keystone||service_type|identity||url|http://controller:35357/v2.0|+--------------+----------------------------------+

• CheckDB

root@controller:~#mysql-uroot-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis57Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[(none)]>usekeystone;ReadingtableinformationforcompletionoftableandcolumnnamesYoucanturnoffthisfeaturetogetaquickerstartupwith-ADatabasechangedMariaDB[keystone]>showtables;+------------------------+|Tables_in_keystone|+------------------------+|access_token||assignment||config_register||consumer||credential||domain||endpoint||endpoint_group||federation_protocol||group||id_mapping||identity_provider||idp_remote_ids||mapping||migrate_version||policy|

Page 14: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

16

|policy_association||project||project_endpoint||project_endpoint_group||region||request_token||revocation_event||role||sensitive_config||service||service_provider||token||trust||trust_role||user||user_group_membership||whitelisted_config|+------------------------+33rowsinset(0.00sec)MariaDB[keystone]>select*fromservice;+----------------------------------+----------+---------+-----------------------------------------------------------+|id|type|enabled|extra|+----------------------------------+----------+---------+-----------------------------------------------------------+|8cb5a6fa6c194526b2d3456f7289fc94|identity|1|{"description":"OpenStackIdentity","name":"keystone"}|+----------------------------------+----------+---------+-----------------------------------------------------------+1rowinset(0.00sec)MariaDB[keystone]>select*fromendpoint;+----------------------------------+--------------------+-----------+----------------------------------+------------------------------+-------+---------+-----------+|id|legacy_endpoint_id|interface|service_id|url|extra|enabled|region_id|+----------------------------------+--------------------+-----------+----------------------------------+------------------------------+-------+---------+-----------+|ce481872a0fd46ea8c93a5720c3df94f|NULL|admin|8cb5a6fa6c194526b2d3456f7289fc94|http://controller:35357/v2.0|{}|1|RegionOne||d52a4c6f94dc4452a033d0438d1e47bf|NULL|public|8cb5a6fa6c194526b2d3456f7289fc94|http://controller:5000/v2.0|{}|1|RegionOne||e46d826828554810920150b4b165b9d0|NULL|internal|8cb5a6fa6c194526b2d3456f7289fc94|http://controller:5000/v2.0|{}|1|RegionOne|+----------------------------------+--------------------+-----------+----------------------------------+------------------------------+-------+---------+-----------+3rowsinset(0.01sec)

Page 15: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

17

2.5. Createprojects,users,androles

Theauthenticationserviceusesacombinationofdomains,projects(tenants),users,androles.

• Createtheadminproject

root@controller:~#openstackprojectcreate--domaindefault--description"AdminProject"admin+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|AdminProject||domain_id|default||enabled|True||id|b928829df79d49cf889488847873f515||is_domain|False||name|admin||parent_id|None|+-------------+----------------------------------+

• Createtheadminuser

root@controller:~#openstackusercreate--domaindefault--password-promptadminUserPassword:RepeatUserPassword:+-----------+----------------------------------+|Field|Value|+-----------+----------------------------------+|domain_id|default||enabled|True||id|a826b162d99b41deaa85d7518bfefa77||name|admin|+-----------+----------------------------------+

• Createtheadminrole

root@controller:~#openstackrolecreateadmin+-------+----------------------------------+|Field|Value|+-------+----------------------------------+|id|1d6089a65b554d54bb2f6c7d26958767||name|admin|+-------+----------------------------------+

• Addtheadminroletotheadminprojectanduser

root@controller:~#openstackroleadd--projectadmin--useradminadmin

Note:

Anyrolesthatyoucreatemustmaptorolesspecifiedinthepolicy.jsonfileintheconfigurationfile

directoryofeachOpenStackservice.Thedefaultpolicyformostservicesgrantsadministrativeaccessto

theadminrole.Formoreinformation,seetheOperationsGuide-ManagingProjectsandUsers.

Page 16: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

18

• Createtheserviceanddemoprojects(Tenants)

root@controller:~#openstackprojectcreate--domaindefault--description"ServiceProject"service+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|ServiceProject||domain_id|default||enabled|True||id|d6206c1b24274f93818db8bee1f013b2||is_domain|False||name|service||parent_id|None|+-------------+----------------------------------+root@controller:~#openstackprojectcreate--domaindefault--description"DemoProject"demo+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|DemoProject||domain_id|default||enabled|True||id|c732a6de680b4b78b76a7b777286e79b||is_domain|False||name|demo||parent_id|None|+-------------+----------------------------------+

• Createthedemouser

root@controller:~#openstackusercreate--domaindefault--password-promptdemoUserPassword:RepeatUserPassword:+-----------+----------------------------------+|Field|Value|+-----------+----------------------------------+|domain_id|default||enabled|True||id|94ff2f8fea394d67b096a16e07dd4a14||name|demo|+-----------+----------------------------------+

• Createtheuserrole

root@controller:~#openstackrolecreateuser+-------+----------------------------------+|Field|Value|+-------+----------------------------------+|id|c8fa9fb10dd749428246fe366903d80c||name|user|+-------+----------------------------------+

Page 17: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

19

• Addtheuserroletothedemoprojectanduser

root@controller:~#openstackroleadd--projectdemo--userdemouser

2.6. VerifyKeystoneoperation

VerifyoperationoftheIdentityservicebeforeinstallingotherservices.

• Forsecurityreasons,disablethetemporaryauthenticationtokenmechanism(remove

admin_token_authfromthe[pipeline:public_api],[pipeline:admin_api],and[pipeline:api_v3]

sections)

root@controller:~#vi/etc/keystone/keystone-paste.ini

• Astheadminuser,requestanauthenticationtoken

root@controller:~#openstack--os-auth-urlhttp://controller:35357/v3--os-project-domain-iddefault--os-user-domain-iddefault--os-project-nameadmin--os-usernameadmin--os-auth-typepasswordtokenissuePassword:+------------+----------------------------------+|Field|Value|+------------+----------------------------------+|expires|2015-12-20T18:01:35.806295Z||id|7f67fb8a76784a1191e82ee04f76917b||project_id|b928829df79d49cf889488847873f515||user_id|a826b162d99b41deaa85d7518bfefa77|+------------+----------------------------------+

• Asthedemouser,requestanauthenticationtoken

root@controller:~#openstack--os-auth-urlhttp://controller:5000/v3--os-project-domain-iddefault--os-user-domain-iddefault--os-project-namedemo--os-usernamedemo--os-auth-typepasswordtokenissuePassword:+------------+----------------------------------+|Field|Value|+------------+----------------------------------+|expires|2015-12-20T18:03:41.944496Z||id|1e091aaf7e354ec78419b65a0b88bb71||project_id|c732a6de680b4b78b76a7b777286e79b||user_id|94ff2f8fea394d67b096a16e07dd4a14|+------------+----------------------------------+

Note:

ThiscommandusesthepasswordforthedemouserandAPIport5000whichonlyallowsregular(non-

admin)accesstotheIdentityserviceAPI.

Page 18: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

20

2.7. CreateOpenStackclientenvironmentscripts

Toincreaseefficiencyofclientoperations,OpenStacksupportssimpleclientenvironmentscriptsalso

knownasOpenRCfiles.Formoreinformation,seetheOpenStackUserGuide.

• Edittheadmin-openrc.shanddemo-openrc.sh

root@controller:~#pwd/rootroot@controller:~#viadmin-openrc.shexportOS_PROJECT_DOMAIN_ID=defaultexportOS_USER_DOMAIN_ID=defaultexportOS_PROJECT_NAME=adminexportOS_TENANT_NAME=adminexportOS_USERNAME=adminexportOS_PASSWORD=P@ssw0rdexportOS_AUTH_URL=http://controller:35357/v3exportOS_IDENTITY_API_VERSION=3root@controller:~#videmo-openrc.shexportOS_PROJECT_DOMAIN_ID=defaultexportOS_USER_DOMAIN_ID=defaultexportOS_PROJECT_NAME=demoexportOS_TENANT_NAME=demoexportOS_USERNAME=demoexportOS_PASSWORD=P@ssw0rdexportOS_AUTH_URL=http://controller:5000/v3exportOS_IDENTITY_API_VERSION=3

• Torunclientsasaspecificprojectanduser,youcansimplyloadtheassociatedclient

environmentscriptpriortorunningthem.

root@controller:~#sourceadmin-openrc.shroot@controller:~#openstacktokenissue+------------+----------------------------------+|Field|Value|+------------+----------------------------------+|expires|2015-12-22T05:49:02.977485Z||id|f2e15e18e5304dd79e65e81a2e44034f||project_id|b928829df79d49cf889488847873f515||user_id|a826b162d99b41deaa85d7518bfefa77|+------------+----------------------------------+

Page 19: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

21

3. Glance

http://docs.openstack.org/liberty/install-guide-ubuntu/glance.html IinstallGlanceonthecontrollernode.

3.1. CreateGlanceDatabase

root@controller:~#mysql-uroot-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis28Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[(none)]>CREATEDATABASEglance;QueryOK,1rowaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONglance.*TO'glance'@'localhost'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONglance.*TO'glance'@'%'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)

• CheckDBaccessforuserglance

root@controller:~#mysql-hlocalhost-P1377-Dglance-uglance-pP@ssw0rdWelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis50Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[glance]>

3.2. CreatetheuserandserviceentityandAPIendpoints

• Sourcetheadmincredentialstogainaccesstoadmin-onlyCLIcommands.

• Createtheglanceuser.

Page 20: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

22

root@controller:~#sourceadmin-openrc.shroot@controller:~#openstackusercreate--domaindefault--password-promptglanceUserPassword:RepeatUserPassword:+-----------+----------------------------------+|Field|Value|+-----------+----------------------------------+|domain_id|default||enabled|True||id|3c045b963d744d66a1722e50df527e08||name|glance|+-----------+----------------------------------+

• Addtheadminroletotheglanceuserandserviceproject.

root@controller:~#openstackroleadd--projectservice--userglanceadmin

• Createtheglanceserviceentity

root@controller:~#openstackservicecreate--nameglance--description"OpenStackImageservice"image+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|OpenStackImageservice||enabled|True||id|2056569913d34961aeaedb064466f6bf||name|glance||type|image|+-------------+----------------------------------+

• CreatetheImageserviceAPIendpoints

root@controller:~#openstackendpointcreate--regionRegionOneimagepublichttp://controller:9292+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|5cf4121c44604115b67a55532a51b079||interface|public||region|RegionOne||region_id|RegionOne||service_id|2056569913d34961aeaedb064466f6bf||service_name|glance||service_type|image||url|http://controller:9292|+--------------+----------------------------------+root@controller:~#openstackendpointcreate--regionRegionOneimageinternalhttp://controller:9292+--------------+----------------------------------+|Field|Value|

Page 21: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

23

+--------------+----------------------------------+|enabled|True||id|7198ec98284d4434a0c1f00e48cc3a09||interface|internal||region|RegionOne||region_id|RegionOne||service_id|2056569913d34961aeaedb064466f6bf||service_name|glance||service_type|image||url|http://controller:9292|+--------------+----------------------------------+root@controller:~#openstackendpointcreate--regionRegionOneimageadminhttp://controller:9292+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|5690241795fa4a9ab41e4da9128e955f||interface|admin||region|RegionOne||region_id|RegionOne||service_id|2056569913d34961aeaedb064466f6bf||service_name|glance||service_type|image||url|http://controller:9292|+--------------+----------------------------------+

3.3. InstallpackagesandconfigureGlance

root@controller:~#apt-getinstallglancepython-glanceclientReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...

• Editthe/etc/glance/glance-api.conffile

Parameters’detailsarehere:http://docs.openstack.org/liberty/install-guide-ubuntu/glance-install.html

root@controller:~#vi/etc/glance/glance-api.conf[DEFAULT]...notification_driver=noop…[database]connection=mysql+pymysql://glance:P@ssw0rd@controller/glance…[keystone_authtoken]auth_uri=http://controller:5000auth_url=http://controller:35357auth_plugin=password

Page 22: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

24

project_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=glancepassword=P@ssw0rd…[paste_deploy]flavor=keystone…[glance_store]default_store=filefilesystem_store_datadir=/var/lib/glance/images/…

Comment##sqlite_db=/var/lib/glance/glance.sqlite#backend=sqlalchemy

• Editthe/etc/glance/glance-registry.conffile

root@controller:~#vi/etc/glance/glance-registry.conf[DEFAULT]notification_driver=noop…[database]connection=mysql+pymysql://glance:P@ssw0rd@controller/glance…[keystone_authtoken]auth_uri=http://controller:5000auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=glancepassword=P@ssw0rd…[paste_deploy]flavor=keystone

• PopulatetheImageservicedatabase

root@controller:~#/bin/sh-c"glance-managedb_sync"glance2015-12-2308:32:45.30313863INFOmigrate.versioning.api[-]0->1...2015-12-2308:32:45.31513863INFOglance.db.sqlalchemy.migrate_repo.schema[-]creatingtableimages2015-12-2308:32:45.43213863INFOmigrate.versioning.api[-]done2015-12-2308:32:45.43313863INFOmigrate.versioning.api[-]1->2...2015-12-2308:32:45.45213863INFOglance.db.sqlalchemy.migrate_repo.schema[-]creatingtableimage_properties…2015-12-2308:32:53.26213863INFOmigrate.versioning.api[-]41->42...2015-12-2308:32:54.27713863INFOmigrate.versioning.api[-]done

Page 23: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

25

Note:

TofixValueError:unknownlocale:UTF-8youjustneedtospecifyLC_TYPE.

Traceback(mostrecentcalllast):File"/usr/bin/glance-manage",line6,in<module>fromglance.cmd.manageimportmain…File"/usr/lib/python2.7/locale.py",line475,in_parse_localenameraiseValueError,'unknownlocale:%s'%localenameValueError:unknownlocale:UTF-8root@controller:~#declare-xLC_CTYPE="C"

Note:

IfyougettheSQLconnectionfailederror,

2015-12-2300:56:40.4397942WARNINGoslo_db.sqlalchemy.engines[-]SQLconnectionfailed.10attemptsleft.2015-12-2300:56:50.4497942WARNINGoslo_db.sqlalchemy.engines[-]SQLconnectionfailed.9attemptsleft.-Checkconnectionlinecredentialsintheglance-api.confandglance-registry.conf

-CheckpasswordyouspecifiedinGRANTALLPRIVILEGESONglancecommand

• RestarttheImageserviceservices

root@controller:~#serviceglance-registryrestartglance-registrystop/waitingglance-registrystart/running,process13911root@controller:~#serviceglance-apirestartglance-apistop/waitingglance-apistart/running,process13940

• RemovetheSQLitedatabasefile

root@controller:~#rm-f/var/lib/glance/glance.sqlite

3.4. VerifyGlanceoperation

VerifyoperationoftheImageserviceusingCirrOS,asmallLinuximagethathelpsyoutestyour

OpenStackdeployment.

Page 24: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

26

• ConfiguretheImageserviceclienttouseAPIversion2.0

root@controller:~#echo"exportOS_IMAGE_API_VERSION=2"|tee-aadmin-openrc.shdemo-openrc.shexportOS_IMAGE_API_VERSION=2root@controller:~#catadmin-openrc.shexportOS_PROJECT_DOMAIN_ID=defaultexportOS_USER_DOMAIN_ID=defaultexportOS_PROJECT_NAME=adminexportOS_TENANT_NAME=adminexportOS_USERNAME=adminexportOS_PASSWORD=P@ssw0rdexportOS_AUTH_URL=http://controller:35357/v3exportOS_IDENTITY_API_VERSION=3exportOS_IMAGE_API_VERSION=2root@controller:~#sourceadmin-openrc.sh

• DownloadtheCirrosOSimage

root@controller:~#wgethttp://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img--2015-12-2308:57:20--http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.imgResolvingdownload.cirros-cloud.net(download.cirros-cloud.net)...69.163.241.114Connectingtodownload.cirros-cloud.net(download.cirros-cloud.net)|69.163.241.114|:80...connected.HTTPrequestsent,awaitingresponse...200OKLength:13287936(13M)[text/plain]Savingto:'cirros-0.3.4-x86_64-disk.img'100%[=================================>]13,287,936788KB/sin17s2015-12-2308:57:49(774KB/s)-'cirros-0.3.4-x86_64-disk.img'saved[13287936/13287936]

• UploadtheimagetotheImageserviceusingtheQCOW2diskformat,barecontainerformat.

• Configurepublicvisibilitysoallprojectscanaccesstheimage.

root@controller:~#glanceimage-create--name"cirros"--filecirros-0.3.4-x86_64-disk.img--disk-formatqcow2--container-formatbare--visibilitypublic--progress[=============================>]100%+------------------+--------------------------------------+|Property|Value|+------------------+--------------------------------------+|checksum|ee1eca47dc88f4879d8a229cc70a07c6||container_format|bare||created_at|2015-12-23T06:00:37Z||disk_format|qcow2||id|a77342a4-1479-44d4-91cf-a3174352ecbd||min_disk|0||min_ram|0||name|cirros||owner|b928829df79d49cf889488847873f515||protected|False|

Page 25: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

27

|size|13287936||status|active||tags|[]||updated_at|2015-12-23T06:00:38Z||virtual_size|None||visibility|public|+------------------+--------------------------------------+root@controller:~#rmcirros-0.3.4-x86_64-disk.img

Note:

glanceimage-createparameters:http://docs.openstack.org/cli-

reference/content/glanceclient_commands.html#glanceclient_subcommand_image-create_v2

Diskandcontainerformatsforimages:http://docs.openstack.org/image-guide/content/image-

formats.html

• Confirmuploadoftheimage.

root@controller:~#glanceimage-list+--------------------------------------+--------+|ID|Name|+--------------------------------------+--------+|a77342a4-1479-44d4-91cf-a3174352ecbd|cirros|+--------------------------------------+--------+

Page 26: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

28

4. Nova

http://docs.openstack.org/liberty/install-guide-ubuntu/common/get_started_compute.html

4.1. CreateNovaDatabase

Onthecontrollernode.

root@controller:~#mysql-uroot-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis58Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[(none)]>CREATEDATABASEnova;QueryOK,1rowaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONnova.*TO'nova'@'localhost'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONnova.*TO'nova'@'%'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)

Onthecomputenode.

• CheckDBaccess.

root@compute1:~#apt-getinstallmariadb-client-core-5.5Readingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...root@compute1:~#mysql-hcontroller-Dnova-unova-pEnterpassword:ReadingtableinformationforcompletionoftableandcolumnnamesYoucanturnoffthisfeaturetogetaquickerstartupwith-AWelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis87Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.

Page 27: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

29

Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[nova]>

4.2. CreatetheuserandserviceentityandAPIendpoints

Onthecontrollernode.

• Sourcetheadmincredentialstogainaccesstoadmin-onlyCLIcommands.

• Createthenovauser.

root@controller:~#sourceadmin-openrc.shroot@controller:~#openstackusercreate--domaindefault--password-promptnovaUserPassword:RepeatUserPassword:+-----------+----------------------------------+|Field|Value|+-----------+----------------------------------+|domain_id|default||enabled|True||id|7171548a0cb74852927512f88cba2d68||name|nova|+-----------+----------------------------------+

• Addtheadminroletothenovauserandserviceproject.

root@controller:~#openstackroleadd--projectservice--usernovaadmin

• Createthenovaserviceentity.

root@controller:~#openstackservicecreate--namenova--description"OpenStackCompute"compute+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|OpenStackCompute||enabled|True||id|b820db514d0a41b3b9ffdb1ef7d02fa3||name|nova||type|compute|+-------------+----------------------------------+

• CreatetheComputeserviceAPIendpoints.

root@controller:~#openstackendpointcreate--regionRegionOnecomputepublichttp://controller:8774/v2/%\(tenant_id\)s+--------------+-----------------------------------------+|Field|Value|+--------------+-----------------------------------------+|enabled|True|

Page 28: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

30

|id|a1f98d08c45a4f1cb30487e8ff2d0656||interface|public||region|RegionOne||region_id|RegionOne||service_id|b820db514d0a41b3b9ffdb1ef7d02fa3||service_name|nova||service_type|compute||url|http://controller:8774/v2/%(tenant_id)s|+--------------+-----------------------------------------+root@controller:~#openstackendpointcreate--regionRegionOnecomputeinternalhttp://controller:8774/v2/%\(tenant_id\)s+--------------+-----------------------------------------+|Field|Value|+--------------+-----------------------------------------+|enabled|True||id|d0a78e6a551e445c9cebf4477948ee89||interface|internal||region|RegionOne||region_id|RegionOne||service_id|b820db514d0a41b3b9ffdb1ef7d02fa3||service_name|nova||service_type|compute||url|http://controller:8774/v2/%(tenant_id)s|+--------------+-----------------------------------------+root@controller:~#openstackendpointcreate--regionRegionOnecomputeadminhttp://controller:8774/v2/%\(tenant_id\)s+--------------+-----------------------------------------+|Field|Value|+--------------+-----------------------------------------+|enabled|True||id|4322421abadc4aab92a2e93281c1e97b||interface|admin||region|RegionOne||region_id|RegionOne||service_id|b820db514d0a41b3b9ffdb1ef7d02fa3||service_name|nova||service_type|compute||url|http://controller:8774/v2/%(tenant_id)s|+--------------+-----------------------------------------+

4.3. InstallpackagesandconfigureNovaontheControllernode

Onthecontrollernode.

root@controller:~#apt-getinstallnova-apinova-certnova-conductornova-consoleauthnova-novncproxynova-schedulerpython-novaclientReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…

Page 29: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

31

Processingtriggersforureadahead(0.100.0-16)...

• Editthe/etc/nova/nova.conffile

Parameters’detailsarehere:http://docs.openstack.org/liberty/install-guide-ubuntu/nova-controller-

install.html

root@controller:~#vi/etc/nova/nova.conf[DEFAULT]rpc_backend=rabbitauth_strategy=keystonemy_ip=10.76.246.115network_api_class=nova.network.neutronv2.api.APIsecurity_group_api=neutronlinuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriverfirewall_driver=nova.virt.firewall.NoopFirewallDriverenabled_apis=osapi_compute,metadata[database]connection=mysql+pymysql://nova:P@ssw0rd@controller/nova[oslo_messaging_rabbit]rabbit_host=controllerrabbit_userid=openstackrabbit_password=P@ssw0rd[keystone_authtoken]auth_uri=http://controller:5000auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=novapassword=P@ssw0rd[vnc]vncserver_listen=$my_ipvncserver_proxyclient_address=$my_ip[glance]host=controller[oslo_concurrency]lock_path=/var/lib/nova/tmp

• PopulatetheNovadatabase

root@compute1:~#declare-xLC_CTYPE="C"root@compute1:~#sh-c"nova-managedbsync"novaNohandlerscouldbefoundforlogger"oslo_config.cfg"

Page 30: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

32

2015-12-2410:36:40.15122284INFOmigrate.versioning.api[-]215->216...2015-12-2410:37:02.39722284INFOmigrate.versioning.api[-]done…2015-12-2410:37:17.86622284INFOmigrate.versioning.api[-]301->302...2015-12-2410:37:17.87422284INFOmigrate.versioning.api[-]done

• RestarttheNovaservices

root@compute1:~#servicenova-apirestartnova-apistop/waitingnova-apistart/running,process22310root@compute1:~#servicenova-certrestartnova-certstop/waitingnova-certstart/running,process22343root@compute1:~#servicenova-consoleauthrestartnova-consoleauthstop/waitingnova-consoleauthstart/running,process22368root@compute1:~#servicenova-schedulerrestartnova-schedulerstop/waitingnova-schedulerstart/running,process22393root@compute1:~#servicenova-conductorrestartnova-conductorstop/waitingnova-conductorstart/running,process22418root@compute1:~#servicenova-novncproxyrestartnova-novncproxystop/waitingnova-novncproxystart/running,process22443

• RemovetheSQLitedatabasefile

root@compute1:~#rm-f/var/lib/nova/nova.sqlite

4.4. VerifyNovaoperationontheControllernode

• Listservicecomponentstoverifysuccessfullaunchandregistrationofeachprocess

root@compute1:~#sourceadmin-openrc.shroot@compute1:~#novaservice-list+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+|Id|Binary|Host|Zone|Status|State|Updated_at|DisabledReason|+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+|1|nova-cert|controller|internal|enabled|up|2015-12-28T07:02:19.000000|-||2|nova-consoleauth|controller|internal|enabled|up|2015-12-28T07:02:26.000000|-||3|nova-scheduler|controller|internal|enabled|up|2015-12-28T07:02:23.000000|-||4|nova-conductor|controller|internal|enabled|up|2015-12-28T07:02:18.000000|-|+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

Page 31: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

33

• ListAPIendpointsintheIdentityservicetoverifyconnectivitywiththeIdentityservice.

root@compute1:~#novaendpointsWARNING:glancehasnoendpointin!Availableendpointsforthisservice:+-----------+----------------------------------+|glance|Value|+-----------+----------------------------------+|id|5690241795fa4a9ab41e4da9128e955f||interface|admin||region|RegionOne||region_id|RegionOne||url|http://controller:9292|+-----------+----------------------------------++-----------+----------------------------------+|glance|Value|+-----------+----------------------------------+|id|5cf4121c44604115b67a55532a51b079||interface|public||region|RegionOne||region_id|RegionOne||url|http://controller:9292|+-----------+----------------------------------++-----------+----------------------------------+|glance|Value|+-----------+----------------------------------+|id|7198ec98284d4434a0c1f00e48cc3a09||interface|internal||region|RegionOne||region_id|RegionOne||url|http://controller:9292|+-----------+----------------------------------+WARNING:keystonehasnoendpointin!Availableendpointsforthisservice:+-----------+----------------------------------+|keystone|Value|+-----------+----------------------------------+|id|ce481872a0fd46ea8c93a5720c3df94f||interface|admin||region|RegionOne||region_id|RegionOne||url|http://controller:35357/v2.0|+-----------+----------------------------------++-----------+----------------------------------+|keystone|Value|+-----------+----------------------------------+|id|d52a4c6f94dc4452a033d0438d1e47bf||interface|public||region|RegionOne||region_id|RegionOne||url|http://controller:5000/v2.0|+-----------+----------------------------------++-----------+----------------------------------+|keystone|Value|+-----------+----------------------------------+

Page 32: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

34

|id|e46d826828554810920150b4b165b9d0||interface|internal||region|RegionOne||region_id|RegionOne||url|http://controller:5000/v2.0|+-----------+----------------------------------+WARNING:novahasnoendpointin!Availableendpointsforthisservice:+-----------+------------------------------------------------------------+|nova|Value|+-----------+------------------------------------------------------------+|id|4322421abadc4aab92a2e93281c1e97b||interface|admin||region|RegionOne||region_id|RegionOne||url|http://controller:8774/v2/b928829df79d49cf889488847873f515|+-----------+------------------------------------------------------------++-----------+------------------------------------------------------------+|nova|Value|+-----------+------------------------------------------------------------+|id|a1f98d08c45a4f1cb30487e8ff2d0656||interface|public||region|RegionOne||region_id|RegionOne||url|http://controller:8774/v2/b928829df79d49cf889488847873f515|+-----------+------------------------------------------------------------++-----------+------------------------------------------------------------+|nova|Value|+-----------+------------------------------------------------------------+|id|d0a78e6a551e445c9cebf4477948ee89||interface|internal||region|RegionOne||region_id|RegionOne||url|http://controller:8774/v2/b928829df79d49cf889488847873f515|+-----------+------------------------------------------------------------+

Note:

Ignoreanywarningsinthisoutput!

• ListimagesintheImageservicecatalogtoverifyconnectivitywiththeImageservice.

root@compute1:~#novaimage-list+--------------------------------------+--------+--------+--------+|ID|Name|Status|Server|+--------------------------------------+--------+--------+--------+|a77342a4-1479-44d4-91cf-a3174352ecbd|cirros|ACTIVE||+--------------------------------------+--------+--------+--------+

Page 33: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

35

4.1. InstallpackagesandconfigureNovaontheComputenode

Onthecompute1node.

• Installthepackages

root@compute1:~#apt-getinstallnova-computesysfsutilsReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…Done.Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...

• Editthe/etc/nova/nova.conffile

root@compute1:~#vi/etc/nova/nova.conf[DEFAULT]rpc_backend=rabbitauth_strategy=keystonemy_ip=10.76.246.117network_api_class=nova.network.neutronv2.api.APIsecurity_group_api=neutronlinuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriverfirewall_driver=nova.virt.firewall.NoopFirewallDriververbose=True[oslo_messaging_rabbit]rabbit_host=controllerrabbit_userid=openstackrabbit_password=P@ssw0rd[keystone_authtoken]auth_uri=http://controller:5000auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=novapassword=P@ssw0rd[vnc]enabled=Truevncserver_listen=0.0.0.0vncserver_proxyclient_address=$my_ipnovncproxy_base_url=http://controller:6080/vnc_auto.html[glance]host=controller[oslo_concurrency]

Page 34: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

36

lock_path=/var/lib/nova/tmp

• Determinewhetheryourcomputenodesupportshardwareaccelerationforvirtualmachines

root@compute1:~#egrep-c'(vmx|svm)'/proc/cpuinfo0

Note:

Thiscommandreturnsavalueofzero,sothecomputenodedoesnotsupporthardwareaccelerationandI

mustconfigurelibvirttouseQEMUinsteadofKVM

• Editthe[libvirt]sectioninthe/etc/nova/nova-compute.conffile.

[libvirt]virt_type=qemu…

• RestarttheComputeservice.

root@compute1:~#servicenova-computerestartnova-computestop/waitingnova-computestart/running,process24645

• RemovetheSQLitedatabasefile

root@compute1:~#rm-f/var/lib/nova/nova.sqlite

4.1. VerifyNovaoperationontheComputenode

• Listservicecomponentstoverifysuccessfullaunchandregistrationofeachprocess.

root@compute1:~#sourceadmin-openrc.shroot@compute1:~#novaservice-list+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+|Id|Binary|Host|Zone|Status|State|Updated_at|DisabledReason|+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+|1|nova-cert|controller|internal|enabled|up|2015-12-28T07:31:30.000000|-||2|nova-consoleauth|controller|internal|enabled|up|2015-12-28T07:31:37.000000|-||3|nova-scheduler|controller|internal|enabled|up|2015-12-28T07:31:34.000000|-||4|nova-conductor|controller|internal|enabled|up|2015-12-28T07:31:29.000000|-||5|nova-compute|compute1|nova|enabled|up|2015-12-28T07:31:30.000000|-|+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

Page 35: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

37

5. Neutron

http://docs.openstack.org/liberty/install-guide-

ubuntu/common/get_started_openstack_networking.html

5.1. CreateNeutronDatabase

Onthecontrollernode.

root@controller:~#mysql-uroot-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis84Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[(none)]>CREATEDATABASEneutron;QueryOK,1rowaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONneutron.*TO'neutron'@'localhost'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)MariaDB[(none)]>GRANTALLPRIVILEGESONneutron.*TO'neutron'@'%'IDENTIFIEDBY'P@ssw0rd';QueryOK,0rowsaffected(0.00sec)

• CheckDBaccess.

root@controller:~#apt-getinstallmariadb-client-core-5.5Readingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...root@controller:~#mysql-hcontroller-uneutron-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis85Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.

Page 36: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

38

MariaDB[(none)]>Byeroot@controller:~#mysql-hcontroller-Dneutron-uneutron-pEnterpassword:WelcometotheMariaDBmonitor.Commandsendwith;or\g.YourMariaDBconnectionidis88Serverversion:5.5.46-MariaDB-1ubuntu0.14.04.2(Ubuntu)Copyright(c)2000,2015,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.MariaDB[neutron]>

5.1. CreatetheuserandserviceentityandAPIendpoints

Onthecontrollernode.

• Sourcetheadmincredentialstogainaccesstoadmin-onlyCLIcommands.

• Createtheneutronuser.

root@controller:~#sourceadmin-openrc.shroot@controller:~#openstackusercreate--domaindefault--password-promptneutronUserPassword:RepeatUserPassword:+-----------+----------------------------------+|Field|Value|+-----------+----------------------------------+|domain_id|default||enabled|True||id|0724522523ab4667af7d7c76f8a7841a||name|neutron|+-----------+----------------------------------+

• Addtheadminroletotheneutronuserandserviceproject.

root@controller:~#openstackroleadd--projectservice--userneutronadmin

• Createtheneutronserviceentity.

root@controller:~#openstackroleadd--projectservice--userneutronadmin

• Createtheneutronserviceentity

root@controller:~#openstackservicecreate--nameneutron--description"OpenStackNetworking"network+-------------+----------------------------------+|Field|Value|+-------------+----------------------------------+|description|OpenStackNetworking||enabled|True||id|c643d3ca514e4cba99c19e0b9070c98b|

Page 37: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

39

|name|neutron||type|network|+-------------+----------------------------------+

• CreatetheComputeserviceAPIendpoints.

root@controller:~#openstackendpointcreate--regionRegionOnenetworkpublichttp://controller:9696+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|dc981a8db6214c9698962b1a8f432d63||interface|public||region|RegionOne||region_id|RegionOne||service_id|c643d3ca514e4cba99c19e0b9070c98b||service_name|neutron||service_type|network||url|http://controller:9696|+--------------+----------------------------------+root@controller:~#openstackendpointcreate--regionRegionOnenetworkinternalhttp://controller:9696+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|c776c68033e449958af9002d4a24c2c5||interface|internal||region|RegionOne||region_id|RegionOne||service_id|c643d3ca514e4cba99c19e0b9070c98b||service_name|neutron||service_type|network||url|http://controller:9696|+--------------+----------------------------------+root@controller:~#openstackendpointcreate--regionRegionOnenetworkadminhttp://controller:9696+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|b7d64b5d8eaf4190a2860cd24bbf1996||interface|admin||region|RegionOne||region_id|RegionOne||service_id|c643d3ca514e4cba99c19e0b9070c98b||service_name|neutron||service_type|network||url|http://controller:9696|+--------------+----------------------------------+

Page 38: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

40

Note:

Ifyouspecifiedthewronghostname,youcandeletetheendpoint

root@controller:~#openstackendpointcreate--regionRegionOnenetworkadminhttp://controller:9696+--------------+----------------------------------+|Field|Value|+--------------+----------------------------------+|enabled|True||id|39b7f6d4bc01406b9774885adcc01620||interface|admin||region|RegionOne||region_id|RegionOne||service_id|55181dec1dc8495490dc061b2d329edf||service_name|neutron||service_type|network||url|http://controller:9696|+--------------+----------------------------------+root@controller:~#openstackendpointdelete39b7f6d4bc01406b9774885adcc01620

5.2. InstallpackagesandconfigureNeutronontheControllernode

Self-servicenetworkingisinstalled(option2).

Onthecontrollernode.

• Installthecomponents

root@controller:~#apt-getinstallneutron-serverneutron-plugin-ml2neutron-plugin-linuxbridge-agentneutron-l3-agentneutron-dhcp-agentneutron-metadata-agentpython-neutronclientReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…Processingtriggersforureadahead(0.100.0-16)...

5.2.1. Configuretheservercomponent

• Editthe/etc/neutron/neutron.conffile

Parameters’detailsarehere:http://docs.openstack.org/liberty/install-guide-ubuntu/neutron-controller-

install-option2.html

root@controller:~#vi/etc/neutron/neutron.conf[DEFAULT]core_plugin=ml2service_plugins=routerallow_overlapping_ips=True

Page 39: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

41

rpc_backend=rabbitauth_strategy=keystonenotify_nova_on_port_status_changes=Truenotify_nova_on_port_data_changes=Truenova_url=http://controller:8774/v2…[database]connection=mysql+pymysql://neutron:P@ssw0rd@controller/neutron…[oslo_messaging_rabbit]rabbit_host=controllerrabbit_userid=openstackrabbit_password=P@ssw0rd…[keystone_authtoken]auth_uri=http://controller:5000auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=neutronpassword=P@ssw0rd#Commentoutorremoveanyotheroptionsinthe[keystone_authtoken]section.…[nova]auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultregion_name=RegionOneproject_name=serviceusername=novapassword=P@ssw0rd

5.2.2. ConfiguretheModularLayer2(ML2)plug-in

• Editthe/etc/neutron/plugins/ml2/ml2_conf.inifile

root@controller:~#vi/etc/neutron/plugins/ml2/ml2_conf.ini[ml2]type_drivers=flat,vlan,vxlantenant_network_types=vxlanmechanism_drivers=linuxbridge,l2populationextension_drivers=port_security…[ml2_type_flat]flat_networks=public…[ml2_type_vxlan]vni_ranges=1:1000

Page 40: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

42

…[securitygroup]enable_ipset=True

5.2.3. ConfiguretheLinuxbridgeagentontheNetworknode

• Editthe/etc/neutron/plugins/ml2/linuxbridge_agent.inifile

root@controller:~#ifconfigeth0Linkencap:EthernetHWaddr00:50:56:b8:1e:cbinetaddr:10.76.246.116Bcast:10.76.246.255Mask:255.255.255.0inet6addr:fe80::250:56ff:feb8:1ecb/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:1601710errors:0dropped:328778overruns:0frame:0TXpackets:48227errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:675732008(675.7MB)TXbytes:4618670(4.6MB)eth1Linkencap:EthernetHWaddr00:50:56:b8:c3:5einetaddr:192.168.5.116Bcast:192.168.5.255Mask:255.255.255.0inet6addr:fe80::250:56ff:feb8:c35e/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:1521201errors:0dropped:328787overruns:0frame:0TXpackets:8errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:562603031(562.6MB)TXbytes:648(648.0B)root@controller:~#vi/etc/neutron/plugins/ml2/linuxbridge_agent.ini[linux_bridge]physical_interface_mappings=public:eth0…[vxlan]enable_vxlan=Truelocal_ip=10.76.246.115l2_population=True…[agent]prevent_arp_spoofing=True…[securitygroup]enable_security_group=Truefirewall_driver=neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

5.2.4. Configurethelayer-3agent

• Editthe/etc/neutron/l3_agent.inifile

root@controller:~#vi/etc/neutron/l3_agent.ini[DEFAULT]interface_driver=neutron.agent.linux.interface.BridgeInterfaceDriver

Page 41: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

43

external_network_bridge=verbose=True

5.2.5. ConfiguretheDHCPagent

• Editthe/etc/neutron/dhcp_agent.inifile

root@controller:~#vi/etc/neutron/dhcp_agent.ini[DEFAULT]interface_driver=neutron.agent.linux.interface.BridgeInterfaceDriverdhcp_driver=neutron.agent.linux.dhcp.Dnsmasqenable_isolated_metadata=Trueverbose=Truednsmasq_config_file=/etc/neutron/dnsmasq-neutron.conf

• Createandeditthe/etc/neutron/dnsmasq-neutron.conffiletoenabletheDHCPMTUoption

(26)andconfigureitto1450bytes

root@controller:~#vi/etc/neutron/dnsmasq-neutron.confdhcp-option-force=26,1450#optionallyaddloggingparameterslog-facility=/var/log/neutron/dnsmasq.loglog-dhcp

Note:

IncaseofDHCPproblemscheckthelogs/var/log/neutron/dnsmasq.log

Dec2819:55:19dnsmasq[7153]:read/var/lib/neutron/dhcp/3ea75491-041d-4587-b439-ad68583c46ad/addn_hosts-4addresses…Dec2819:56:35dnsmasq-dhcp[7153]:1406613844availableDHCPsubnet:10.76.246.0/255.255.255.0Dec2819:56:35dnsmasq-dhcp[7153]:1406613844vendorclass:udhcp1.20.1Dec2819:56:35dnsmasq-dhcp[7153]:1406613844clientprovidesname:cirrosDec2819:56:35dnsmasq-dhcp[7153]:1406613844DHCPDISCOVER(ns-53edd6e5-36)fa:16:3e:9b:4d:a0Dec2819:56:35dnsmasq-dhcp[7153]:1406613844tags:tag0,known,ns-53edd6e5-36Dec2819:56:35dnsmasq-dhcp[7153]:1406613844DHCPOFFER(ns-53edd6e5-36)10.76.246.123fa:16:3e:9b:4d:a0…Dec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:51lease-time1dDec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:58T112hDec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:59T221hDec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:1netmask255.255.255.0Dec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:28broadcast10.76.246.255Dec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:14option:15domain-nameopenstacklocalDec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:3router10.76.246.1Dec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:14option:121classless-static-route20:a9:fe:a9:fe:0a:4c:f6:78:00:0a:4c:f6:01Dec2819:56:35dnsmasq-dhcp[7153]:1406613844sentsize:4option:6dns-server10.76.246.101…

Page 42: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

44

5.2.6. Configurethemetadataagent

Themetadataagentprovidesconfigurationinformationsuchascredentialstoinstances.

• Editthe/etc/neutron/metadata_agent.inifile

root@controller:~#vi/etc/neutron/metadata_agent.ini[DEFAULT]auth_uri=http://controller:5000auth_url=http://controller:35357auth_region=RegionOneauth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=neutronpassword=P@ssw0rdnova_metadata_ip=controllermetadata_proxy_shared_secret=P@ssw0rdverbose=True#commentotherparameters

5.2.7. ConfigureComputetouseNetworking

• Editthe/etc/nova/nova.conffile

root@compute1:~#vi/etc/nova/nova.conf[neutron]url=http://controller:9696auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultregion_name=RegionOneproject_name=serviceusername=neutronpassword=P@ssw0rdservice_metadata_proxy=Truemetadata_proxy_shared_secret=P@ssw0rd

5.2.8. FinalizeinstallationontheControllernode

• Populatethedatabase

Page 43: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

45

root@controller:~#/bin/sh-c"neutron-db-manage--config-file/etc/neutron/neutron.conf--config-file/etc/neutron/plugins/ml2/ml2_conf.iniupgradehead"neutronNohandlerscouldbefoundforlogger"neutron.quota"INFO[alembic.runtime.migration]ContextimplMySQLImpl.INFO[alembic.runtime.migration]Willassumenon-transactionalDDL.Runningupgradeforneutron...INFO[alembic.runtime.migration]ContextimplMySQLImpl.INFO[alembic.runtime.migration]Willassumenon-transactionalDDL.INFO[alembic.runtime.migration]Runningupgrade->juno,juno_initialINFO[alembic.runtime.migration]Runningupgradejuno->44621190bc02,add_uniqueconstraint_ipavailability_ranges…INFO[alembic.runtime.migration]Runningupgrade796c68dffbb->kilo,kiloINFO[alembic.runtime.migration]Runningupgradekilo->67c8e8d61d5,InitialLibertyno-opscript.INFO[alembic.runtime.migration]Runningupgradekilo->c40fbb377ad,InitialLibertyno-opscript.INFO[alembic.runtime.migration]Runningupgradec40fbb377ad->4b47ea298795,addrejectruleOK

• RestarttheComputeAPIservice

root@controller:~#servicenova-apirestartnova-apistop/waitingnova-apistart/running,process25836

• RestarttheNetworkingservices

root@controller:~#serviceneutron-serverrestartneutron-serverstop/waitingneutron-serverstart/running,process27922root@controller:~#serviceneutron-plugin-linuxbridge-agentrestartneutron-plugin-linuxbridge-agentstop/waitingneutron-plugin-linuxbridge-agentstart/running,process27949root@controller:~#serviceneutron-dhcp-agentrestartneutron-dhcp-agentstop/waitingneutron-dhcp-agentstart/running,process28048root@controller:~#serviceneutron-metadata-agentrestartneutron-metadata-agentstop/waitingneutron-metadata-agentstart/running,process28130

• Restartthelayer-3service

root@controller:~#serviceneutron-l3-agentrestartneutron-l3-agentstop/waitingneutron-l3-agentstart/running,process28269

• RemovetheSQLitedatabasefile

root@controller:~#rm-f/var/lib/neutron/neutron.sqlite

Page 44: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

46

5.3. InstallpackagesandconfigureNeutronontheComputenode

Onthecompute1node.

• Installthecomponents.

root@compute1:~#apt-getinstallneutron-plugin-linuxbridge-agentReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...Done…Processingtriggersforureadahead(0.100.0-16)...

• Editthe/etc/neutron/neutron.conffile

root@compute1:~#vi/etc/neutron/neutron.conf[DEFAULT]rpc_backend=rabbitauth_strategy=keystoneverbose=True…[oslo_messaging_rabbit]rabbit_host=controllerrabbit_userid=openstackrabbit_password=P@ssw0rd…[keystone_authtoken]auth_uri=http://controller:5000auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultproject_name=serviceusername=neutronpassword=P@ssw0rd#Commentoutorremoveanyotheroptionsinthe[keystone_authtoken]section#Inthe[database]section,commentoutanyconnectionoptionsbecausecomputenodesdonotdirectlyaccessthedatabase.

5.3.1. ConfiguretheLinuxbridgeagentontheComputenode

• Editthe/etc/neutron/plugins/ml2/linuxbridge_agent.inifile

root@compute1:~#ifconfigeth0Linkencap:EthernetHWaddr00:50:56:b8:44:b9inetaddr:10.76.246.117Bcast:10.76.246.255Mask:255.255.255.0inet6addr:fe80::250:56ff:feb8:44b9/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:3441395errors:0dropped:774998overruns:0frame:0TXpackets:356383errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000

Page 45: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

47

RXbytes:1490888566(1.4GB)TXbytes:60603130(60.6MB)eth1Linkencap:EthernetHWaddr00:50:56:b8:91:48inetaddr:192.168.5.117Bcast:192.168.5.255Mask:255.255.255.0inet6addr:fe80::250:56ff:feb8:9148/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:3126906errors:0dropped:774970overruns:0frame:0TXpackets:8errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:1299586243(1.2GB)TXbytes:648(648.0B)root@compute1:~#vi/etc/neutron/plugins/ml2/linuxbridge_agent.ini[linux_bridge]physical_interface_mappings=public:eth0…[vxlan]enable_vxlan=Truelocal_ip=10.76.246.117l2_population=True…[agent]prevent_arp_spoofing=True…[securitygroup]enable_security_group=Truefirewall_driver=neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

5.3.2. ConfigureComputetouseNetworking

• Editthe/etc/nova/nova.conffile

root@compute1:~#vi/etc/nova/nova.conf[neutron]url=http://controller:9696auth_url=http://controller:35357auth_plugin=passwordproject_domain_id=defaultuser_domain_id=defaultregion_name=RegionOneproject_name=serviceusername=neutronpassword=P@ssw0rd

5.3.3. FinalizeinstallationontheNetworknode

• RestarttheComputeAPIservice

root@compute1:~#servicenova-apirestartnova-apistop/waitingnova-apistart/running,process22779

Page 46: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

48

• RestarttheLinuxbridgeagent

root@compute1:~#serviceneutron-plugin-linuxbridge-agentrestartneutron-plugin-linuxbridge-agentstop/waitingneutron-plugin-linuxbridge-agentstart/running,process24381

5.4. VerifyNeutronoperation

• Listloadedextensionstoverifysuccessfullaunchoftheneutron-serverprocess

root@compute1:~#sourceadmin-openrc.shroot@compute1:~#neutronext-list+-----------------------+-----------------------------------------------+|alias|name|+-----------------------+-----------------------------------------------+|dns-integration|DNSIntegration||ext-gw-mode|NeutronL3Configurableexternalgatewaymode||binding|PortBinding||agent|agent||subnet_allocation|SubnetAllocation||l3_agent_scheduler|L3AgentScheduler||external-net|Neutronexternalnetwork||flavors|NeutronServiceFlavors||net-mtu|NetworkMTU||quotas|Quotamanagementsupport||l3-ha|HARouterextension||provider|ProviderNetwork||multi-provider|MultiProviderNetwork||extraroute|NeutronExtraRoute||router|NeutronL3Router||extra_dhcp_opt|NeutronExtraDHCPopts||security-group|security-group||dhcp_agent_scheduler|DHCPAgentScheduler||rbac-policies|RBACPolicies||port-security|PortSecurity||allowed-address-pairs|AllowedAddressPairs||dvr|DistributedVirtualRouter|+-----------------------+-----------------------------------------------+

• Listagentstoverifysuccessfullaunchoftheneutronagents.Theoutputshouldindicatefour

agentsonthenetworknodeandoneagentonthecomputenode.

root@compute1:~#neutronagent-list+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+|id|agent_type|host|alive|admin_state_up|binary|+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+|01922359-41ee-4591-9302-c36f675a972d|Linuxbridgeagent|compute1|:-)|True|neutron-linuxbridge-agent|

Page 47: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

49

|079a6f9c-4261-455c-a1c8-0880e0a93929|Linuxbridgeagent|controller|:-)|True|neutron-linuxbridge-agent||0be043a6-aa49-42ce-b7d9-a26bb86f9382|DHCPagent|controller|:-)|True|neutron-dhcp-agent||5255ca9a-8335-4726-bb26-6ddd05334ac3|L3agent|controller|:-)|True|neutron-l3-agent||93ad4afc-8aa9-4ad8-9a55-41d200067f76|Metadataagent|controller|:-)|True|neutron-metadata-agent|+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+

Note:

Incaseifsomeagentsarenotavailable,pleasecheckthelogfileslocatedinthe/var/log/neutron

directory.Inmyexample,theinterfacenamewasspecifiedinsteadoftheIPaddress.

root@controller:~#neutronagent-list+--------------------------------------+----------------+---------+-------+----------------+------------------------+|id|agent_type|host|alive|admin_state_up|binary|+--------------------------------------+----------------+---------+-------+----------------+------------------------+|0b7dafb5-9a9c-4cba-b8e3-586ea1327c0d|Metadataagent|network|:-)|True|neutron-metadata-agent||1aed329c-253e-4228-b0c5-af1617c292df|DHCPagent|network|:-)|True|neutron-dhcp-agent||76518771-d67b-4610-a23d-cc4e92797cf6|L3agent|network|:-)|True|neutron-l3-agent|+--------------------------------------+----------------+---------+-------+----------------+------------------------+root@controller:~#less/var/log/neutron/neutron-plugin-linuxbridge-agent.log…2015-12-2423:13:03.86527653CRITICALneutron[-]ConfigFileValueError:Valueforoptionlocal_ipisnotvalid:eth1isnotanIPv4address…

Page 48: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

50

6. Createnetworks

Onthenetworknode.

6.1. Createthepublicnetwork

http://docs.openstack.org/liberty/install-guide-ubuntu/launch-instance-networks-public.html Note:

Theadminorotherprivilegedusermustcreatethisnetworkbecauseitconnectsdirectlytothephysical

networkinfrastructure.

• Createthenetwork.

root@compute1:~#sourceadmin-openrc.shroot@compute1:~#neutronnet-createpublic--shared--provider:physical_networkpublic--provider:network_typeflatCreatedanewnetwork:+---------------------------+--------------------------------------+|Field|Value|+---------------------------+--------------------------------------+|admin_state_up|True||id|3ea75491-041d-4587-b439-ad68583c46ad||mtu|0||name|public||port_security_enabled|True||provider:network_type|flat||provider:physical_network|public||provider:segmentation_id|||router:external|False||shared|True||status|ACTIVE||subnets|||tenant_id|b928829df79d49cf889488847873f515|+---------------------------+--------------------------------------+

• Createasubnetonthenetwork.

root@compute1:~#neutronsubnet-createpublic10.76.246.0/24--namepublic--allocation-poolstart=10.76.246.120,end=10.76.246.139--dns-nameserver10.76.246.101--gateway10.76.246.1Createdanewsubnet:+-------------------+----------------------------------------------------+|Field|Value|+-------------------+----------------------------------------------------+|allocation_pools|{"start":"10.76.246.120","end":"10.76.246.139"}||cidr|10.76.246.0/24||dns_nameservers|10.76.246.101||enable_dhcp|True||gateway_ip|10.76.246.1|

Page 49: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

51

|host_routes|||id|17296ab1-7907-44d5-a236-dfc82ac4a9a8||ip_version|4||ipv6_address_mode|||ipv6_ra_mode|||name|public||network_id|3ea75491-041d-4587-b439-ad68583c46ad||subnetpool_id|||tenant_id|b928829df79d49cf889488847873f515|+-------------------+----------------------------------------------------+

6.1. Createtheprivatenetwork¶

http://docs.openstack.org/liberty/install-guide-ubuntu/launch-instance-networks-private.html

Note:

Youmustcreatethepublicprovidernetworkbeforetheprivateprojectnetwork.

Note:

Thedemoorotherunprivilegedusercancreatethisnetworkbecauseitonlyprovidesconnectivityto

instanceswithinthedemoproject.

• Createthenetwork.

root@compute1:~#sourcedemo-openrc.shroot@compute1:~#neutronnet-createprivateCreatedanewnetwork:+-----------------------+--------------------------------------+|Field|Value|+-----------------------+--------------------------------------+|admin_state_up|True||id|5cfbd611-0481-4799-b8dc-b6ae980a7b81||mtu|0||name|private||port_security_enabled|True||router:external|False||shared|False||status|ACTIVE||subnets|||tenant_id|c732a6de680b4b78b76a7b777286e79b|+-----------------------+--------------------------------------+

Note:

Incaseifyouhave“unabletocreate”error,checkif/etc/neutron/plugins/ml2/ml2_conf.iniwasmodified

correctly,fixtheproblemandrestartneutron-serverservice.

Page 50: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

52

Inmycasevni_ranges=1:1000parameterwasspecifiedinthesection[ml2_type_vlan]insteadof

[ml2_type_vxlan].

root@controller:~#neutronnet-createprivateUnabletocreatethenetwork.Notenantnetworkisavailableforallocation.

• Createasubnetonthenetwork.

root@compute1:~#neutronsubnet-createprivate192.168.5.0/24--nameprivate--dns-nameserver10.76.246.101--gateway192.168.5.1Createdanewsubnet:+-------------------+--------------------------------------------------+|Field|Value|+-------------------+--------------------------------------------------+|allocation_pools|{"start":"192.168.5.2","end":"192.168.5.254"}||cidr|192.168.5.0/24||dns_nameservers|10.76.246.101||enable_dhcp|True||gateway_ip|192.168.5.1||host_routes|||id|9f4ec48e-dd13-4967-bf67-12c23ad6670b||ip_version|4||ipv6_address_mode|||ipv6_ra_mode|||name|private||network_id|5cfbd611-0481-4799-b8dc-b6ae980a7b81||subnetpool_id|||tenant_id|c732a6de680b4b78b76a7b777286e79b|+-------------------+--------------------------------------------------+

6.2. Createarouter

Note:

Thepublicprovidernetworkmustincludetherouter:externaloptiontoenableprojectrouterstouseitfor

connectivitytoexternalnetworkssuchastheInternet.Theadminorotherprivilegedusermustinclude

thisoptionduringnetworkcreation.

• Addtherouter:externaloptiontothepublicprovidernetwork.

root@compute1:~#neutronnet-updatepublic--router:externalUpdatednetwork:public

Note:

Sourcethedemocredentialstogainaccesstouser-onlyCLIcommands.

• Createtherouter.

Page 51: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

53

root@compute1:~#sourcedemo-openrc.shroot@compute1:~#neutronrouter-createrouterCreatedanewrouter:+-----------------------+--------------------------------------+|Field|Value|+-----------------------+--------------------------------------+|admin_state_up|True||external_gateway_info|||id|c4c22426-766b-41ad-babc-959defb6d0ed||name|router||routes|||status|ACTIVE||tenant_id|c732a6de680b4b78b76a7b777286e79b|+-----------------------+--------------------------------------+

• Addtheprivatenetworksubnetasaninterfaceontherouter.

root@compute1:~#neutronrouter-interface-addrouterprivateAddedinterface62042f9f-1112-43cf-999b-a05c6655975dtorouterrouter.

• Setagatewayonthepublicnetworkontherouter

root@compute1:~#neutronrouter-gateway-setrouterpublicSetgatewayforrouterrouter

6.3. Verifynetworkoperation

Note:

On the controller node, source the admin credentials to gain access to admin-only CLI commands.

• Listnetworknamespaces.Youshouldseeoneqrouternamespaceandtwoqdhcpnamespaces.

root@controller:~#sourceadmin-openrc.shroot@controller:~#ipnetnsqrouter-c4c22426-766b-41ad-babc-959defb6d0edqdhcp-5cfbd611-0481-4799-b8dc-b6ae980a7b81qdhcp-3ea75491-041d-4587-b439-ad68583c46ad

• ListportsontheroutertodeterminethegatewayIPaddressonthepublicprovidernetwork.

root@controller:~#neutronrouter-port-listrouter+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+|id|name|mac_address|fixed_ips|+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+|1369e7c6-e9bd-4a3b-ae70-e8a7dc2951ae||fa:16:3e:62:3b:a2|{"subnet_id":"17296ab1-7907-44d5-a236-dfc82ac4a9a8","ip_address":"10.76.246.121"}||62042f9f-1112-43cf-999b-a05c6655975d||fa:16:3e:8f:cf:8c|{"subnet_id":"9f4ec48e-dd13-4967-bf67-12c23ad6670b","ip_address":"192.168.5.1"}|

Page 52: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

54

+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+

• Checkifrouterportsandoutsidehostarepingable

root@controller:~#ping-c110.76.246.121PING10.76.246.121(10.76.246.121)56(84)bytesofdata.64bytesfrom10.76.246.121:icmp_seq=1ttl=64time=0.157ms---10.76.246.121pingstatistics---1packetstransmitted,1received,0%packetloss,time0msrttmin/avg/max/mdev=0.157/0.157/0.157/0.000msroot@controller:~#ping-c1192.168.5.1PING192.168.5.1(192.168.5.1)56(84)bytesofdata.64bytesfrom192.168.5.1:icmp_seq=1ttl=64time=0.535ms---192.168.5.1pingstatistics---1packetstransmitted,1received,0%packetloss,time0msrttmin/avg/max/mdev=0.535/0.535/0.535/0.000msroot@controller:~#ping-c110.64.86.33PING10.64.86.33(10.64.86.33)56(84)bytesofdata.64bytesfrom10.64.86.33:icmp_seq=1ttl=254time=0.365ms---10.64.86.33pingstatistics---1packetstransmitted,1received,0%packetloss,time0msrttmin/avg/max/mdev=0.365/0.365/0.365/0.000ms

• Coupleofcommandsusefulforatroubleshooting

root@controller:~#ipnetnsqdhcp-5cfbd611-0481-4799-b8dc-b6ae980a7b81qdhcp-3ea75491-041d-4587-b439-ad68583c46adqrouter-c4c22426-766b-41ad-babc-959defb6d0edroot@controller:~#ipnetnsexecqdhcp-3ea75491-041d-4587-b439-ad68583c46adifconfigloLinkencap:LocalLoopbackinetaddr:127.0.0.1Mask:255.0.0.0inet6addr:::1/128Scope:HostUPLOOPBACKRUNNINGMTU:65536Metric:1RXpackets:0errors:0dropped:0overruns:0frame:0TXpackets:0errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:0RXbytes:0(0.0B)TXbytes:0(0.0B)ns-53edd6e5-36Linkencap:EthernetHWaddrfa:16:3e:bf:e1:11inetaddr:10.76.246.120Bcast:10.76.246.255Mask:255.255.255.0inet6addr:fe80::f816:3eff:febf:e111/64Scope:LinkUPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1RXpackets:53990errors:0dropped:12973overruns:0frame:0TXpackets:44errors:0dropped:0overruns:0carrier:0collisions:0txqueuelen:1000RXbytes:17145359(17.1MB)TXbytes:5112(5.1KB)

Page 53: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

55

root@controller:~#ipnetnsexecqdhcp-3ea75491-041d-4587-b439-ad68583c46adrouteKernelIProutingtableDestinationGatewayGenmaskFlagsMetricRefUseIfacedefault10.76.246.10.0.0.0UG000ns-53edd6e5-3610.76.246.0*255.255.255.0U000ns-53edd6e5-36link-local*255.255.0.0U000ns-53edd6e5-36root@controller:~#ipnetnsexecqdhcp-3ea75491-041d-4587-b439-ad68583c46adipaddrshow1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWNgroupdefaultlink/loopback00:00:00:00:00:00brd00:00:00:00:00:00inet127.0.0.1/8scopehostlovalid_lftforeverpreferred_lftforeverinet6::1/128scopehostvalid_lftforeverpreferred_lftforever2:ns-53edd6e5-36:<BROADCAST,MULTICAST,UP,LOWER_UP>mtu1500qdiscpfifo_faststateUPgroupdefaultqlen1000link/etherfa:16:3e:bf:e1:11brdff:ff:ff:ff:ff:ffinet10.76.246.120/24brd10.76.246.255scopeglobalns-53edd6e5-36valid_lftforeverpreferred_lftforeverinet169.254.169.254/16brd169.254.255.255scopeglobalns-53edd6e5-36valid_lftforeverpreferred_lftforeverinet6fe80::f816:3eff:febf:e111/64scopelinkvalid_lftforeverpreferred_lftforever

Page 54: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

56

7. Addkeypairsandsecuritygroups

Mostcloudimagessupportpublickeyauthenticationratherthanconventionalpasswordauthentication.

Beforelaunchinganinstance,youmustaddapublickeytotheComputeservice.

7.1. Generateakeypair

• Sourcethedemotenantcredentials.

• Generateandaddakeypair

root@controller:~#sourcedemo-openrc.shroot@controller:~#ssh-keygen-q-N""Enterfileinwhichtosavethekey(/root/.ssh/id_rsa):root@controller:~#novakeypair-add--pub-key.ssh/id_rsa.pubmykey

• Verifyadditionofthekeypair.

root@controller:~#novakeypair-list+-------+-------------------------------------------------+|Name|Fingerprint|+-------+-------------------------------------------------+|mykey|c5:b2:4a:2d:c8:65:c3:b5:75:27:4a:2d:b8:f6:7a:ec|+-------+-------------------------------------------------+

7.2. Addsecuritygrouprules

• AddICMPandSSHrulestothedefaultsecuritygroup

root@controller:~#novasecgroup-add-ruledefaulticmp-1-10.0.0.0/0+-------------+-----------+---------+-----------+--------------+|IPProtocol|FromPort|ToPort|IPRange|SourceGroup|+-------------+-----------+---------+-----------+--------------+|icmp|-1|-1|0.0.0.0/0||+-------------+-----------+---------+-----------+--------------+root@controller:~#novasecgroup-add-ruledefaulttcp22220.0.0.0/0+-------------+-----------+---------+-----------+--------------+|IPProtocol|FromPort|ToPort|IPRange|SourceGroup|+-------------+-----------+---------+-----------+--------------+|tcp|22|22|0.0.0.0/0||+-------------+-----------+---------+-----------+--------------+

Page 55: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

57

8. Launchaninstance

http://docs.openstack.org/liberty/install-guide-ubuntu/launch-instance-public.html

8.1. Launchaninstanceonthepublicnetwork

Note:

Tolaunchaninstance,youmustatleastspecifytheflavor,imagename,network,securitygroup,key,

andinstancename.

• Listavailableflavors

root@controller:~#sourcedemo-openrc.shroot@controller:~#novaflavor-list+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+|ID|Name|Memory_MB|Disk|Ephemeral|Swap|VCPUs|RXTX_Factor|Is_Public|+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+|1|m1.tiny|512|1|0||1|1.0|True||2|m1.small|2048|20|0||1|1.0|True||3|m1.medium|4096|40|0||2|1.0|True||4|m1.large|8192|80|0||4|1.0|True||5|m1.xlarge|16384|160|0||8|1.0|True|+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

• Listavailableimages

root@controller:~#novaimage-list+--------------------------------------+--------+--------+--------+|ID|Name|Status|Server|+--------------------------------------+--------+--------+--------+|a77342a4-1479-44d4-91cf-a3174352ecbd|cirros|ACTIVE||+--------------------------------------+--------+--------+--------+

• Listavailablenetworks.

root@controller:~#neutronnet-list+--------------------------------------+---------+-----------------------------------------------------+|id|name|subnets|+--------------------------------------+---------+-----------------------------------------------------+|3ea75491-041d-4587-b439-ad68583c46ad|public|17296ab1-7907-44d5-a236-dfc82ac4a9a810.76.246.0/24||5cfbd611-0481-4799-b8dc-b6ae980a7b81|private|9f4ec48e-dd13-4967-bf67-12c23ad6670b192.168.5.0/24|+--------------------------------------+---------+-----------------------------------------------------+

Note:

YoumustreferencethisnetworkusingtheIDinsteadofthename.

Page 56: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

58

• Listavailablesecuritygroups.

root@controller:~#novasecgroup-list+--------------------------------------+---------+------------------------+|Id|Name|Description|+--------------------------------------+---------+------------------------+|653714ef-dc26-4483-88d0-fe3d8b8439cb|default|Defaultsecuritygroup|+--------------------------------------+---------+------------------------+

• Launchtheinstance

root@controller:~#novaboot--flavorm1.tiny--imagecirros--nicnet-id=3ea75491-041d-4587-b439-ad68583c46ad--security-groupdefault--key-namemykeypublic-instance+--------------------------------------+-----------------------------------------------+|Property|Value|+--------------------------------------+-----------------------------------------------+|OS-DCF:diskConfig|MANUAL||OS-EXT-AZ:availability_zone|||OS-EXT-STS:power_state|0||OS-EXT-STS:task_state|scheduling||OS-EXT-STS:vm_state|building||OS-SRV-USG:launched_at|-||OS-SRV-USG:terminated_at|-||accessIPv4|||accessIPv6|||adminPass|8uW9WswgVqun||config_drive|||created|2015-12-28T13:20:29Z||flavor|m1.tiny(1)||hostId|||id|d7961433-c00c-4d11-a37a-0b55cc354f73||image|cirros(a77342a4-1479-44d4-91cf-a3174352ecbd)||key_name|mykey||metadata|{}||name|public-instance||os-extended-volumes:volumes_attached|[]||progress|0||security_groups|default||status|BUILD||tenant_id|c732a6de680b4b78b76a7b777286e79b||updated|2015-12-28T13:20:30Z||user_id|94ff2f8fea394d67b096a16e07dd4a14|+--------------------------------------+-----------------------------------------------+

• Checkthestatusofyourinstance.

root@controller:~#novalist+--------------------------------------+-----------------+--------+------------+-------------+----------------------+|ID|Name|Status|TaskState|PowerState|Networks|+--------------------------------------+-----------------+--------+------------+-------------+----------------------+|d7961433-c00c-4d11-a37a-0b55cc354f73|public-instance|ACTIVE|-|Running|public=10.76.246.122|+--------------------------------------+-----------------+--------+------------+-------------+----------------------+

Page 57: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

59

• ObtainaVirtualNetworkComputing(VNC)sessionURLforyourinstanceandaccessitfroma

webbrowser

root@controller:~#novaget-vnc-consolepublic-instancenovnc+-------+---------------------------------------------------------------------------------+|Type|Url|+-------+---------------------------------------------------------------------------------+|novnc|http://controller:6080/vnc_auto.html?token=6c3c989c-faec-40b2-907c-09a4055df987|+-------+---------------------------------------------------------------------------------+

• Checktheconsoleaccessviabrowser

• Loginwithcirros/cubswin:)

8.1. Launchaninstanceontheprivatenetwork

• Listavailablenetworks.

root@controller:~#neutronnet-list+--------------------------------------+---------+-----------------------------------------------------+|id|name|subnets|+--------------------------------------+---------+-----------------------------------------------------+|3ea75491-041d-4587-b439-ad68583c46ad|public|17296ab1-7907-44d5-a236-dfc82ac4a9a810.76.246.0/24|

Page 58: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

60

|5cfbd611-0481-4799-b8dc-b6ae980a7b81|private|9f4ec48e-dd13-4967-bf67-12c23ad6670b192.168.5.0/24|+--------------------------------------+---------+-----------------------------------------------------+

• Launchtheinstance

root@controller:~#novaboot--flavorm1.tiny--imagecirros--nicnet-id=5cfbd611-0481-4799-b8dc-b6ae980a7b81--security-groupdefault--key-namemykeyprivate-instance+--------------------------------------+-----------------------------------------------+|Property|Value|+--------------------------------------+-----------------------------------------------+|OS-DCF:diskConfig|MANUAL||OS-EXT-AZ:availability_zone|||OS-EXT-STS:power_state|0||OS-EXT-STS:task_state|scheduling||OS-EXT-STS:vm_state|building||OS-SRV-USG:launched_at|-||OS-SRV-USG:terminated_at|-||accessIPv4|||accessIPv6|||adminPass|RhjnU9KM7U6y||config_drive|||created|2015-12-28T14:26:02Z||flavor|m1.tiny(1)||hostId|||id|85742340-3f05-4ac3-8f08-f0611ea63e41||image|cirros(a77342a4-1479-44d4-91cf-a3174352ecbd)||key_name|mykey||metadata|{}||name|private-instance||os-extended-volumes:volumes_attached|[]||progress|0||security_groups|default||status|BUILD||tenant_id|c732a6de680b4b78b76a7b777286e79b||updated|2015-12-28T14:26:03Z||user_id|94ff2f8fea394d67b096a16e07dd4a14|+--------------------------------------+-----------------------------------------------+root@controller:~#novalist+--------------------------------------+------------------+--------+------------+-------------+----------------------+|ID|Name|Status|TaskState|PowerState|Networks|+--------------------------------------+------------------+--------+------------+-------------+----------------------+|85742340-3f05-4ac3-8f08-f0611ea63e41|private-instance|BUILD|spawning|NOSTATE|||d7961433-c00c-4d11-a37a-0b55cc354f73|public-instance|ACTIVE|-|Running|public=10.76.246.122|+--------------------------------------+------------------+--------+------------+-------------+----------------------+root@controller:~#novalist+--------------------------------------+------------------+--------+------------+-------------+----------------------+|ID|Name|Status|TaskState|PowerState|Networks|+--------------------------------------+------------------+--------+------------+-------------+----------------------+

Page 59: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

61

|85742340-3f05-4ac3-8f08-f0611ea63e41|private-instance|ACTIVE|-|Running|private=192.168.5.3||d7961433-c00c-4d11-a37a-0b55cc354f73|public-instance|ACTIVE|-|Running|public=10.76.246.122|+--------------------------------------+------------------+--------+------------+-------------+----------------------+

• ObtainVNCURL

root@controller:~#novaget-vnc-consoleprivate-instancenovnc+-------+---------------------------------------------------------------------------------+|Type|Url|+-------+---------------------------------------------------------------------------------+|novnc|http://controller:6080/vnc_auto.html?token=0e0cdd23-573f-4bf3-a344-f242e585ac13|+-------+---------------------------------------------------------------------------------+

• Logintotheconsoleviabrowser

Page 60: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

62

9. Appendix

9.1. NetworkconfiginUbuntu

• Sudotoroot

vipr@ubuntu:~$sudo-i[sudo]passwordforvipr:

• ConfigurestaticIPonubuntu

root@ubuntu:~#vi/etc/network/interfaces#Thisfiledescribesthenetworkinterfacesavailableonyoursystem#andhowtoactivatethem.Formoreinformation,seeinterfaces(5).#Theloopbacknetworkinterfaceautoloifaceloinetloopback#Theprimarynetworkinterfaceautoeth0#ifaceeth0inetdhcpifaceeth0inetstaticaddress10.76.246.115netmask255.255.255.0gateway10.76.246.1dns-nameservers10.64.86.33

Note

Checkupstartdocshere:http://upstart.ubuntu.com/cookbook/

• Restartservice

root@ubuntu:~#initctlreloadnetwork-interfaceINTERFACE=eth0

9.2. UpdateUbuntu

Note:

apt-getdocsarehere:https://help.ubuntu.com/community/AptGet/Howto

• Makesureyoursourcelistisup-to-date

root@ubuntu:~#apt-getupdate…Readingpackagelists...Done

Page 61: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

63

• Upgradesallinstalledpackages

root@ubuntu:~#apt-getdist-upgrade…Runninghooksin/etc/ca-certificates/update.d....done.

• Updateyoursourcelistagain

vipr@ubuntu:~$sudo-iroot@ubuntu:~#apt-getupdate…Readingpackagelists...Done

9.3. CreateVMwaretemplateinUbuntu

• Installopenvmtools

Notes:

KBarticlewhichdescribesLinuxcustomizationpackageinstallationishere:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId

=2075048

root@ubuntu:~#mkdir/tmp/keysroot@ubuntu:~#cd/tmp/keys/root@ubuntu:/tmp/keys#wgethttp://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub…Savingto:'VMWARE-PACKAGING-GPG-DSA-KEY.pub'100%[===========================================>]922--.-K/sin0sroot@ubuntu:/tmp/keys#wgethttp://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub…Savingto:'VMWARE-PACKAGING-GPG-RSA-KEY.pub'100%[========================================>]755--.-K/sin0sroot@ubuntu:/tmp/keys#lsVMWARE-PACKAGING-GPG-DSA-KEY.pubVMWARE-PACKAGING-GPG-RSA-KEY.pubroot@ubuntu:/tmp/keys#sudoapt-keyadd./VMWARE-PACKAGING-GPG-DSA-KEY.pubOKroot@ubuntu:/tmp/keys#sudoapt-keyadd./VMWARE-PACKAGING-GPG-RSA-KEY.pubOKroot@ubuntu:/tmp/keys#vi/etc/apt/sources.list.d/vmware-tools.listdebhttp://packages.vmware.com/packages/ubuntuprecisemainroot@ubuntu:/tmp/keys#apt-getupdate…

Page 62: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

64

Readingpackagelists...Doneroot@ubuntu:/tmp/keys#apt-getinstallopen-vm-tools-deploypkg…*Startingopen-vmdaemonvmtoolsd[OK]Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...

• CloneVMtothetemplate

Page 63: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

65

9.4. NTPconfiginUbuntu

• Installchronypackage

root@controller:~#apt-getinstallchrony…Creatingconfigfile/etc/chrony/chrony.confwithnewversionStarting/usr/sbin/chronyd...chronydisrunningandonline.Processingtriggersforlibc-bin(2.19-0ubuntu6.6)...Processingtriggersforureadahead(0.100.0-16)...root@controller:~#vi/etc/chrony/chrony.confserver152.62.136.70iburstroot@controller:~#servicechronyrestartRestartingtimedaemon:Starting/usr/sbin/chronyd...chronydisrunningandonline.root@controller:~#chronyctrackingReferenceID:152.62.136.70(nsruspa.lss.emc.com)Stratum:3Reftime(UTC):SatDec1912:04:372015Systemtime:0.000011076secondsfastofNTPtimeLastoffset:0.000034349secondsRMSoffset:0.000026002secondsFrequency:14.616ppmslowResidualfreq:0.013ppm

Page 64: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

66

Skew:0.596ppmRootdelay:0.156974secondsRootdispersion:0.095920secondsUpdateinterval:65.0secondsLeapstatus:Normal

9.5. AddanewdiskinUbuntu

• Rescanthehosttodetectthenewscsibusasyou'veaddedanewdisk.

root@controller:~#ls/sys/class/scsi_host/host0host1host2root@controller:~#echo"---">/sys/class/scsi_host/host0/scanroot@controller:~#lshw-Cdisk*-disk:0description:SCSIDiskphysicalid:0.0.0businfo:scsi@2:0.0.0logicalname:/dev/sdasize:10GiB(10GB)capabilities:partitionedpartitioned:dosconfiguration:sectorsize=512signature=0008a3ce*-disk:1description:SCSIDiskphysicalid:0.1.0businfo:scsi@2:0.1.0logicalname:/dev/sdbsize:10GiB(10GB)configuration:sectorsize=512*-cdromdescription:DVD-RAMwriterphysicalid:0.0.0businfo:scsi@1:0.0.0logicalname:/dev/cdromlogicalname:/dev/sr0capabilities:audiocd-rcd-rwdvddvd-rdvd-ramconfiguration:status=open

9.6. ResizeadiskinUbuntu

https://ma.ttias.be/increase-a-vmware-disk-size-vmdk-formatted-as-linux-lvm-without-rebooting/

• Rescanthescsibus.

root@controller:~#ls/sys/class/scsi_device/1:0:0:02:0:0:02:0:1:0

Page 65: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

67

root@controller:~#echo1>/sys/class/scsi_device/2\:0\:0\:0/device/rescanroot@controller:~#echo1>/sys/class/scsi_device/2\:0\:1\:0/device/rescanroot@controller:~#echo1>/sys/class/scsi_device/1\:0\:0\:0/device/rescan

• Checknewsizeofthedisk.

root@controller:~#fdisk-lDisk/dev/sda:21.5GB,21474836480bytes255heads,63sectors/track,2610cylinders,total41943040sectorsUnits=sectorsof1*512=512bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x0008a3ceDeviceBootStartEndBlocksIdSystem/dev/sda1*204849971124883283Linux/dev/sda250175820969471102338575Extended/dev/sda550176020969471102338568eLinuxLVMDisk/dev/mapper/ubuntu--vg-root:8329MB,8329887744bytes255heads,63sectors/track,1012cylinders,total16269312sectorsUnits=sectorsof1*512=512bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x00000000Disk/dev/mapper/ubuntu--vg-rootdoesn'tcontainavalidpartitiontableDisk/dev/mapper/ubuntu--vg-swap_1:2147MB,2147483648bytes255heads,63sectors/track,261cylinders,total4194304sectorsUnits=sectorsof1*512=512bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x00000000Disk/dev/mapper/ubuntu--vg-swap_1doesn'tcontainavalidpartitiontable

9.7. CreateanewpartitioninUbuntu

root@controller:~#fdisk/dev/sdbDevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabelBuildinganewDOSdisklabelwithdiskidentifier0xdb3c9f58.Changeswillremaininmemoryonly,untilyoudecidetowritethem.Afterthat,ofcourse,thepreviouscontentwon'tberecoverable.Warning:invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)Command(mforhelp):nPartitiontype:pprimary(0primary,0extended,4free)

Page 66: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

68

eextendedSelect(defaultp):pPartitionnumber(1-4,default1):Usingdefaultvalue1Firstsector(2048-20971519,default2048):Usingdefaultvalue2048Lastsector,+sectorsor+size{K,M,G}(2048-20971519,default20971519):Usingdefaultvalue20971519Command(mforhelp):tSelectedpartition1Hexcode(typeLtolistcodes):8eChangedsystemtypeofpartition1to8e(LinuxLVM)Command(mforhelp):pDisk/dev/sdb:10.7GB,10737418240bytes255heads,63sectors/track,1305cylinders,total20971520sectorsUnits=sectorsof1*512=512bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0xdb3c9f58DeviceBootStartEndBlocksIdSystem/dev/sdb1204820971519104847368eLinuxLVMCommand(mforhelp):wThepartitiontablehasbeenaltered!Callingioctl()tore-readpartitiontable.Syncingdisks.

• Incaseofwarning

WARNING:Re-readingthepartitiontablefailedwitherror16:Deviceorresourcebusy.Thekernelstillusestheoldtable.Thenewtablewillbeusedatthenextrebootorafteryourunpartprobe(8)orkpartx(8)Syncingdisks.

• Runthefollowingtoscanforthenewlycreatedpartition.

root@controller:~#partprobe-s/dev/sda:msdospartitions132<5>/dev/mapper/ubuntu--vg-swap_1:looppartitions1/dev/mapper/ubuntu--vg-root:looppartitions1

• Ifthatdoesnotworkforyou,youcantrytouse"partx"torescanthedeviceandaddthenew

partitions.

root@controller:~#partx-v-a/dev/sdapartition:none,disk:/dev/sda,lower:0,upper:0/dev/sda:partitiontabletype'dos'detected

Page 67: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

69

partx:/dev/sda:addingpartition#1failed:Deviceorresourcebusypartx:/dev/sda:addingpartition#2failed:Deviceorresourcebusypartx:/dev/sda:addingpartition#3failed:Deviceorresourcebusypartx:/dev/sda:addingpartition#5failed:Deviceorresourcebusypartx:/dev/sda:erroraddingpartitions1-3partx:/dev/sda:erroraddingpartition5

• Otherwisereboot

9.8. ExpandcapacityunderLVM

https://ma.ttias.be/increase-a-vmware-disk-size-vmdk-formatted-as-linux-lvm-without-rebooting/

• CreatethephysicalvolumeasabasisforyourLVM

root@controller:~#pvcreate/dev/sdb1Physicalvolume"/dev/sdb1"successfullycreatedroot@controller:~#pvdisplay---Physicalvolume---PVName/dev/sda5VGNameubuntu-vgPVSize9.76GiB/notusable2.00MiBAllocatableyes(butfull)PESize4.00MiBTotalPE2498FreePE0AllocatedPE2498PVUUIDY5NMRu-f1ld-357P-eoCR-x6H8-4uxj-e6WLJi---Physicalvolume---PVName/dev/sdb1VGNameubuntu-vgPVSize10.00GiB/notusable3.00MiBAllocatableyes(butfull)PESize4.00MiBTotalPE2559FreePE0AllocatedPE2559PVUUIDwX0UZY-Uqru-rY2e-0n7a-hTXR-c1UV-Awu12X

• FindouthowyourVolumeGroupiscalled

root@controller:~#vgdisplay---Volumegroup---VGNameubuntu-vgSystemIDFormatlvm2MetadataAreas1MetadataSequenceNo3

Page 68: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

70

VGAccessread/writeVGStatusresizableMAXLV0CurLV2OpenLV2MaxPV0CurPV1ActPV1VGSize9.76GiBPESize4.00MiBTotalPE2498AllocPE/Size2498/9.76GiBFreePE/Size0/0VGUUIDQj7EoS-pqm6-ra2u-o4x2-gP3g-nV57-QgFiGo

• ExtendthatVolumeGroupbyaddingthenewlycreatedphysicalvolumetoit.

root@controller:~#vgextendubuntu-vg/dev/sdb1Volumegroup"ubuntu-vg"successfullyextendedroot@controller:~#vgdisplay---Volumegroup---VGNameubuntu-vgSystemIDFormatlvm2MetadataAreas2MetadataSequenceNo5VGAccessread/writeVGStatusresizableMAXLV0CurLV2OpenLV2MaxPV0CurPV2ActPV2VGSize19.75GiBPESize4.00MiBTotalPE5057AllocPE/Size5057/19.75GiBFreePE/Size0/0VGUUIDQj7EoS-pqm6-ra2u-o4x2-gP3g-nV57-QgFiGo

• Checkthenewlyaddedphysicalvolumeandtheusablespace.

root@controller:~#pvscanPV/dev/sda5VGubuntu-vglvm2[9.76GiB/0free]PV/dev/sdb1VGubuntu-vglvm2[10.00GiB/10.00GiBfree]Total:2[19.75GiB]/inuse:2[19.75GiB]/innoVG:0[0]

• ExtendLogicalVolume.

root@controller:~#lvextend/dev/ubuntu-vg/root/dev/sdb1

Page 69: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

71

Extendinglogicalvolumerootto17.75GiBLogicalvolumerootsuccessfullyresizedroot@controller:~#lvdisplay---Logicalvolume---LVPath/dev/ubuntu-vg/rootLVNamerootVGNameubuntu-vgLVUUID8XFekv-cxqd-ebbQ-ehSs-0sDR-iiYx-AqOX0rLVWriteAccessread/writeLVCreationhost,timeubuntu,2015-06-0218:44:45+0300LVStatusavailable#open1LVSize17.75GiBCurrentLE4545Segments2AllocationinheritReadaheadsectorsauto-currentlysetto256Blockdevice252:0---Logicalvolume---LVPath/dev/ubuntu-vg/swap_1LVNameswap_1VGNameubuntu-vgLVUUIDKG0nw4-SKXs-RxuQ-pyIM-ODhw-YiHR-nVNgrCLVWriteAccessread/writeLVCreationhost,timeubuntu,2015-06-0218:44:45+0300LVStatusavailable#open2LVSize2.00GiBCurrentLE512Segments1AllocationinheritReadaheadsectorsauto-currentlysetto256Blockdevice252:1

• Resizethefilesystemtothevolumegroup,sowecanusethespace.

root@controller:~#df-hFilesystemSizeUsedAvailUse%Mountedonudev3.9G4.0K3.9G1%/devtmpfs799M712K798M1%/run/dev/mapper/ubuntu--vg-root7.6G4.8G2.4G67%/none4.0K04.0K0%/sys/fs/cgroupnone5.0M05.0M0%/run/locknone3.9G03.9G0%/run/shmnone100M0100M0%/run/user/dev/sda1236M101M124M45%/bootroot@controller:~#resize2fs/dev/ubuntu-vg/rootresize2fs1.42.9(4-Feb-2014)

Page 70: OpenStack installation 151228 - WordPress.com · 2017-02-01 · 3 OpenStack Liberty installation Vasily.Pantyukhin@emc.com I created this document to keep track of my experimental

72

Filesystemat/dev/ubuntu-vg/rootismountedon/;on-lineresizingrequiredold_desc_blocks=1,new_desc_blocks=2Thefilesystemon/dev/ubuntu-vg/rootisnow4654080blockslong.root@controller:~#df-hTFilesystemTypeSizeUsedAvailUse%Mountedonudevdevtmpfs3.9G4.0K3.9G1%/devtmpfstmpfs799M712K798M1%/run/dev/mapper/ubuntu--vg-rootext418G4.8G12G29%/nonetmpfs4.0K04.0K0%/sys/fs/cgroupnonetmpfs5.0M05.0M0%/run/locknonetmpfs3.9G03.9G0%/run/shmnonetmpfs100M0100M0%/run/user/dev/sda1ext2236M101M124M45%/boot