Getting Started Hacking OpenNebula - Fosdem-2013

2,034 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,034
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
45
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Getting Started Hacking OpenNebula - Fosdem-2013

  1. 1. Fosdem 2013 Brussels, Belgium, February 3rd, 2013 Getting Started Hacking OpenNebula Jaime Melis Project Engineer© OpenNebula Project. Creative Commons Attribution-NonCommercial-ShareAlike License
  2. 2. What is OpenNebula? Public Cloud Private Cloud Simple Web Interface A Cloud behind a Infrastructure Resources firewall Elastic & “infinite” Security Concerns Improve Operations Hybrid Cloud / CloudBursting Supplement Capacity of the Private CloudThe OpenNebula Project
  3. 3. What is OpenNebula? Interfaces, Tools & API ● CLI & Sunstone (GUI) ● API ● Cloud (EC2,OCCI) ● Service Management & Catalogs Network Storage ● VLAN ● VM disks (file & block) ● Firewalling ● Image Distribution ● Multiple Technologies ● Multiple Backends Multi-tenancy ● AAA Services ● Scheduling ● Permissions & roles Compute Hosts ● Grouped into logical clusters ● Multiple hypervisors ● MonitoringThe OpenNebula Project
  4. 4. What is OpenNebula?Design Principles ● Flexible: One solution can not fit all data-centers ● Provide basic components, but easily hacked by others ● Simple: just-what-you-need components & simple protocols ● Scalable: single instance & multi-tier architectures ● Be interoperable! rich set of APIs & Interfaces ● Open Source: Apache License v2.0000The OpenNebula Project
  5. 5. What is OpenNebula?Simplicity VM VM VM VM VM VM VM VM Hypervisor Physical Hardware ... Hypervisor Physical Hardware Host HostThe OpenNebula Project
  6. 6. The Cloud Integrator PerspectiveThe Cloud Integrator Perspective CLI GUI Cloud Servers Scheduler OCA (Ruby, Java) XML-RPC API OpenNebula core Monitoring Storage Network DB Virtualization Images Auth LanguagesThe OpenNebula Project
  7. 7. The Cloud Integrator PerspectiveHow to Develop Drivers Drivers Cloud CLI GUI Servers ● Small scripts for each action OCA (Ruby, Java) Scheduler ● Any language (shell, Ruby, Python,...) ● Different drivers can co-exist in XML-RPC API heterogeneous environments OpenNebula core Monitoring Storage Network DB Virtualization Images Auth Easy to adapt Easy to create new ones Easy to maintainThe OpenNebula Project
  8. 8. The Cloud Integrator PerspectiveHow to Develop Drivers Virtualization Drivers Cloud ● Translate the OpenNebula VM life-cycle CLI GUI management into specific hypervisor Servers operations OCA (Ruby, Java) Scheduler Monitoring Drivers XML-RPC API ● Gather information about the physical host and hypervisor status OpenNebula core Hybrid Cloud Drivers Monitoring Storage Network DB ● Interact with an external provider instead of Virtualization Images Auth a hypervisor OpenNebula distribution Community contributionsThe OpenNebula Project
  9. 9. The Cloud Integrator PerspectiveVirtual Machine Manager Drivers Deployment flow for KVM Deployment ssh $host: ● write deployment file Core file bash kvm/deploy ● virsh create [...] <domain type=kvm> domain=$1 <name>one-1</name> <cputune> mkdir -p `dirname $domain` <shares>103</shares> </cputune> cat > $domain <memory>65536</memory> <os> data=`virsh --connect $LIBVIRT_URI <type arch=i686> create $domain` hvm </type> if [ "x$?" = "x0" ]; then <boot dev=hd/> echo $data | sed s/Domain // | </os> sed s/ created from .*$// else <devices> error_message "Could not create" ... " domain from $domain" </devices> exit -1 </domain> fiThe OpenNebula Project
  10. 10. The Cloud Integrator PerspectiveVirtual Machine Manager Drivers Virtualization Driver Example: Hypervisor: Xen Action: migrate Description: live-migrates a running VM to the specified HostThe OpenNebula Project
  11. 11. The Cloud Integrator PerspectiveCreating a new set of drivers Adapting KVM drivers for QEMU 1. $ cp -r /var/lib/one/remotes/vmm/kvm /var/lib/one/remotes/vmm/qemu 2. qemu/deploy: type = kvm => type = qemu and call kvm/deploy qemu/deploy sed "s/type=kvm/type=qemu/" | $(dirname $0)/../kvm/deploy $@ 3. fix poll script to detect qemu qemu/poll (diff) @@ -269,7 +269,7 @@ if !hypervisor case $0 - when %r{/vmm/kvm/} + when %r{/vmm/(qemu|kvm)/} hypervisor=KVMThe OpenNebula Project
  12. 12. The Cloud Integrator PerspectiveHow to Develop Drivers Image & Storage Drivers Cloud ● Create or Import new Images into the CLI GUI Servers Image Repository Scheduler ● File management between the Image OCA (Ruby, Java) Repository and the physical hosts XML-RPC API OpenNebula coreMonitoring Storage Network DBVirtualization Images Auth OpenNebula distribution Community contributions ● Shared FS (nfs, gluster, lustre, ...) ● LVM MooseFS CDMI API ● iSCSI (tgt) ● SSH ● HTTP Swift/GlanceThe OpenNebula Project
  13. 13. The Cloud Integrator PerspectiveImage & Storage Drivers Datastore Transfer Manager ● cp ● clone ● stat ● ln ● mkfs ● mkimage ● clone ● mkswap ● rm ● mv ● mvds ● context ● delete ● postmigrate ● premigrateThe OpenNebula Project
  14. 14. The Cloud Integrator PerspectiveImage & Storage Drivers Datastore iscsi / cp Image ssh $DST_HOST: Core template bash iscsi/cp ● create LV base64 ● create tgt lun ● dump image # Create LV and Setup tgt LUN REGISTER_CMD=$(cat <<EOF set -e $SUDO $LVCREATE -L${SIZE}M ${VG_NAME} -n ${LV_NAME} $SUDO $(tgt_setup_lun "$IQN" "$DEV") $SUDO $(tgt_admin_dump_config "$TARGET_CONF") EOF ) ssh_exec_and_log "$DST_HOST" "$REGISTER_CMD" # Dump exec_and_log "eval $DUMP | $SSH $DST_HOST $SUDO $DD of=$DEV bs=2M"The OpenNebula Project
  15. 15. The Cloud Integrator PerspectiveHow to Develop Drivers Networking drivers CLI GUI Cloud ● Manage network configuration in Servers Scheduler the hosts OCA (Ruby, Java) XML-RPC API ● Firewalling rules ● Network Isolation OpenNebula core ● Bridge creationMonitoring Storage Network Structure DBVirtualization Images Auth ● pre ● post ● clean OpenNebula distribution Community contributions ● VLAN, 802.1Q ● OpenvSwitch ● ebtables quantum ● FLAT ● firewall*The OpenNebula Project
  16. 16. The Cloud Integrator PerspectiveNetwork Drivers 802.1Q / pre VM template ssh $DST_HOST: ● create bridge Core ● tag phy dev base64 bash 802.1Q/pre ● attach to bridge require HostManaged hm = OpenNebulaHM.from_base64(ARGV[0]) exit hm.activate Strategy ● what hypervisor? ● name of the vnet device? ● create bridge, tag, ...The OpenNebula Project
  17. 17. The Cloud Integrator PerspectiveHow to Develop Drivers Authentication drivers Cloud CLI GUI ● Strong security Servers ● Flexibility OCA (Ruby, Java) Scheduler XML-RPC API Authorization drivers ● Add any limitations to the user actions OpenNebula coreMonitoring Storage Network DBVirtualization Images Auth OpenNebula distribution Community contributions ● SSH Keypairs ● x509 Certificates ● LDAP ● Active Directory ● ACLs ● QuotasThe OpenNebula Project
  18. 18. The Cloud Integrator PerspectiveHow to Interact with OpenNebula XML-RPC Cloud CLI GUI ● Simple, fast Servers ● Works in any language OCA (Ruby, Java) Scheduler XML-RPC API OCA (OpenNebula Cloud API) ● High level bindings ● Complete functionality OpenNebula core ● Ruby, Java, PythonMonitoring Storage Network DBVirtualization Images Auth OpenNebula distribution Community Contributions Administrator GUI User GUI OCCI ● Cloud APIs CDMI ● OVF ●The OpenNebula Project
  19. 19. The Cloud Integrator PerspectiveHow to Interact with OpenNebula OCA Ruby Example: Shutdown all my Virtual MachinesThe OpenNebula Project
  20. 20. Tools for Users and AdministratorsOpenNebulaApps Manage services Automatic installation of Host your own software stacks marketplace Service Example App Example {"name": "my_service", {"name": "wordpress", "deployment": "run_list": [ "straight", "recipe[mysql::server]", "roles": [ "recipe[wordpress]" { ], "name": "frontend", "wordpress": { "vm_template": 0 "db": { }, "database": "${WP_DB_NAME}", { "user": "${WP_DB_USER}", "name": "db_master", "password": "${WP_DB_PASSWORD}" "parents": [ } "frontend" }, ], "mysql": { "vm_template": 1 "server_root_password": }] "${DB_PASSWORD}" } }The OpenNebula Project }
  21. 21. Join our growing community!I Like OpenNebula, what can I do? Help us make OpenNebula even better by... Community Activity ● Use OpenNebula! give us feedback ● Contributions by users: RIM, Akamai, Logica, ● Join our mailing list FermiLab, SARA, Terradue… ● Report bugs or features at development at dev. opennebula.org ● > 100 in opennebula.org/about:contributors ● Translate OpenNebula ● ~ 500 in dev.opennebula.org ● Share your Virtual Appliances ● Sunstone in 17 languages ● Use master ● Components in the ecosystem by RIM, China ● Write howtos Mobile… ● Share your use cases ● Submit patches ● Maintain OpenNebula in your distro of choice IRC Channel ● #opennebula on irc.freenode.netThe OpenNebula Project
  22. 22. What is OpenNebula?Try OpenNebula Cloud Sandbox - Virtual Appliance A real cloud in your laptop under 5 minutes by downloading a pre- configured automated installation of OpenNebula. opennebula.org/cloud:tryout Available Platforms ● Amazon ● VirtualBox ● VMWare ● KVMThe OpenNebula Project
  23. 23. Want more?More OpenNebula @FOSDEM Enabling cloud for e-Science with OpenNebula 11:30. Chavanne. Zeeshan Ali BuildSys and QA in CentOS using a Private Cloud: OpenNebula 12:00. H.1302. Karanbir Singh & Jaime Melis Raindrops 13:00. H.1301. Karanbir Singh & Jaime MelisThe OpenNebula Project
  24. 24. Questions?We Will Be Happy to Answer any Question TL; DR: OpenNebula is awesome, go check it out! @opennebulaThe OpenNebula Project
  25. 25. About the Project Differentiating Factors in the Market ● Focus on enterprise data center virtualization ● Rich functionality for private clouds: on-demand provision of virtual data centers, self-service portal and catalog, clustering, fault tolerance… ● Wide integration capabilities with data center services: monitoring, computing, storage, networking, chargeback, authentication… ● Service management with automatic installation and configuration of software stacks, multi-tier service catalog and provision… ● External cloud connectors for hybrid cloud computing ● Delivered as a production-proven, packaged product with single installing and upgrade process ● Direct support from developersThe OpenNebula Project

×