Selecting the right multi-cloud management software is not easy I am currently researching how how to architect our multi-cloud strategy. Part of the research is selecting the right software helping managing, maintain and life-cycle a multi cloud environment, this includes management and cost. Cloud and more specific multi / hybrid cloud can get very complex […]
Tag: openstack
Openstack Cheat Sheet
https://thornelabs.net/2014/03/13/openstack-commands-cheat-sheet.html
how to install Openstack kilo on Solaris 12 with oVS
First install MySQL and openstack
1 |
pkg install mysql-56 pkg:/database/mysql-56/client openstack service/network/openvswitch |
MySQL configuration
1 2 3 4 5 6 |
zfs create -o mountpoint=/mysql rpool/mysql mkdir /mysql/logs mkdir /mysql/innodb cp /etc/mysql/5.6/my.cnf /mysql/ cd /etc/mysql/5.6/; mv my.cnf my.cnf.orig; ln -s /mysql/my.cnf chown -R mysql:mysql /mysql |
sample my.cnf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html [mysqld] default-storage-engine = InnoDB collation-server = utf8_unicode_ci init-connect = 'SET NAMES utf8' character-set-server = utf8 # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = /usr/mysql/5.6 datadir = /mysql/innodb port = 3306 # server_id = ..... socket = /tmp/mysql.sock # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. join_buffer_size = 128M sort_buffer_size = 2M read_rnd_buffer_size = 2M ### Copied from a 5.5 config innodb_data_home_dir = /mysql/innodb innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /mysql/innodb # You can set .._buffer_pool_size up to 50 – 80 % # of RAM but beware of setting memory usage too high innodb_buffer_pool_size = 16M #innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size innodb_log_file_size = 5M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] default-character-set=utf8 [mysql] default-character-set=utf8 |
Now lets create a MySQL DB
1 2 |
export PATH=$PATH:/usr/mysql/5.6/bin /usr/mysql/5.6/bin/mysql_install_db --defaults-file=/mysql/my.cnf --user=mysql --datadir=/mysql/innodb --basedir=/usr/mysql/5.6 --pid-file=/mysql/mysql.pid |
Now start mysql
1 |
/usr/mysql/5.6/bin/mysqld --defaults-file=/mysql/my.cnf --basedir=/usr/mysql/5.6 --datadir=/mysql/innodb --user=mysql --pid-file=/mysql/mysql.pid & |
Update root password
1 |
mysqladmin -u root password [press enter] |
Secure MySQL
1 2 3 4 5 6 7 |
/usr/mysql/5.6/bin/mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] n Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] n Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y |
Configure SMF
1 2 3 |
svccfg -s svc:/application/database/mysql:version_56 setprop mysql/cnf=/mysql/my.cnf svccfg -s svc:/application/database/mysql:version_56 setprop mysql/data=/mysql/innodb svcadm refresh mysql:version_56 |
Stop the MySQL instance running from before and start with SMF
1 2 |
kill %1 svcadm enable mysql |
Create MySQL tables by running the below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
: #controller-short-name="oscntrl1" #controller-IP="10.10.2.216" #controller-fqdn="oscntrl1.domain.com" #storage-short-name="oscntrl1" #storage-IP="10.10.2.216" #storage-fqdn="oscntrl1.domain.com" #service-password="password" # ----------------------------------------- # mysql -u root -p<<EOF # DROP DATABASE if exists nova; CREATE DATABASE nova DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'password'; # # DROP DATABASE if exists cinder; CREATE DATABASE cinder DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; # # DROP DATABASE if exists glance; CREATE DATABASE glance DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'password'; # # DROP DATABASE if exists keystone; CREATE DATABASE keystone DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'password'; # # DROP DATABASE if exists neutron; CREATE DATABASE neutron DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'password'; # # DROP DATABASE if exists heat; CREATE DATABASE heat DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'oscntrl1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'10.10.2.216' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'oscntrl1.domain.com' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; EOF |
Configure rabbitmq […]
OpenStack / Solaris 11.3 (Kilo) – Part one
First we need to create a Virtual Router and Load Balancer Note: The Full Kilo setup can be found here – How To Install Openstack Kilo On Solaris-12 With OVS Will use vrrp v3 (solrias tech) Install needed packages
1 |
pkg install vrrp |
Disable redirects
1 |
ipadm set-prop -p send_redirects=off ipv4 |
on first node The example below users – Router address 10.10.2.215
1 2 |
vrrpadm create-router -T L3 -V 1 -A inet -I net0 -P 10.10.2.216 \ -a 10.10.2.215/22 -p 150 vrrp1 |
[…]
OpenStack – Linux workprogress
Openstack docs
1 2 3 |
http://lifeandshell.com/installing-openstack-centos-7/ http://www.tecmint.com/openstack-installation-guide-rhel-centos/ https://www.rdoproject.org/install/quickstart/ |
Openstack video
1 2 3 |
https://www.youtube.com/watch?v=eOlIB323c8s https://www.youtube.com/watch?v=huZa-YZ20qs#t=1.34627 https://www.youtube.com/results?search_query=openstack+multi+node+installation |
Hands on lab openstack OEL 7
Hands on lab openstack OEL 7 example First add openstack repo Source document
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
systemctl stop firewalld systemctl disable firewalld systemctl stop iptables systemctl disable iptables # Disable se linux /etc/selinux/config change to disabled cd /etc/yum.repos.d wget -N http://public-yum.oracle.com/public-yum-ol7.repo [ol7_openstack20] ... enabled=1 |
install git Add proxy
1 2 3 4 5 6 7 8 9 10 |
# Examples below /etc/yum.conf ... proxy=http://127.0.0.1:8888 /etc/profile export http_proxy=http://127.0.0.1:8888 export https_proxy=http://127.0.0.1:8888 export NO_PROXY=10.10.10.10 # Note: Make sure to add the NO_PROXY otherwise it will hang |
Note: for some of the git packages you might need to do if proxy is not working
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
git clone git://git.openstack.org/openstack/swift.git packages include ceilometer cinder glance heat horizon ironic keystone neutron nova requirements swift tempest |
Devstack quick references http://keithtenzer.com/2015/02/16/building-custom-dashboards-in-openstack-horizon/ To install Quick start with RDO https://www.rdoproject.org/install/quickstart/ Full install RHL or OEL 7 http://docs.openstack.org/liberty/install-guide-rdo/
Solaris 11.3 – openstack Violin / juno 2014.2 – part4
Adding Violin driver to cinder Extract vmemclient-1.1.6.tar.gz and install
1 2 3 |
tar zxf vmemclient-1.1.6.tar.gz cd vmemclient-1.1.6 python setup.py install |
Add the cinder Volume Driver
1 2 3 4 |
gtar -zvxf openstack-cinder-vmemdriver-3.0.0.tar.gz --strip-components=1 -C /usr/lib/python2.7/vendor-packages/ # Check to make sure before running this chown -R root:bin /usr/lib/python2.7/vendor-packages/cinder/ |
Solaris 11.3 – openstack tips / juno 2014.2 – part3
How to check cinder status
1 2 3 4 5 |
cinder-manage service list Binary Host Zone Status State Updated At cinder-scheduler os1 nova enabled :-) 2015-11-19 17:26:58 cinder-volume os2 nova enabled XXX 2015-11-19 14:42:43 cinder-volume os1 nova enabled :-) None |
How to check nova service status
1 2 3 4 5 6 7 8 9 |
nova-manage service list Binary Host Zone Status State Updated_At nova-conductor os1 internal enabled :-) 2015-11-20 16:25:42 nova-cert os1 internal enabled :-) 2015-11-20 16:25:32 nova-scheduler os1 internal enabled :-) 2015-11-20 16:25:41 nova-compute os1 nova enabled :-) 2015-11-20 16:25:42 nova-consoleauth os1 internal enabled :-) 2015-11-20 16:25:42 nova-compute os2 nova enabled :-) 2015-11-20 16:25:35 nova-consoleauth os2 internal enabled :-) 2015-11-20 16:25:36 |
To Associate a volume type with a volume
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
cinder type-create zfssa-2 cinder extra-specs-list +--------------------------------------+-------------+-------------+ | ID | Name | extra_specs | +--------------------------------------+-------------+-------------+ | 08230f2e-7bdb-44eb-acef-eb9ea6e2416a | vio4-thin | {} | | 148cf4c0-604e-4127-bc28-e6b41827da37 | zfs_os1 | {} | | 52815c0d-8984-49a5-b7c3-9050e288a16f | zfssa-2 | {} | | dca407a7-0c05-4666-aeef-e50787e53e67 | vio4-dedup | {} | +--------------------------------------+-------------+-------------+ cinder type-key vio4-thin set volume_backend_name=vio4-thin cinder extra-specs-list +--------------------------------------+-------------+----------------------------------------+ | ID | Name | extra_specs | +--------------------------------------+-------------+----------------------------------------+ | 08230f2e-7bdb-44eb-acef-eb9ea6e2416a | vio4-thin | {u'volume_backend_name': u'vio4-thin'} | | 148cf4c0-604e-4127-bc28-e6b41827da37 | zfs_os1 | {} | | 52815c0d-8984-49a5-b7c3-9050e288a16f | zfssa-2 | {} | | dca407a7-0c05-4666-aeef-e50787e53e67 | vio4-dedup | {} | +--------------------------------------+-------------+----------------------------------------+ cinder type-list # or nova volume-type-list # all parameters cinder extra-specs-list |
How to delete cinder volume driver
1 2 3 4 5 6 7 8 9 10 11 12 13 |
select * from volume_types; +---------------------+------------+---------------------+---------+--------------------------------------+-------------+--------------+ | created_at | updated_at | deleted_at | deleted | id | name | qos_specs_id | +---------------------+------------+---------------------+---------+--------------------------------------+-------------+--------------+ | 2015-11-19 17:23:40 | NULL | NULL | 0 | 148cf4c0-604e-4127-bc28-e6b41827da37 | zfs_os1 | NULL | | 2015-11-19 20:03:44 | NULL | NULL | 0 | 52815c0d-8984-49a5-b7c3-9050e288a16f | zfssa-2 | NULL | | 2015-11-19 20:03:21 | NULL | 2015-11-19 20:03:36 | 1 | 5fabdacc-9197-4527-b350-8e9719db8cee | zfssa-1 | NULL | | 2015-11-23 19:42:28 | NULL | 2015-11-23 21:36:41 | 1 | 636e2656-3e3c-48e0-87e5-82870fb35869 | ssd-vio4 | NULL | +---------------------+------------+---------------------+---------+--------------------------------------+-------------+--------------+ 4 rows in set (0.00 sec) # Now delete zfssa-1 delete from volume_types where name='zfssa-1'; |
How to delete extra services
1 |
mysql>delete from services where host='os1@ssd-vio4'; |
How to fix bad quota
1 2 3 4 5 6 7 8 |
select * from quota_usages; +---------------------+---------------------+------------+---------+----+----------------------------------+---------------------+--------+----------+---------------+ | created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh | +---------------------+---------------------+------------+---------+----+----------------------------------+---------------------+--------+----------+---------------+ | 2015-11-18 22:31:22 | 2015-11-23 22:10:36 | NULL | 0 | 1 | fc52517bf8a947488a77d5c47f70b705 | gigabytes | 3 | 0 | NULL | | 2015-11-18 22:31:22 | 2015-11-23 22:10:36 | NULL | 0 | 2 | fc52517bf8a947488a77d5c47f70b705 | volumes | 0 | update quota_usages set in_use='0' where id='1'; |
Helpful links keystone api / like keystone service-create http://docs.openstack.org/developer/keystone/cli_examples.html Troubleshooting Common OpenStack Errors Troubleshooting […]
To remove an orphaned volume form an openstack deployment
To remove an orphaned volume form an openstack deployment
1 2 3 4 |
mysql>delete from volume_admin_metadata where volume_id='9eb308c2-8f2f-4361-b9a2-fd320e11f8ac'; mysql>delete from volumes where id='17035b2d-0496-48b8-bce0-b2418b13b0a2'; # or a snapshot mysql>delete from snapshot where id='17035b2d-0496-48b8-bce0-b2418b13b0a2'; |
How to remove and old / unused volume group
1 2 3 4 5 6 7 8 9 10 11 12 |
select * from services; select * from services; +---------------------+---------------------+------------+---------+----+-----------------+------------------+------------------+--------------+----------+-------------------+-----------------+ | created_at | updated_at | deleted_at | deleted | id | host | binary | topic | report_count | disabled | availability_zone | disabled_reason | +---------------------+---------------------+------------+---------+----+-----------------+------------------+------------------+--------------+----------+-------------------+-----------------+ | 2015-11-18 20:06:36 | 2015-11-19 20:45:19 | NULL | 0 | 1 | os1 | cinder-scheduler | cinder-scheduler | 8807 | 0 | nova | NULL | | 2015-11-18 21:58:11 | 2015-11-19 19:53:53 | NULL | 0 | 2 | os2 | cinder-volume | cinder-volume | 6762 | 0 | nova | NULL | | 2015-11-19 17:26:53 | 2015-11-19 19:55:29 | NULL | 0 | 3 | os1 | cinder-volume | cinder-volume | 878 | 0 | nova | NULL | | 2015-11-19 20:00:36 | 2015-11-19 20:04:46 | NULL | 0 | 4 | os1@zfssa | cinder-volume | cinder-volume | 25 | 0 | nova | NULL | | 2015-11-19 20:06:27 | 2015-11-19 20:45:11 | NULL | 0 | 5 | os1@zfssa-2 | cinder-volume | cinder-volume | 183 | 0 | nova | NULL | +---------------------+---------------------+------------+---------+----+-----------------+------------------+------------------+--------------+----------+-------------------+-----------------+ |
Delete old unused volume group
1 2 |
mysql> delete from services where id='4'; Query OK, 1 row affected (0.00 sec) |
Solaris 11.3 – openstack install / juno 2014.2 – part2
Creating openstack zone archive
1 2 3 4 5 |
zonecfg -z openstack_install create # or for kernel zone zonecfg -z openstack_kz create -t SYSsolaris-kz zoneadm -z openstack_install install zoneadm -z openstack_install boot |
Prepare the zone for uploading to Glance by first creating SSH authentication credentials to enable root SSH for OpenStack root login access Enable root ssh with key
1 2 3 4 5 6 |
root@zone-name# sed /^PermitRootLogin/s/no$/without-password/ < /etc/ssh/sshd_config > /system/volatile/sed.$$ root@zone-name# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig root@zone-name# cp /system/volatile/sed.$$ /etc/ssh/sshd_config archiveadm create -z openstack_install /zones/openstack-ngz.uar |
How to use cinder with ZFS appliance iSCSI Configure iSCSI to each compute node
1 2 3 4 5 6 7 8 |
svcadm enable nas1a Get the zfs appliance Initiator and ip address iscsiadm add static-config iqn.1986-03.com.sun:02:76f57f55-433a-e28e-baa0-9dba77d35bd4,10.10.10.50 # Add to zfs appliance, under AddInitiators # Get the host initiator iscsiadm list initiator-node |grep "Initiator node name" iscsiadm list initiator-node |
Add a volume type with the name […]