Date post: | 12-Apr-2017 |
Category: |
Technology |
Upload: | cloudops2005 |
View: | 457 times |
Download: | 4 times |
cloudops.com @cloudops_
CloudStack in Docker
October 9th, 2015
Pierre-Luc Dion @pdion891 [email protected]
cloudops.com @cloudops_ Page
About me
2
Cloud Architect @ CloudOps / cloud.ca Work full time with Apache CloudStack
As user As contributor
Apache CloudStack PMC member Ruby and Chef Enthusiast
@pdion891 [email protected]
cloudops.com @cloudops_
Why CloudStack inside Docker
- Deployment simplicity docker pull cloudstack/simulator docker run --name simulator -p 8080:8080 -d cloudstack/simulator
- Deploy POC faster
- Use it as part of the CI test
- Easy to distribute
cloudops.com @cloudops_
CloudStack in Docker constraints
• Management Server mount systemvm.iso to update sshkey at first boot • Using Docker to validate package build (deb/rpm)?
• Cannot use CentOS 7 container based to test CentOS 7 RPM’s
• Containers are big (800MB – 2GB)
cloudops.com @cloudops_ Page
ü docker version 1.7 ü min ~ 4GB disk space ü ~ 8GB memory
ü docker version 1.7 ü min ~ 16 GB disk space ü ~ 8GB memory ü min ~20GB disk in /exports/secondary
ü Hypervisor host(s) ü primary storage
Multi images stack
9
Simulator
What you need
cloudops.com @cloudops_
Deploy Simulator and a cloud
docker pull cloudstack/simulator docker pull cloudstack/marvin docker run --name simulator -p 8080:8080 \ -d cloudstack/simulator docker run -ti --rm --link simulator:8096 \ cloudstack/marvin \ python /root/tools/marvin/marvin/deployDataCenter.py \ -i /root/setup/dev/advanced.cfg
cloudops.com @cloudops_
Perform nosetest on the simulator
docker run -ti --rm –link simulator:8096 \ -v /home/user:/user cloudstack/marvin \ nosetests-2.7 -v --with-marvin \ --marvin-config=/user/advanced.cfg \ --with-xunit \ --xunit-file=xunit.xml \ -a tags=advanced,required_hardware=true \ --zone=acs3 \ --hypervisor=xenserver \
-w integration/smoke
cloudops.com @cloudops_
Docker compose: cloudstack-compose.yml (1/2)
mysql: image: mysql:5.5 environment: MYSQL_ROOT_PASSWORD: password nfs: image: pdion891/unfs3 privileged: true ports: - "111:111/udp" - "111:111/tcp" - "2049:2049/udp" - "2049:2049/tcp" volumes:
- /exports:/exports ß Secondary Storage path = /exports/secondary
ß community image
ß community image fork
cloudops.com @cloudops_
Docker compose: cloudstack-compose.yml (2/2)
cloudstack: image: cloudstack/management_centos6 links: - mysql ports: - "8080:8080" - "8250:8250" volumes: - /exports:/exports environment: HYPERVISOR_TEMPLATE: xenserver DEV_API: true CLOUDSTACK_HOST: 172.16.21.101 ß host IP
Download SystemVM template
cloudops.com @cloudops_
Deploy Data-Center
docker run -ti --rm --link ccauser_cloudstack_1:8096 \ -v /home/cca-user:/cca-user \ cloudstack/marvin \ python /marvin/marvin/deployDataCenter.py \ -i /cca-user/advanced.cfg
cloudops.com @cloudops_
docker pull cloudstack/cloudmonkey
[root@coe-acs3-mgt01 cca-user]# docker run -ti --rm --link \ > ccauser_cloudstack_1:8080 \ > cloudstack/cloudstack-cloudmonkey ☁ Apache CloudStack 🐵 cloudmonkey 5.3.2. Type help or ? to list commands. Using management server profile: container (container) > set url http://ccauser_cloudstack_1:8080/client/api (container) > sync 510 APIs discovered and cached
cloudops.com @cloudops_
unexpected surprised
• Definitely faster to deploy with Docker
• Lot of bash scripts needed to facilitate instantiation
• db.properties must be edit at every creation instance.
• Don’t have to care about systemvm template anymore
• Some behavior changed between docker run and docker-compose
• Effort: cloudstack in Docker == Chef Recipe
cloudops.com @cloudops_
unexpected surprised
• Images set is fairly large ~10G for the current stack
[root@coe-acs3-mgt01 /]# docker images REPOSITORY TAG CREATED VIRTUAL SIZE pdion891/management_centos6 latest 44 hours ago 1.443 GB cloudstack/marvin latest 2 days ago 782.8 MB pdion891/unfs3 latest 2 days ago 358.3 MB mysql 5.5 4 days ago 256.5 MB cloudstack/cloudstack-cloudmonkey latest 6 weeks ago 690.7 MB
cloudops.com @cloudops_
Improving our containers
• Smaller image base
• Deploy CloudStack from a .war file
• Remove the tail