Interoperable OpenStack guest
provisioning

Alessandro Pilotti
CEO
@cloudbaseit
OpenStack
An open source IaaS project
– Apache 2 license

Managed by the OpenStack Foundation
– More than 150 companies jo...
Releases
Very aggressive schedule
–

•

Essex
–
–

•

Apr 2013

Havana
–

•

October 2012
Cloudbase Solutions involvement ...
OpenStack Architecture
• Distributed Components
– Can be deployed on a single server or multiple servers

• Public RESTful...
Components
Compute (Nova)
Object Storage (Swift)
Block Storage (Cinder)
Image Service (Glance)
Networking (Neutron)
Dashbo...
Architecture 1
Architecture 2
Component interaction
• AMQP
– RabbitMQ
– Apache Qpid

• API
– RESTful services

• Database
– Any Python SQLAlchemy provid...
And now the guests
• Nova’s IaaS role ends in the moment in
which the VM boots.
• What happens afterwards, is something th...
Guest init actions
•
•
•
•

Setting the host name
Manage users / groups
Configure network
Deploy ssh keys for public key a...
Config data?
• Passing configuration data to the guest is
tricky
– Remember: no networking yet!

• The “classic” EC2 appro...
Multi platform support
• This is the really tricky part
• IaaS components (e.g. Nova) don’t care
about the guest OS
• Doin...
Cloudbase-Init
• Standard de facto on Windows OpenStack
deployments
• Ported to FreeBSD as well:
– https://github.com/pell...
Architecture
• Needs to be completely decoupled from the
OS
– Must be portable to any OS

• Highly extensible model
• Basi...
Tricky Windows parts
• CPython works great on Windows
– Lots of modules for basic OS integration

• What to do when we nee...
Examples -WMI
• Win32_NetworkAdapter
– https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/osutils/window...
Examples - ctypes
• Win32 - VerifyVersionInfoW
– https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/osut...
Examples COM
• COM exposes properties and methods via
getattr / setattr
• Volumes management
– https://github.com/cloudbas...
Logging to serial port
• Fact: serial ports never grow old 
• Clouds use often serial ports to
communicate between hyperv...
pyserial
• Windows does not log to serial port
• Serial port can be integrated into Python’s
logging
– https://github.com/...
Q&A
Upcoming SlideShare
Loading in …5
×

Interoperable OpenStack guest provisioning with Cloudbase-Init

2,769 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,769
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
26
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Interoperable OpenStack guest provisioning with Cloudbase-Init

  1. 1. Interoperable OpenStack guest provisioning Alessandro Pilotti CEO @cloudbaseit
  2. 2. OpenStack An open source IaaS project – Apache 2 license Managed by the OpenStack Foundation – More than 150 companies joined it including: – AMD, Intel, Canonical, SUSE Linux, Red Hat, Cisco, Dell, HP, IBM, NEC, Vmware Portable – Mostly used on Linux Written in Python
  3. 3. Releases Very aggressive schedule – • Essex – – • Apr 2013 Havana – • October 2012 Cloudbase Solutions involvement - Hyper-V re-included  Grizzly – • Apr 2012 Hyper-V removed Folsom – – • Twice a year October 2013 Icehouse – Apr 2014
  4. 4. OpenStack Architecture • Distributed Components – Can be deployed on a single server or multiple servers • Public RESTful API – Bindings available for various languages (including .Net) • Queues (AMQP) for private APIs – Great scalability • Relational DBs for storing the configuration – MySQL, PostgreSQL, SQLite (and SQL server) • UI – CLI tools – Web dashboard
  5. 5. Components Compute (Nova) Object Storage (Swift) Block Storage (Cinder) Image Service (Glance) Networking (Neutron) Dashboard (Horizon) Identity (Keystone) Metering (Ceilometer) Orchestration (Heat)
  6. 6. Architecture 1
  7. 7. Architecture 2
  8. 8. Component interaction • AMQP – RabbitMQ – Apache Qpid • API – RESTful services • Database – Any Python SQLAlchemy provider – Mostly MySQL – SQL Server required various bug fixes
  9. 9. And now the guests • Nova’s IaaS role ends in the moment in which the VM boots. • What happens afterwards, is something that the guest OS has to sort out. • Clouds need to support a variety of guest operating systems: – – – – Linux (Ubuntu, RHEL / CentOS and lots more) Windows Server (and workstation for VDI) FreeBSD etc
  10. 10. Guest init actions • • • • Setting the host name Manage users / groups Configure network Deploy ssh keys for public key auth – Passwords are BAD! • Extend partitions automatically • Run custom scripts • (and more)
  11. 11. Config data? • Passing configuration data to the guest is tricky – Remember: no networking yet! • The “classic” EC2 approach – A url on a magic IP http://169.254.169.254 – Various HTTP metadata format exists • e.g. EC2, OpenStack (Nova) • An ISO image (ConfigDrive) – File system reflects the content available via HTTP
  12. 12. Multi platform support • This is the really tricky part • IaaS components (e.g. Nova) don’t care about the guest OS • Doing provisioning in Linux differs from Windows and from FreeBSD • cloud-init works on Linux – Too tightly coupled with the OS – Porting is very though • So we had to start a new project 
  13. 13. Cloudbase-Init • Standard de facto on Windows OpenStack deployments • Ported to FreeBSD as well: – https://github.com/pellaeon/bsd-cloudinit • “Made in TM”, like the rest of the Cloudbase stuff  • 100% Python code
  14. 14. Architecture • Needs to be completely decoupled from the OS – Must be portable to any OS • Highly extensible model • Basic UML class diagram: – https://drive.draw.io/#G0B6gjkOr4OobDQnVHY0 QyQ2pSVlE
  15. 15. Tricky Windows parts • CPython works great on Windows – Lots of modules for basic OS integration • What to do when we need to go “deeper”? – PyWin32 • COM • Wraps lots of Win32 APIs – PythonNet • .Net • Not to be confused with IronPython! – WMI • CIM implementation – Ctypes • • • • Direct Win32 calls Very flexible Can be tedious to code Similar to .Net PInvoke
  16. 16. Examples -WMI • Win32_NetworkAdapter – https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/osutils/windows.py #L340
  17. 17. Examples - ctypes • Win32 - VerifyVersionInfoW – https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/osutils/windows.py #L557 • Portable - openssl API – https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/utils/crypt.py#L124
  18. 18. Examples COM • COM exposes properties and methods via getattr / setattr • Volumes management – https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/plugins/windows/v ds.py#L322 – https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/plugins/windows/e xtendvolumes.py#L161
  19. 19. Logging to serial port • Fact: serial ports never grow old  • Clouds use often serial ports to communicate between hypervisors and guests – E.g. OpenStack with KVM • Linux can easily use serial ports for console I/O – That’s how Unix was used in the old days 
  20. 20. pyserial • Windows does not log to serial port • Serial port can be integrated into Python’s logging – https://github.com/cloudbase/cloudbaseinit/blob/master/cloudbaseinit/utils/log.py#L34 • By adding this Log Handler, anytime you issue a LOG.info/warn/error etc it will be logged to serial port and collected by KVM (for example)
  21. 21. Q&A

×