SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
LXC@Libvirt
Erkan Yanar
linsenraum.de
18. April 2013
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 1 / 31
Who am I?
Who am I?!
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 2 / 31
What is this talk about
What is this talk about
LXC
Libvirt
LXC@Libvirt
OpenStack
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 3 / 31
What is this talk about
What is this talk about
LXC
Libvirt
LXC@Libvirt
OpenStack NOT
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 3 / 31
LXC
LXC: Keine Einf¨uhrung
Containervirtualisierung
Kernel 2.6.24
Keine CPU mit
Hardwarevirt. notwendig
aptitude install lxc
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 4 / 31
LXC
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 5 / 31
LXC CGroups
CGroups
Virtuelles Filesystem
Gruppierungen von Prozessen
Zuweisung von Ressourcen
Messen des
Ressourcenverbrauchs
memory
cpuset
cpu
blkio
. . .
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 6 / 31
LXC CGroups
CGroups
Virtuelles Filesystem
Gruppierungen von Prozessen
Zuweisung von Ressourcen
Messen des
Ressourcenverbrauchs
memory
cpuset
cpu
blkio
. . .
Lets have a Look
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 6 / 31
LXC Namespaces
Namespaces
Isoliert die Umgebung eines Prozesses(Gruppe).
UTC
PID
Network
User
. . .
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 7 / 31
LXC Namespaces
LXC
LXC=CGroups + Namespaces + Capabilities
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 8 / 31
LXC Namespaces
LXC
LXC=CGroups + Namespaces + Capabilities
Alles im VanillaKernel :)
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 8 / 31
Usage
lxc Kommandos:
lxc-attach lxc-freeze lxc-setcap
lxc-backup lxc-info lxc-setuid
lxc-cgroup lxc-kill lxc-shutdown
lxc-checkconfig lxc-list lxc-start
lxc-checkpoint lxc-ls lxc-start-ephemeral
lxc-clone lxc-monitor lxc-stop
lxc-console lxc-netstat lxc-unfreeze
lxc-create lxc-ps lxc-unshare
lxc-destroy lxc-restart lxc-version
lxc-execute lxc-restore lxc-wait
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 9 / 31
Usage Containertypen
Containertypen
Applikationscontainer → Server
Applikationscontainer → Auch f¨ur Desktop
Klassische Container
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 10 / 31
Usage ApplicationContainer: lxc.conf
Kleine Applikationscontainer
Einzelne Prozesse(Gruppe) isolieren
CGroups
Namespace
easy!
lxc-execute -n NAME -f configfile /path/program
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 11 / 31
Usage ApplicationContainer: lxc.conf
Applikationscontainer confile
lxc.utsname=application
man lxc.conf
Schauen wir mal
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 12 / 31
Usage Container: lxc.conf
Create Container
lxc-create -n name -t template -f configfile
Main Difference
lxc.rootfs ← chroot
/sbin/init
Play with it
lxc-attach
mc . . .
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 13 / 31
Usage Funktionalit¨at
Schlagworte
Keine Livemigration (Flying Container) → http://criu.org
Geringer Footprint
Weniger M¨oglichkeiten
Security?
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 14 / 31
Libvirt
Libvirt
Abstraktion
Stabile API
virt-manager
Remote-access
virsh Domain Management
virsh Domain Monitoring
virsh Host and Hypervisor
virsh Interface
virsh Network Filter
virsh Networking
virsh Storage Pool
virsh Storage Volume
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 15 / 31
Libvirt CGroups
CGroups@Libvirt
Merkw¨urdige Unterst¨uzung
Lets have a look into the filesystem
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 16 / 31
LXC@Libvirt
LXC@Libvirt
LXC@Libvirt
aptitude install libvirt-bin
Propagiertes Projekt
qemu/kvm am besten unterst¨utzt
http://libvirt.org/hvsupport.html
libvirt-lxcapi
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 17 / 31
LXC@Libvirt Connect to the LXC-Hyperviser
virsh: Basic Usage
URI: virsh -c lxc://
URI: virsh -c lxc+ssh://host
define/create
undefine
start
destroy
shutdown
list
suspend/resume
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 18 / 31
LXC@Libvirt Lets start an Appliationcontainer
Defining Appliationcontainer
lxc.conf wird nicht mehr benutzt
xml
virsh: Interaktive Konfiguration
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 19 / 31
LXC@Libvirt Lets start an Appliationcontainer
Mind the bug
<domain type=’lxc’>
<name>bash</name>
<memory>1048576</memory>
<os>
<type>exe</type>
<init>/bin/bash</init>
</os>
<devices>
<emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
<interface type=’network’>
<source network=’default2’/>
</interface>
<console type=’pty’>
</console>
</devices>
</domain>
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 20 / 31
LXC@Libvirt Lets start an Appliationcontainer
Create an Applicationcontainer
virsh
virt-manager
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 21 / 31
LXC@Libvirt Lets start a classic container
Creating a classic container
Not provided by libvirt
libvirt storage pool
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 22 / 31
LXC@Libvirt Lets start a classic container
<domain type=’lxc’>
<name>container02</name>
<memory>1048576</memory>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<devices>
<emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
<filesystem type=’mount’ accessmode=’passthrough’>
<source dir=’/var/lib/lxc/container02/rootfs’/>
<target dir=’/’/>
</filesystem>
<interface type=’network’>
<source network=’default2’/>
</interface>
<console type=’pty’>
</console>
</devices>Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 23 / 31
LXC@Libvirt Lets start a classic container
Let’s start
Container erstellen
Einbinden (virt-manager?)
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 24 / 31
LXC@Libvirt Lets start a classic container
Repeating
Networking
virsh net-list
Network Filter
virsh nwfilter-list
<interface>
...
<filterref filter=’clean-traffic’/>
</interface>
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 25 / 31
LXC@Libvirt Lets start a classic container
cgroups: LXC@Libvirt unterst¨utzung :(
http://libvirt.org/hooks.html to the rescue?
lxc.cgroup.cpu.shares
virsh schedinfo --set cpu_shares=256 $container
lxc.cgroup.memory.limit_in_bytes
virsh setmem funzt nicht -> ballon
Libvirt nur eingeschr¨ankten Zugang zu allen Parametern.
Bei Libvirt alles als sub cgroups.
lxc-attach =
virsh -c lxc:// lxc-enter-namespace $container -- /bin/ps
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 26 / 31
LXC@Libvirt Lets start a classic container
Altes Schiesse den Host ab Spiel?
Hint: echo b > /proc/sysrq-trigger
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 27 / 31
LXC@Libvirt Lets start a classic container
Punkte
Kein Shutdown (Libvirt 1.0.1)
Unzureichende Resourcenkontrolle
Managen von Domains
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 28 / 31
OpenStack
OpenStack
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 29 / 31
OpenStack
OpenStack
https://wiki.openstack.org/wiki/HypervisorSupportMatrix
OpenStack uses Images only
CGroups/Ballondriver in OpenStack. Scheisse gel¨ost? I.e. Swapping
Security
Apparmor/SELinux f¨ur plain lxc
virsh [-c lxc://] capabilities nach secmodel schauen
SELinux f¨ur libvirt (sVirt)
libvirt-lxcapi
Not working for OpenStack → user namespaces to the rescue
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 30 / 31
Where to go?
Where to go?
Keine Ahnung
Tolle Links
https://www.berrange.com
http://s3hh.wordpress.com/
https://www.stgraber.org/category/lxc/
Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 31 / 31

Weitere ähnliche Inhalte

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Empfohlen (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

OSDC 2013 | lxc@libvirt by Erkan Yanar

  • 1. LXC@Libvirt Erkan Yanar linsenraum.de 18. April 2013 Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 1 / 31
  • 2. Who am I? Who am I?! Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 2 / 31
  • 3. What is this talk about What is this talk about LXC Libvirt LXC@Libvirt OpenStack Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 3 / 31
  • 4. What is this talk about What is this talk about LXC Libvirt LXC@Libvirt OpenStack NOT Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 3 / 31
  • 5. LXC LXC: Keine Einf¨uhrung Containervirtualisierung Kernel 2.6.24 Keine CPU mit Hardwarevirt. notwendig aptitude install lxc Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 4 / 31
  • 6. LXC Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 5 / 31
  • 7. LXC CGroups CGroups Virtuelles Filesystem Gruppierungen von Prozessen Zuweisung von Ressourcen Messen des Ressourcenverbrauchs memory cpuset cpu blkio . . . Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 6 / 31
  • 8. LXC CGroups CGroups Virtuelles Filesystem Gruppierungen von Prozessen Zuweisung von Ressourcen Messen des Ressourcenverbrauchs memory cpuset cpu blkio . . . Lets have a Look Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 6 / 31
  • 9. LXC Namespaces Namespaces Isoliert die Umgebung eines Prozesses(Gruppe). UTC PID Network User . . . Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 7 / 31
  • 10. LXC Namespaces LXC LXC=CGroups + Namespaces + Capabilities Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 8 / 31
  • 11. LXC Namespaces LXC LXC=CGroups + Namespaces + Capabilities Alles im VanillaKernel :) Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 8 / 31
  • 12. Usage lxc Kommandos: lxc-attach lxc-freeze lxc-setcap lxc-backup lxc-info lxc-setuid lxc-cgroup lxc-kill lxc-shutdown lxc-checkconfig lxc-list lxc-start lxc-checkpoint lxc-ls lxc-start-ephemeral lxc-clone lxc-monitor lxc-stop lxc-console lxc-netstat lxc-unfreeze lxc-create lxc-ps lxc-unshare lxc-destroy lxc-restart lxc-version lxc-execute lxc-restore lxc-wait Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 9 / 31
  • 13. Usage Containertypen Containertypen Applikationscontainer → Server Applikationscontainer → Auch f¨ur Desktop Klassische Container Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 10 / 31
  • 14. Usage ApplicationContainer: lxc.conf Kleine Applikationscontainer Einzelne Prozesse(Gruppe) isolieren CGroups Namespace easy! lxc-execute -n NAME -f configfile /path/program Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 11 / 31
  • 15. Usage ApplicationContainer: lxc.conf Applikationscontainer confile lxc.utsname=application man lxc.conf Schauen wir mal Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 12 / 31
  • 16. Usage Container: lxc.conf Create Container lxc-create -n name -t template -f configfile Main Difference lxc.rootfs ← chroot /sbin/init Play with it lxc-attach mc . . . Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 13 / 31
  • 17. Usage Funktionalit¨at Schlagworte Keine Livemigration (Flying Container) → http://criu.org Geringer Footprint Weniger M¨oglichkeiten Security? Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 14 / 31
  • 18. Libvirt Libvirt Abstraktion Stabile API virt-manager Remote-access virsh Domain Management virsh Domain Monitoring virsh Host and Hypervisor virsh Interface virsh Network Filter virsh Networking virsh Storage Pool virsh Storage Volume Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 15 / 31
  • 19. Libvirt CGroups CGroups@Libvirt Merkw¨urdige Unterst¨uzung Lets have a look into the filesystem Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 16 / 31
  • 20. LXC@Libvirt LXC@Libvirt LXC@Libvirt aptitude install libvirt-bin Propagiertes Projekt qemu/kvm am besten unterst¨utzt http://libvirt.org/hvsupport.html libvirt-lxcapi Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 17 / 31
  • 21. LXC@Libvirt Connect to the LXC-Hyperviser virsh: Basic Usage URI: virsh -c lxc:// URI: virsh -c lxc+ssh://host define/create undefine start destroy shutdown list suspend/resume Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 18 / 31
  • 22. LXC@Libvirt Lets start an Appliationcontainer Defining Appliationcontainer lxc.conf wird nicht mehr benutzt xml virsh: Interaktive Konfiguration Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 19 / 31
  • 23. LXC@Libvirt Lets start an Appliationcontainer Mind the bug <domain type=’lxc’> <name>bash</name> <memory>1048576</memory> <os> <type>exe</type> <init>/bin/bash</init> </os> <devices> <emulator>/usr/lib/libvirt/libvirt_lxc</emulator> <interface type=’network’> <source network=’default2’/> </interface> <console type=’pty’> </console> </devices> </domain> Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 20 / 31
  • 24. LXC@Libvirt Lets start an Appliationcontainer Create an Applicationcontainer virsh virt-manager Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 21 / 31
  • 25. LXC@Libvirt Lets start a classic container Creating a classic container Not provided by libvirt libvirt storage pool Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 22 / 31
  • 26. LXC@Libvirt Lets start a classic container <domain type=’lxc’> <name>container02</name> <memory>1048576</memory> <os> <type>exe</type> <init>/sbin/init</init> </os> <devices> <emulator>/usr/lib/libvirt/libvirt_lxc</emulator> <filesystem type=’mount’ accessmode=’passthrough’> <source dir=’/var/lib/lxc/container02/rootfs’/> <target dir=’/’/> </filesystem> <interface type=’network’> <source network=’default2’/> </interface> <console type=’pty’> </console> </devices>Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 23 / 31
  • 27. LXC@Libvirt Lets start a classic container Let’s start Container erstellen Einbinden (virt-manager?) Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 24 / 31
  • 28. LXC@Libvirt Lets start a classic container Repeating Networking virsh net-list Network Filter virsh nwfilter-list <interface> ... <filterref filter=’clean-traffic’/> </interface> Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 25 / 31
  • 29. LXC@Libvirt Lets start a classic container cgroups: LXC@Libvirt unterst¨utzung :( http://libvirt.org/hooks.html to the rescue? lxc.cgroup.cpu.shares virsh schedinfo --set cpu_shares=256 $container lxc.cgroup.memory.limit_in_bytes virsh setmem funzt nicht -> ballon Libvirt nur eingeschr¨ankten Zugang zu allen Parametern. Bei Libvirt alles als sub cgroups. lxc-attach = virsh -c lxc:// lxc-enter-namespace $container -- /bin/ps Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 26 / 31
  • 30. LXC@Libvirt Lets start a classic container Altes Schiesse den Host ab Spiel? Hint: echo b > /proc/sysrq-trigger Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 27 / 31
  • 31. LXC@Libvirt Lets start a classic container Punkte Kein Shutdown (Libvirt 1.0.1) Unzureichende Resourcenkontrolle Managen von Domains Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 28 / 31
  • 32. OpenStack OpenStack Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 29 / 31
  • 33. OpenStack OpenStack https://wiki.openstack.org/wiki/HypervisorSupportMatrix OpenStack uses Images only CGroups/Ballondriver in OpenStack. Scheisse gel¨ost? I.e. Swapping Security Apparmor/SELinux f¨ur plain lxc virsh [-c lxc://] capabilities nach secmodel schauen SELinux f¨ur libvirt (sVirt) libvirt-lxcapi Not working for OpenStack → user namespaces to the rescue Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 30 / 31
  • 34. Where to go? Where to go? Keine Ahnung Tolle Links https://www.berrange.com http://s3hh.wordpress.com/ https://www.stgraber.org/category/lxc/ Erkan Yanar (linsenraum.de) LXC@Libvirt 18. April 2013 31 / 31