8. @remibergsma@neubauerf
Get a copy of the slides to copy/paste the commands
Getting the slides
Slides are here: http://www.slideshare.net/remibergsma
9. @remibergsma@neubauerf
Workshop environment
You will get a Bubble, hosted in the
Schuberg Philis Mission Critical Cloud.
Remember: you can later create your
very own Bubble with the
provided cookbooks and scripts.
10. @remibergsma@neubauerf
Workshop environment
L0: KVM hypervisor
in Schuberg Philis Cloud
L1: devops-cosmic0x hypervisor
L2: KVM
hypervisors
systemvm
L3: uservm
L2: KVM
hypervisors
systemvm
L3: uservm
Cosmic Mgt server
Services in box:
VPN
NFS / WEB
SSH
Ipsec VPN connection to 85.222.238.190
SSH to 192.168.22.1 over vpn
Management network: 192.168.22.0/24
Public network : 192.168.23.0/24
192.168.22.1
All L3 VMs reachable via public network
All L2 VMs reachable via mgt network
Other VMs if needed
20. @remibergsma@neubauerf
Prepare virtual infraNote: kvm1: Running pre_boot script: virt-customize -d kvm1 --firstboot /data/shared/deploy/default/firstboot/centos7-kvm-ovs.sh
[ 0.0] Examining the guest ...
Note: kvm2: Running pre_boot script: virt-customize -d kvm2 --firstboot /data/shared/deploy/default/firstboot/centos7-kvm-ovs.sh
[ 0.0] Examining the guest ...
Note: cs1: Running pre_boot script: virt-customize -d cs1 --firstboot /data/shared/deploy/default/firstboot/centos7-cloudstack-
dev.sh
[ 0.0] Examining the guest ...
[ 10.0] Setting a random seed
[ 10.0] Installing firstboot script: [1] /data/shared/deploy/default/firstboot/centos7-kvm-ovs.sh
[ 10.0] Finishing off
Note: kvm1: Running postboot script: /data/shared/deploy/default/postboot/post_detect_reboot.sh kvm1
Note: kvm1: Waiting for the VM to boot...
[ 11.0] Setting a random seed
[ 11.0] Installing firstboot script: [1] /data/shared/deploy/default/firstboot/centos7-kvm-ovs.sh
[ 10.0] Setting a random seed
[ 10.0] Installing firstboot script: [1] /data/shared/deploy/default/firstboot/centos7-cloudstack-dev.sh
[ 11.0] Finishing off
[ 10.0] Finishing off
Note: kvm2: Running postboot script: /data/shared/deploy/default/postboot/post_detect_reboot.sh kvm2
Note: kvm2: Waiting for the VM to boot...
Note: cs1: Running postboot script: /data/shared/deploy/default/postboot/post_detect_reboot.sh cs1
Note: cs1: Waiting for the VM to boot...
Note: kvm1: Installing and configuring
Note: kvm1: This will take some time. You may send this to the background.
Note: kvm2: Installing and configuring
Note: kvm2: This will take some time. You may send this to the background.
Note: cs1: Installing and configuring
Note: cs1: This will take some time. You may send this to the background.
Note: kvm1: Rebooting
Note: kvm2: Rebooting
Note: kvm1: Ready for duty!
Note: kvm2: Ready for duty!
Note: cs1: Rebooting
Note: cs1: Ready for duty!
21. @remibergsma@neubauerf
[root@mct-devops1 deploy]# virsh list
Id Name State
----------------------------------------------------
3 cs1 running
4 kvm1 running
5 kvm2 running
Your cloud for today
KVM hypervisors
Cosmic management
Give it some time to finish the setup..
22. @remibergsma@neubauerf
[root@devops-cosmic99 deploy]# ssh root@cs1 (password=password)
[root@cs1 ~]# cd /data/shared/helper_scripts/cosmic
[root@cs1 ~]# ./prepare_cosmic_compile.sh
Prepare Mgt Server
This will setup all dependencies
23. @remibergsma@neubauerf
[root@cs1 ~]# cd /data/git/$HOSTNAME/cosmic
[root@cs1 ~]# cd /data/shared/helper_scripts/cosmic
[root@cs1 ~]# ./build_run_deploy_test.sh -m /data/shared/marvin/mct-
zone1-kvm1-kvm2-v2.cfg
Compile Cosmic mgt
Compile in done!
The UI should be up after a few minutes, available from your Mac: http://cs1.cloud.lan:8080/client/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6:24.846s
[INFO] Finished at: Tue Jun 28 17:15:15 CEST 2016
[INFO] Final Memory: 92M/351M
[INFO] ------------------------------------------------------------------------
Compile Cosmic, Build RPM packages for KVM, Start Mgt server, Deploy Cloud
24. @remibergsma@neubauerf
Deploy your Cloud
Deploy data center..
[INFO] 2016-06-28 17:45:45,452 - marvin - Parsing Test data successful
[INFO] 2016-06-28 17:45:45,719 - marvin - === Test Client Creation Successful ===
[INFO] 2016-06-28 17:45:45,728 - marvin - === Deploy DC Started ===
[INFO] 2016-06-28 17:45:46,191 - marvin - === Create Zone Successful ===
[INFO] 2016-06-28 17:45:51,409 - marvin - === Creating Physical Network Name : mcct-pnet Id : 6d4920bd-
a52a-49a4-91df-826f3d37ee85 Successful ===
[INFO] 2016-06-28 17:46:16,913 - marvin - === Update Network Service Provider Successfull ===
[INFO] 2016-06-28 17:46:27,086 - marvin - === Update Network Service Provider Successfull ===
[INFO] 2016-06-28 17:46:37,270 - marvin - === Update Network Service Provider Successfull ===
[INFO] 2016-06-28 17:47:46,764 - marvin - === Add Host Successful ===
[INFO] 2016-06-28 17:48:50,170 - marvin - === Add Host Successful ===
[INFO] 2016-06-28 17:49:50,717 - marvin - === Creating Storage Pool Successful ===
[INFO] 2016-06-28 17:49:50,881 - marvin - === Add Image Store Successful ===
[INFO] 2016-06-28 17:49:50,932 - marvin - === Enable Zone Successful ===
[INFO] 2016-06-28 17:49:50,935 - marvin - === Data Center Settings are dumped to dc_entries_Jun_28_2016_17_49_50.obj ===
[INFO] 2016-06-28 17:49:50,942 - marvin - === Deploy DC Successful ===
Tue Jun 28 17:49:50 CEST 2016
Checking template status..
Tue Jun 28 17:56:06 2016 At least template 'tiny linux kvm' is not Ready
http://localhost:8096/client/api?command=listTemplates&templatefilter=all&response=json
Tue Jun 28 17:56:21 2016 All templates are ready!
True
Tue Jun 28 17:56:22 CEST 2016
Not running tests (use -t flag to run them)
Finished
Tue Jun 28 17:56:22 CEST 2016
Fully automatic….
35. @remibergsma@neubauerf
We started the Mgt server using Jetty.
Cosmic is a Java app. So, let’s stop Jetty and start Tomcat.
That makes stop/start easier :-)
$ ssh cs1
$ killall -9 java
$ ps aux | grep java
$ cp /data/git/cs1/cosmic/cosmic-client/target/cloud-*.war ~tomcat/
webapps/client.war
$ systemctl start tomcat
We’ll drop the war we compiled before into Tomcat
It’s Java!
Make sure all is gone..
36. @remibergsma@neubauerf
It’s Java!
[root@cs1 webapps]# systemctl status tomcat
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2016-06-28 20:58:10 CEST; 11min ago
$ systemctl status tomcat
The UI / API will be back in a few minutes…
$ tail -n 100 /var/log/cosmic/management/management-server.log
43. @remibergsma@neubauerf
Learn API calls using FireBug
API docs:
https://cloudstack.apache.org/api/apidocs-4.4/TOC_Root_Admin.html
https://getfirebug.com/releases/lite/chrome/
Use this icon to start FireBug
Install using this page
44. @remibergsma@neubauerf
Play with CloudMonkey
It has been pre-setup on your cs1 VM
(local) 🐵 > set display table
(local) 🐵 > list virtualmachines filter=name,state,hypervisor,templatename,instancename,
count = 6
virtualmachine:
+------------+---------+--------------+----------------------+----------------+
| hypervisor | state | instancename | name | templatename |
+------------+---------+--------------+----------------------+----------------+
| KVM | Running | i-2-10-VM | devops006 | tiny linux kvm |
| KVM | Running | i-2-8-VM | devops005 | tiny linux kvm |
| KVM | Running | i-2-7-VM | devops-with-password | tiny linux kvm |
| KVM | Running | i-2-6-VM | devops003 | tiny linux kvm |
| KVM | Running | i-2-5-VM | devops002 | tiny linux kvm |
| KVM | Running | i-2-3-VM | devops001 | tiny linux kvm |
+------------+---------+--------------+----------------------+----------------+
(local) 🐵 >
(local) 🐵 > list networks filter=name,networkdomain,vlan,cidr
count = 1
network:
+-------------+---------------+------------+------+
| cidr | networkdomain | name | vlan |
+-------------+---------------+------------+------+
| 10.1.1.0/24 | cs2cloud | devopsdays | 115 |
+-------------+---------------+------------+------+
(local) 🐵 >
45. @remibergsma@neubauerf
Deploy with CloudMonkey
Deploy another VM in the same network, using CloudMonkey.
Exercise:
TIP: You may want to deploy one via UI first and watch FireBug send API calls…
TIP: You can do this by sending just one API call.
<tab><tab>
48. @remibergsma@neubauerf
More exercises
Setup multiple tenants
Create a new network from the API
Explore VPC
Add another cluster to Cosmic
Create HA service offering and apply it to Tiny VM
What happens when a hypervisor crashes?
…… Have fun!