<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://air.imag.fr/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mercierm</id>
	<title>air - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://air.imag.fr/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mercierm"/>
	<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php/Special:Contributions/Mercierm"/>
	<updated>2026-05-31T13:16:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://air.imag.fr/index.php?title=LXC&amp;diff=10365</id>
		<title>LXC</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=LXC&amp;diff=10365"/>
		<updated>2013-03-26T16:18:19Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Définition==&lt;br /&gt;
LXC pour LinuX Containers est une technologie de virtualisation de système ou de processus Linux basé sur l&#039;isolation. LXC permet de lancée n&#039;importe quelle distribution Linux récente à l&#039;intérieur d&#039;un conteneur. Ce conteneur peut être configuré pour limité l&#039;accès au ressources physique de la machine hôte (CPU, Memoire, I/O,...) grace à l&#039;utilisation des [[cgroups]].&lt;br /&gt;
&lt;br /&gt;
==Etat actuel==&lt;br /&gt;
LXC est actuellement (03/2013) en version 0.9 et son API n&#039;est pas encore stabilisée. Cette technologie est intégrée au noyau Linux et à pour but de remplacer [[OpenVZ]] qui n&#039;est pas adapter au version récente du noyau Linux. Son développement est actuellement très actif. &lt;br /&gt;
&lt;br /&gt;
==LXC et le Cloud Computing==&lt;br /&gt;
LXC est pour le moment utilisé pour isolé des services sur un serveur ou dans le Cloud Computing au niveau [[PaaS]] comme [[Heroku]][https://devcenter.heroku.com/articles/dynos#technologies] . Certaines fonctionnalités indispensable à la sécurité empêche LXC d&#039;être utilisé dans le comme mécanisme de virtualisation pour les systèmes de [[IaaS]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Liens externes==&lt;br /&gt;
[http://lxc.sourceforge.net Site officiel]&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Heroku&amp;diff=10256</id>
		<title>Heroku</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Heroku&amp;diff=10256"/>
		<updated>2013-03-22T15:39:57Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Platforme PaaS d&#039;exécutions d&#039;applications Ruby, [[Node.js]], Clojure, Java, [[Python]], et Scala.&lt;br /&gt;
&lt;br /&gt;
S&#039;appuie du [[Git]] (push) et sur les containers Linux ([[LXC]]).&lt;br /&gt;
&lt;br /&gt;
[http://www.heroku.com/ http://www.heroku.com/]&lt;br /&gt;
&lt;br /&gt;
==Exemple de déploiement==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd nodejsserver&lt;br /&gt;
heroku create&lt;br /&gt;
git push heroku master&lt;br /&gt;
heroku open&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=10033</id>
		<title>Soutenances Projet RICM 5 2012-2013</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=10033"/>
		<updated>2013-03-21T12:53:34Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Planning==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
 |+ Planning Jeudi 21/03 P257 ([[Polytech Grenoble]])&lt;br /&gt;
 |-&lt;br /&gt;
 |&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Horaire&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Projet&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Encadrant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Etudiant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Documents&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
 | 13H00-13H45&lt;br /&gt;
 | [[RobAIR2013]]&lt;br /&gt;
 | [[User:Donsez|Didier Donsez]]&lt;br /&gt;
 | NICOLACCINI MICKAEL , ALEXANDRE ARTHUR, Salem HARRACHE , PAZ HERNANDEZ ELIZABETH&lt;br /&gt;
 | [http://air.imag.fr/mediawiki/index.php/RobAIR2013-RICM5-Suivi Fiche suivi RobAIR] - [[Media:Projet_RobAIR2013_diapo.pdf |Transparents]] - [[Media:Flyer-RobAIR.pdf|Flyer]] - [[Media:Poster-RobAIR.pdf|Poster]] [http://youtu.be/-3mbR5M8lzw Video] - [http://robair.quicker.fr/ Site web]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
 | 13H45-14H30&lt;br /&gt;
 | Armind&lt;br /&gt;
 | Renaud Blanch, Nicolas Glade, Nicolas Vuillerme, Didier Pradon (APHP Garches)&lt;br /&gt;
 | CHEVALLIER MARIE (PL), FALL YACINE, LU XIAO&lt;br /&gt;
 | [http://air.imag.fr/mediawiki/index.php/Armind Fiche de suivi Armind] &amp;amp; [[Media:presentationArmind.ppt|transparents]] &amp;amp; [[Media:flyersArmind.pdf|flyers]] &amp;amp; [[Media:posterArmind.pdf|poster]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
 | 14H30-14H45&lt;br /&gt;
 | Pause&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
 | 14H45-15H15&lt;br /&gt;
 | [[Fusion multi-capteurs pour table tactile]]&lt;br /&gt;
 | Renaud Blanch, Renaud Collin&lt;br /&gt;
 | RAOUX MAXENCE (PL), DAUVERGNE LEOPOLD&lt;br /&gt;
 | [http://air.imag.fr/mediawiki/index.php/Fusion_multi-capteurs_pour_table_tactile fiche suivi] &amp;amp; [http://air.imag.fr/mediawiki/images/b/be/Sonar_TablePresentation.pdf Transparents] &amp;amp; [http://air.imag.fr/mediawiki/images/0/07/FliyerSonarTable.pdf Flyer] &amp;amp; [http://air.imag.fr/mediawiki/images/thumb/2/2f/PosterSonarTable.jpg/600px-PosterSonarTable.jpg Poster] &amp;amp; [http://www.youtube.com/watch?v=8VKd9UdPNmc Video]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
 | 15H15-16H00&lt;br /&gt;
 | [[Projet Réseaux de Capteurs]]&lt;br /&gt;
 | Bernard Tourancheau&lt;br /&gt;
 | CARAMELLI NOE-JEAN (PL), LEVEQUE FLORIAN, HO MINH QUAN&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [[Media:Presentation_coconode.pdf | transparents]] &amp;amp; [[Media:Coconode_flyer.pdf | Flyer]] &amp;amp; [[Media:Coconode_poster.pdf | Poster]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
 | 16H00-16H30&lt;br /&gt;
 | [[OAR Cloud Computing 2013]]&lt;br /&gt;
 | Olivier Richard&lt;br /&gt;
 | MERCIER MICHAEL (PL)&lt;br /&gt;
 | [[Proj-2012-2013-OAR-Cloud | fiche suivi]] &amp;amp; [[Media:Oar-cloud-pres.pdf‎ | transparents]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
 |+ Planning Vendredi 22/03 P249 ([[Polytech Grenoble]])&lt;br /&gt;
 |-&lt;br /&gt;
 |&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Horaire&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Projet&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Encadrant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Etudiant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Documents&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
 | 14H30-15H15&lt;br /&gt;
 | [[Projet 2013 : Interactive Digital Signage]]&lt;br /&gt;
 | [[User:Donsez|Didier Donsez]]&lt;br /&gt;
 | FOURURE FLORIAN, BISCH SIMON (PL), CLAVELIN AURELIEN&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [http://air.imag.fr/mediawiki/index.php/File:-BISCH-FOURURE-CLAVELIN--RICM5-IDS-Presentation.pdf transparents] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
 | 15H15-16H00&lt;br /&gt;
 | [http://www.cervin.org/wiki/index.php?title=Prototype_SmartPhone  Projet CERVIN de &amp;quot;Rehab Lab&amp;quot;]&lt;br /&gt;
 | Renaud Blanch, Francois Letellier de l&#039;association [http://www.aconit.org/ ACONIT], le [http://www.ccsti-grenoble.org/ CCSTI Grenoble]&lt;br /&gt;
 | OSWALD CAMILLE, WIRTH CLÉMENT, PRAK SORIYA, GNATTO-BAHIE CHRISTOPHER&lt;br /&gt;
 | [http://www.cervin.org/wiki/index.php?title=Prototype_SmartPhone  Wiki projet Cervin] &amp;amp; [[Media:cervinPres.ppt]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
 | 16H00-16H45&lt;br /&gt;
 | [[Développement d&#039;une appli mobile pour urgentistes en Afrique utilisant la synthèse vocale]]&lt;br /&gt;
 | Laurent Besacier, F. Camara et la [http://voxygen.fr/ société Voxygen]&lt;br /&gt;
 | ELOY FABIEN, NGOUALA ROLLY, VIGIER SYLVAIN, GU QIKAI, SEGALA JOACHIM&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Recommandations==&lt;br /&gt;
* Prévenez vos tuteurs de votre horaire de passage pour qu&#039;ils assistent à votre soutenance (ainsi que des éventuels changements).&lt;br /&gt;
* La durée des soutenances est STRICTEMENT 45 minutes (et 30 minutes pour Michael Mercier)&lt;br /&gt;
* Chaque soutenance comporte 20 minutes de présentation, 15 minutes de démonstration suivi de 10 minutes de questions/réponse&lt;br /&gt;
* La présentation doit aborder l&#039;ensemble des aspects du projet (contexte, technique, gestion, ...)&lt;br /&gt;
* Les transparents doivent être ajoutés à cette page avant le Jeudi matin&lt;br /&gt;
* Des &#039;&#039;flyers&#039;&#039; (3 volets d&#039;un A4) et un poster (A4 ou 2*A4 ou A3) devront être apportés puis laissés dans la salle AIR.&lt;br /&gt;
&lt;br /&gt;
==Conseils==&lt;br /&gt;
* Le chef de projet orchestre&lt;br /&gt;
* Répétez plusieurs fois et chronométrez vous !&lt;br /&gt;
* Répartissez vous la parole pendant la présentation et la démo&lt;br /&gt;
* Attention à l&#039; &#039;&#039;effet démo&#039;&#039; : prévoyez une vidéo de secours&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=File:Oar-cloud-pres.pdf&amp;diff=10032</id>
		<title>File:Oar-cloud-pres.pdf</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=File:Oar-cloud-pres.pdf&amp;diff=10032"/>
		<updated>2013-03-21T12:52:03Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: Présentation du projet OAR cloud de Michael Mercier&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Présentation du projet OAR cloud de Michael Mercier&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9773</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9773"/>
		<updated>2013-03-19T11:50:14Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Journal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the [[#M1 | M1]] milestone and based on the knowledge gained this step. It is a much more minimal approach. However, it only complete the F.u.0 to F.u.3 and F.a.0 to F.a.4 features.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
* The user create an instance&lt;br /&gt;
[[File:DiagSequence new instance.png|alt=OAR virtual CLI - New instance sequence diagram |New instance sequence diagram]]&lt;br /&gt;
* He gets the available images from his instance&lt;br /&gt;
[[File:DiagSequence show image.png|alt=OAR virtual CLI - Show images list sequence diagram |Show images list sequence diagram]]&lt;br /&gt;
* He launch the the chosen image&lt;br /&gt;
[[File:DiagSequence run image.png|alt=OAR virtual CLI - Run image sequence diagram |Run image sequence diagram]]&lt;br /&gt;
* Then he connect himself to the image using ssh&lt;br /&gt;
  ssh root@IP&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
===Problems encountered during M2===&lt;br /&gt;
We found this [http://s3hh.wordpress.com/2012/05/28/connecting-containers-on-several-hosts-with-open-vswitch/ page] explaining how to use OpenVswitch (OVS) to connect two EC2 instance with a GRE tunnel. The script attached to this page was used to set up an OVS bridge to replace the default linux bridge. Two problems appeared:&lt;br /&gt;
# the containers with OVS bridge makes more then 2 minutes to be launched while it takes less then 10 seconds with Linux bridges&lt;br /&gt;
# when you are using an OVS bridge between two containers. It&#039;s is possible to reach one by an other but sometimes one of the container loose his IP address and breaks the connection. &lt;br /&gt;
&lt;br /&gt;
===M2 Conclusion===&lt;br /&gt;
The use of OVS as the main bridge for an LXC container is unstable. It seems that LXC and OpenVswitch are not really compatible for now.&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==19/03==&lt;br /&gt;
*add content to [[#M2 | M2]] part&lt;br /&gt;
&lt;br /&gt;
==15/03==&lt;br /&gt;
* begin presentation (for Michael who&#039;s leaving the project the 21/03) &lt;br /&gt;
&lt;br /&gt;
==12/03==&lt;br /&gt;
*add [[#Version 0.3 | 0.3 version ]] in conception part&lt;br /&gt;
&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9772</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9772"/>
		<updated>2013-03-19T11:19:56Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* M2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the [[#M1 | M1]] milestone and based on the knowledge gained this step. It is a much more minimal approach. However, it only complete the F.u.0 to F.u.3 and F.a.0 to F.a.4 features.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
* The user create an instance&lt;br /&gt;
[[File:DiagSequence new instance.png|alt=OAR virtual CLI - New instance sequence diagram |New instance sequence diagram]]&lt;br /&gt;
* He gets the available images from his instance&lt;br /&gt;
[[File:DiagSequence show image.png|alt=OAR virtual CLI - Show images list sequence diagram |Show images list sequence diagram]]&lt;br /&gt;
* He launch the the chosen image&lt;br /&gt;
[[File:DiagSequence run image.png|alt=OAR virtual CLI - Run image sequence diagram |Run image sequence diagram]]&lt;br /&gt;
* Then he connect himself to the image using ssh&lt;br /&gt;
  ssh root@IP&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
===Problems encountered during M2===&lt;br /&gt;
We found this [http://s3hh.wordpress.com/2012/05/28/connecting-containers-on-several-hosts-with-open-vswitch/ page] explaining how to use OpenVswitch (OVS) to connect two EC2 instance with a GRE tunnel. The script attached to this page was used to set up an OVS bridge to replace the default linux bridge. Two problems appeared:&lt;br /&gt;
# the containers with OVS bridge makes more then 2 minutes to be launched while it takes less then 10 seconds with Linux bridges&lt;br /&gt;
# when you are using an OVS bridge between two containers. It&#039;s is possible to reach one by an other but sometimes one of the container loose his IP address and breaks the connection. &lt;br /&gt;
&lt;br /&gt;
===M2 Conclusion===&lt;br /&gt;
The use of OVS as the main bridge for an LXC container is unstable. It seems that LXC and OpenVswitch are not really compatible for now.&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==12/03==&lt;br /&gt;
*add [[#Version 0.3 | 0.3 version ]] in conception part&lt;br /&gt;
&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9708</id>
		<title>Soutenances Projet RICM 5 2012-2013</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9708"/>
		<updated>2013-03-15T12:02:37Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Planning==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
 |+ Planning Jeudi 21/03 P257 ([[Polytech Grenoble]])&lt;br /&gt;
 |-&lt;br /&gt;
 |&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Horaire&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Projet&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Encadrant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Etudiant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Documents&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
 | 13H00-13H45&lt;br /&gt;
 | Armind&lt;br /&gt;
 | Renaud Blanch, Nicolas Glade, Nicolas Vuillerme, Didier Pradon (APHP Garches)&lt;br /&gt;
 | CHEVALLIER MARIE (PL), FALL YACINE, LU XIAO&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
 | 13H45-14H30&lt;br /&gt;
 | [[RobAIR2013]]&lt;br /&gt;
 | [[User:Donsez|Didier Donsez]]&lt;br /&gt;
 | NICOLACCINI MICKAEL , ALEXANDRE ARTHUR, HARRACHE SALEM, PAZ HERNANDEZ ELIZABETH&lt;br /&gt;
 | [[RobAIR2013-RICM5-Suivi| fiche suivi]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster &lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
 | 14H30-14H45&lt;br /&gt;
 | Pause&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
 | 14H45-15H15&lt;br /&gt;
 | [[Fusion multi-capteurs pour table tactile]]&lt;br /&gt;
 | Renaud Blanch, Renaud Collin&lt;br /&gt;
 | RAOUX MAXENCE (PL), DAUVERGNE LEOPOLD&lt;br /&gt;
 | [http://air.imag.fr/mediawiki/index.php/Fusion_multi-capteurs_pour_table_tactile fiche suivi] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
 | 15H15-16H00&lt;br /&gt;
 | [[Développement d&#039;une appli mobile pour urgentistes en Afrique utilisant la synthèse vocale]]&lt;br /&gt;
 | Laurent Besacier, F. Camara et la [http://voxygen.fr/ société Voxygen]&lt;br /&gt;
 | ELOY FABIEN, NGOUALA ROLLY, VIGIER SYLVAIN, GU QIKAI, SEGALA JOACHIM&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
 | 16H00-16H30&lt;br /&gt;
 | [[OAR Cloud Computing 2013]]&lt;br /&gt;
 | Olivier Richard&lt;br /&gt;
 | MERCIER MICHAEL (PL)&lt;br /&gt;
 | [[Proj-2012-2013-OAR-Cloud | fiche suivi]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
 |+ Planning Vendredi 22/03 P249 ([[Polytech Grenoble]])&lt;br /&gt;
 |-&lt;br /&gt;
 |&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Horaire&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Projet&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Encadrant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Etudiant(s)&lt;br /&gt;
 !scope=&amp;quot;col&amp;quot;| Documents&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
 | 14H30-15H15&lt;br /&gt;
 | [[Projet 2013 : Interactive Digital Signage]]&lt;br /&gt;
 | [[User:Donsez|Didier Donsez]]&lt;br /&gt;
 | FOURURE FLORIAN, BISCH SIMON (PL), CLAVELIN AURELIEN&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
 | 15H15-16H00&lt;br /&gt;
 | [[Projet CERVIN de &amp;quot;Rehab Lab&amp;quot;]]&lt;br /&gt;
 | Renaud Blanch, Francois Letellier de l&#039;association [http://www.aconit.org/ ACONIT], le [http://www.ccsti-grenoble.org/ CCSTI Grenoble]&lt;br /&gt;
 | OSWALD CAMILLE, WIRTH CLÉMENT, PRAK SORIYA, GNATTO-BAHIE CHRISTOPHER&lt;br /&gt;
 | [[http://www.cervin.org/wiki/index.php?title=Prototype_SmartPhone  Wiki projet Cervin]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |-&lt;br /&gt;
 !scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
 | 16H00-16H45&lt;br /&gt;
 | [[Projet Réseaux de Capteurs]]&lt;br /&gt;
 | Bernard Tourancheau&lt;br /&gt;
 | CARAMELLI NOE-JEAN (PL), LEVEQUE FLORIAN, HO MINH QUAN&lt;br /&gt;
 | [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==Recommandations==&lt;br /&gt;
* Prévenez vos tuteurs de votre horaire de passage pour qu&#039;ils assistent à votre soutenance (ainsi que des éventuels changements).&lt;br /&gt;
* La durée des soutenances est STRICTEMENT 45 minutes (et 30 minutes pour Michael Mercier)&lt;br /&gt;
* Chaque soutenance comporte 20 minutes de présentation, 15 minutes de démonstration suivi de 10 minutes de questions/réponse&lt;br /&gt;
* La présentation doit aborder l&#039;ensemble des aspects du projet (contexte, technique, gestion, ...)&lt;br /&gt;
* Les transparents doivent être ajoutés à cette page avant le Jeudi matin&lt;br /&gt;
* Des &#039;&#039;flyers&#039;&#039; (3 volets d&#039;un A4) et un poster (A4 ou 2*A4 ou A3) devront être apportés puis laissés dans la salle AIR.&lt;br /&gt;
&lt;br /&gt;
==Conseils==&lt;br /&gt;
* Le chef de projet orchestre&lt;br /&gt;
* Répétez plusieurs fois et chronométrez vous !&lt;br /&gt;
* Répartissez vous la parole pendant la présentation et la démo&lt;br /&gt;
* Attention à l&#039; &#039;&#039;effet démo&#039;&#039; : prévoyez une vidéo de secours&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9700</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9700"/>
		<updated>2013-03-14T11:02:20Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the [[#M1 | M1]] milestone and based on the knowledge gained this step. It is a much more minimal approach. However, it only complete the F.u.0 to F.u.3 and F.a.0 to F.a.4 features.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
* The user create an instance&lt;br /&gt;
[[File:DiagSequence new instance.png|alt=OAR virtual CLI - New instance sequence diagram |New instance sequence diagram]]&lt;br /&gt;
* He gets the available images from his instance&lt;br /&gt;
[[File:DiagSequence show image.png|alt=OAR virtual CLI - Show images list sequence diagram |Show images list sequence diagram]]&lt;br /&gt;
* He launch the the chosen image&lt;br /&gt;
[[File:DiagSequence run image.png|alt=OAR virtual CLI - Run image sequence diagram |Run image sequence diagram]]&lt;br /&gt;
* Then he connect himself to the image using ssh&lt;br /&gt;
  ssh root@IP&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==12/03==&lt;br /&gt;
*add [[#Version 0.3 | 0.3 version ]] in conception part&lt;br /&gt;
&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9642</id>
		<title>Soutenances Projet RICM 5 2012-2013</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9642"/>
		<updated>2013-03-13T13:24:22Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Planning==&lt;br /&gt;
&#039;&#039;&#039;Jeudi 21/03 Salle A Confirmer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;13H00-13H45 Armind (Renaud Blanch, Nicolas Glade, Nicolas Vuillerme) --&amp;gt; CHEVALLIER MARIE (PL), FALL YACINE, LU XIAO [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;13H45-14H30 RobAIR2013 (Didier Donsez) --&amp;gt; NICOLACCINI MICKAEL , ALEXANDRE ARTHUR, HARRACHE SALEM, PAZ HERNANDEZ ELIZABETH [[RobAIR2013-RICM5-Suivi| fiche suivi]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;14H30-14H45 Pause&lt;br /&gt;
&amp;lt;br&amp;gt;14H45-15H15 Fusion multi-capteurs pour table tactile (Renaud Blanch, Renaud Collin) --&amp;gt; RAOUX MAXENCE (PL), DAUVERGNE LEOPOLD [http://air.imag.fr/mediawiki/index.php/Fusion_multi-capteurs_pour_table_tactile Fusion multi-capteurs pour table tactile] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;15H15-16H00    Développement d&#039;une appli mobile pour urgentistes en Afrique utilisant la synthèse vocale (Laurent Besacier, F. Camara et la société Voxygen) --&amp;gt; ELOY FABIEN, NGOUALA ROLLY, VIGIER SYLVAIN, GU QIKAI, SEGALA JOACHIM [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;16H00-16H30    Projet Cloud Computing Middleware (Olivier Richard) --&amp;gt; MERCIER MICHAEL (PL) [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vendredi 22/03 Salle A Confirmer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;14H30-15H15   Projet CERVIN de &amp;quot;Rehab Lab&amp;quot; (Renaud Blanch, Francois Letellier d&#039;ACONIT, le CCSTI) en commun avec 3I5 --&amp;gt; OSWALD CAMILLE, WIRTH CLÉMENT, PRAK SORIYA, GNATTO-BAHIE CHRISTOPHER [[http://www.cervin.org/wiki/index.php?title=Prototype_SmartPhone  Wiki projet Cervin]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;15H15-16H00    Projet 2013 : Interactive Digital Signage (Didier Donsez) --&amp;gt; FOURURE FLORIAN, BISCH SIMON (PL), CLAVELIN AURELIEN [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;16H00-16H45 Projet Réseaux de Capteurs (Bernard Tourancheau) --&amp;gt; CARAMELLI NOE-JEAN (PL), LEVEQUE FLORIAN, HO MINH QUAN [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&lt;br /&gt;
==Recommandations==&lt;br /&gt;
* Prévenez vos tuteurs de votre horaire de passage pour qu&#039;ils assistent à votre soutenance (ainsi que des éventuels changements).&lt;br /&gt;
* La durée des soutenances est STRICTEMENT 45 minutes (et 30 minutes pour Michael Mercier)&lt;br /&gt;
* Chaque soutenance comporte 20 minutes de présentation, 15 minutes de démonstration suivi de 10 minutes de questions/réponse&lt;br /&gt;
* La présentation doit aborder l&#039;ensemble des aspects du projet (contexte, technique, gestion, ...)&lt;br /&gt;
* Les transparents doivent être ajoutés à cette page avant le Jeudi matin&lt;br /&gt;
* Des &#039;&#039;flyers&#039;&#039; (3 volets d&#039;un A4) et un poster (A4 ou 2*A4 ou A3) devront être apportés puis laissés dans la salle AIR.&lt;br /&gt;
&lt;br /&gt;
==Conseils==&lt;br /&gt;
* Le chef de projet orchestre&lt;br /&gt;
* Répétez plusieurs fois et chronométrez vous !&lt;br /&gt;
* Répartissez vous la parole pendant la présentation et la démo&lt;br /&gt;
* Attention à l&#039; &#039;&#039;effet démo&#039;&#039; : prévoyez une vidéo de secours&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9641</id>
		<title>Soutenances Projet RICM 5 2012-2013</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9641"/>
		<updated>2013-03-13T13:23:18Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Planning==&lt;br /&gt;
&#039;&#039;&#039;Jeudi 21/03 Salle A Confirmer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;13H00-13H45 Armind (Renaud Blanch, Nicolas Glade, Nicolas Vuillerme) --&amp;gt; CHEVALLIER MARIE (PL), FALL YACINE, LU XIAO [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;13H45-14H30 RobAIR2013 (Didier Donsez) --&amp;gt; NICOLACCINI MICKAEL , ALEXANDRE ARTHUR, HARRACHE SALEM, PAZ HERNANDEZ ELIZABETH [[RobAIR2013-RICM5-Suivi| fiche suivi]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;14H30-14H45 Pause&lt;br /&gt;
&amp;lt;br&amp;gt;14H45-15H15 Fusion multi-capteurs pour table tactile (Renaud Blanch, Renaud Collin) --&amp;gt; RAOUX MAXENCE (PL), DAUVERGNE LEOPOLD [http://air.imag.fr/mediawiki/index.php/Fusion_multi-capteurs_pour_table_tactile Fusion multi-capteurs pour table tactile] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;15H15-16H00    Développement d&#039;une appli mobile pour urgentistes en Afrique utilisant la synthèse vocale (Laurent Besacier, F. Camara et la société Voxygen) --&amp;gt; ELOY FABIEN, NGOUALA ROLLY, VIGIER SYLVAIN, GU QIKAI, SEGALA JOACHIM [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;16H00-16H30    Projet Cloud Computing Middleware (Olivier Richard) --&amp;gt; MERCIER MICHAEL (PL) [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vendredi 22/03 Salle A Confirmer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;14H30-15H15   Projet CERVIN de &amp;quot;Rehab Lab&amp;quot; (Renaud Blanch, Francois Letellier d&#039;ACONIT, le CCSTI) en commun avec 3I5 --&amp;gt; OSWALD CAMILLE, WIRTH CLÉMENT, PRAK SORIYA, GNATTO-BAHIE CHRISTOPHER [[http://air.imag.fr/mediawiki/index.php/Projet_CERVIN_de_%22Rehab_Lab%22  Wiki projet Cervin]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;15H15-16H00    Projet 2013 : Interactive Digital Signage (Didier Donsez) --&amp;gt; FOURURE FLORIAN, BISCH SIMON (PL), CLAVELIN AURELIEN [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;16H00-16H45 Projet Réseaux de Capteurs (Bernard Tourancheau) --&amp;gt; CARAMELLI NOE-JEAN (PL), LEVEQUE FLORIAN, HO MINH QUAN [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&lt;br /&gt;
==Recommandations==&lt;br /&gt;
* Prévenez vos tuteurs de votre horaire de passage pour qu&#039;ils assistent à votre soutenance (ainsi que des éventuels changements).&lt;br /&gt;
* La durée des soutenances est STRICTEMENT 45 minutes (et 30 minutes pour Michael Mercier)&lt;br /&gt;
* Chaque soutenance comporte 20 minutes de présentation, 15 minutes de démonstration suivi de 10 minutes de questions/réponse&lt;br /&gt;
* La présentation doit aborder l&#039;ensemble des aspects du projet (contexte, technique, gestion, ...)&lt;br /&gt;
* Les transparents doivent être ajoutés à cette page avant le Jeudi matin&lt;br /&gt;
* Des &#039;&#039;flyers&#039;&#039; (3 volets d&#039;un A4) et un poster (A4 ou 2*A4 ou A3) devront être apportés puis laissés dans la salle AIR.&lt;br /&gt;
&lt;br /&gt;
==Conseils==&lt;br /&gt;
* Le chef de projet orchestre&lt;br /&gt;
* Répétez plusieurs fois et chronométrez vous !&lt;br /&gt;
* Répartissez vous la parole pendant la présentation et la démo&lt;br /&gt;
* Attention à l&#039; &#039;&#039;effet démo&#039;&#039; : prévoyez une vidéo de secours&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9640</id>
		<title>Soutenances Projet RICM 5 2012-2013</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Soutenances_Projet_RICM_5_2012-2013&amp;diff=9640"/>
		<updated>2013-03-13T13:22:04Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Planning */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Planning==&lt;br /&gt;
&#039;&#039;&#039;Jeudi 21/03 Salle A Confirmer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;13H00-13H45 Armind (Renaud Blanch, Nicolas Glade, Nicolas Vuillerme) --&amp;gt; CHEVALLIER MARIE (PL), FALL YACINE, LU XIAO [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;13H45-14H30 RobAIR2013 (Didier Donsez) --&amp;gt; NICOLACCINI MICKAEL , ALEXANDRE ARTHUR, HARRACHE SALEM, PAZ HERNANDEZ ELIZABETH [[RobAIR2013-RICM5-Suivi| fiche suivi]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;14H30-14H45 Pause&lt;br /&gt;
&amp;lt;br&amp;gt;14H45-15H15 Fusion multi-capteurs pour table tactile (Renaud Blanch, Renaud Collin) --&amp;gt; RAOUX MAXENCE (PL), DAUVERGNE LEOPOLD [http://air.imag.fr/mediawiki/index.php/Fusion_multi-capteurs_pour_table_tactile Fusion multi-capteurs pour table tactile] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;15H15-16H00    Développement d&#039;une appli mobile pour urgentistes en Afrique utilisant la synthèse vocale (Laurent Besacier, F. Camara et la société Voxygen) --&amp;gt; ELOY FABIEN, NGOUALA ROLLY, VIGIER SYLVAIN, GU QIKAI, SEGALA JOACHIM [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;16H00-16H30    Projet Cloud Computing Middleware (Olivier Richard) --&amp;gt; MERCIER MICHAEL (PL) [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vendredi 22/03 Salle A Confirmer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;14H30-15H15   Projet CERVIN de &amp;quot;Rehab Lab&amp;quot; (Renaud Blanch, Francois Letellier d&#039;ACONIT, le CCSTI) en commun avec 3I5 --&amp;gt; OSWALD CAMILLE, WIRTH CLÉMENT, PRAK SORIYA, GNATTO-BAHIE CHRISTOPHER [[http://air.imag.fr/mediawiki/index.php/Projet_CERVIN_de_%22Rehab_Lab%22]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;15H15-16H00    Projet 2013 : Interactive Digital Signage (Didier Donsez) --&amp;gt; FOURURE FLORIAN, BISCH SIMON (PL), CLAVELIN AURELIEN [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&amp;lt;br&amp;gt;16H00-16H45 Projet Réseaux de Capteurs (Bernard Tourancheau) --&amp;gt; CARAMELLI NOE-JEAN (PL), LEVEQUE FLORIAN, HO MINH QUAN [[fiche suivi ...]] &amp;amp; [[transparents ...]] &amp;amp; [[flyer ...]] &amp;amp; [[poster ...]] &amp;amp; [[video ...]]&lt;br /&gt;
&lt;br /&gt;
==Recommandations==&lt;br /&gt;
* Prévenez vos tuteurs de votre horaire de passage pour qu&#039;ils assistent à votre soutenance (ainsi que des éventuels changements).&lt;br /&gt;
* La durée des soutenances est STRICTEMENT 45 minutes (et 30 minutes pour Michael Mercier)&lt;br /&gt;
* Chaque soutenance comporte 20 minutes de présentation, 15 minutes de démonstration suivi de 10 minutes de questions/réponse&lt;br /&gt;
* La présentation doit aborder l&#039;ensemble des aspects du projet (contexte, technique, gestion, ...)&lt;br /&gt;
* Les transparents doivent être ajoutés à cette page avant le Jeudi matin&lt;br /&gt;
* Des &#039;&#039;flyers&#039;&#039; (3 volets d&#039;un A4) et un poster (A4 ou 2*A4 ou A3) devront être apportés puis laissés dans la salle AIR.&lt;br /&gt;
&lt;br /&gt;
==Conseils==&lt;br /&gt;
* Le chef de projet orchestre&lt;br /&gt;
* Répétez plusieurs fois et chronométrez vous !&lt;br /&gt;
* Répartissez vous la parole pendant la présentation et la démo&lt;br /&gt;
* Attention à l&#039; &#039;&#039;effet démo&#039;&#039; : prévoyez une vidéo de secours&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9604</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9604"/>
		<updated>2013-03-12T17:32:06Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* 12/03 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the [[#M1 | M1]] milestone and based on the knowledge gained this step. It is a much more minimal approach. However, it only complete the F.u.0 to F.u.3 and F.a.0 to F.a.4 features.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
* The user create an instance&lt;br /&gt;
[[File:DiagSequence new instance.png|alt=OAR virtual CLI - New instance sequence diagram |New instance sequence diagram]]&lt;br /&gt;
* He gets the available images from his instance&lt;br /&gt;
[[File:DiagSequence show image.png|alt=OAR virtual CLI - Show images list sequence diagram |Show images list sequence diagram]]&lt;br /&gt;
* He launch the the chosen image&lt;br /&gt;
[[File:DiagSequence run image.png|alt=OAR virtual CLI - Run image sequence diagram |Run image sequence diagram]]&lt;br /&gt;
* Then he connect himself to the image using ssh&lt;br /&gt;
  ssh root@IP&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==12/03==&lt;br /&gt;
*add [[#Version 0.3 | 0.3 version ]] in conception part&lt;br /&gt;
&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9603</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9603"/>
		<updated>2013-03-12T17:31:42Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Journal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the [[#M1 | M1]] milestone and based on the knowledge gained this step. It is a much more minimal approach. However, it only complete the F.u.0 to F.u.3 and F.a.0 to F.a.4 features.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
* The user create an instance&lt;br /&gt;
[[File:DiagSequence new instance.png|alt=OAR virtual CLI - New instance sequence diagram |New instance sequence diagram]]&lt;br /&gt;
* He gets the available images from his instance&lt;br /&gt;
[[File:DiagSequence show image.png|alt=OAR virtual CLI - Show images list sequence diagram |Show images list sequence diagram]]&lt;br /&gt;
* He launch the the chosen image&lt;br /&gt;
[[File:DiagSequence run image.png|alt=OAR virtual CLI - Run image sequence diagram |Run image sequence diagram]]&lt;br /&gt;
* Then he connect himself to the image using ssh&lt;br /&gt;
  ssh root@IP&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==12/03==&lt;br /&gt;
*add [[#version 0.3 | 0.3 version ]] in conception part&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9602</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9602"/>
		<updated>2013-03-12T17:17:01Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Version 0.3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the [[#M1 | M1]] milestone and based on the knowledge gained this step. It is a much more minimal approach. However, it only complete the F.u.0 to F.u.3 and F.a.0 to F.a.4 features.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
* The user create an instance&lt;br /&gt;
[[File:DiagSequence new instance.png|alt=OAR virtual CLI - New instance sequence diagram |New instance sequence diagram]]&lt;br /&gt;
* He gets the available images from his instance&lt;br /&gt;
[[File:DiagSequence show image.png|alt=OAR virtual CLI - Show images list sequence diagram |Show images list sequence diagram]]&lt;br /&gt;
* He launch the the chosen image&lt;br /&gt;
[[File:DiagSequence run image.png|alt=OAR virtual CLI - Run image sequence diagram |Run image sequence diagram]]&lt;br /&gt;
* Then he connect himself to the image using ssh&lt;br /&gt;
  ssh root@IP&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=File:DiagSequence_show_image.png&amp;diff=9601</id>
		<title>File:DiagSequence show image.png</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=File:DiagSequence_show_image.png&amp;diff=9601"/>
		<updated>2013-03-12T17:08:34Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: oar virtual CLI - show images list sequence diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;oar virtual CLI - show images list sequence diagram&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=File:DiagSequence_run_image.png&amp;diff=9600</id>
		<title>File:DiagSequence run image.png</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=File:DiagSequence_run_image.png&amp;diff=9600"/>
		<updated>2013-03-12T17:08:02Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: oar virtual CLI - run an image sequence diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;oar virtual CLI - run an image sequence diagram&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=File:DiagSequence_new_instance.png&amp;diff=9599</id>
		<title>File:DiagSequence new instance.png</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=File:DiagSequence_new_instance.png&amp;diff=9599"/>
		<updated>2013-03-12T17:07:33Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: oar virtual CLI - new instance sequence diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;oar virtual CLI - new instance sequence diagram&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9586</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9586"/>
		<updated>2013-03-12T10:04:42Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Logical View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical Views==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
===Version 0.1===&lt;br /&gt;
This is the first version of what could be the entire system architecture. It is design to make all the above features works.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View v0.1|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
===Version 0.2===&lt;br /&gt;
Not relevant : skip it!&lt;br /&gt;
===Version 0.3===&lt;br /&gt;
This logical view was made after the M1 milestone. It is a much more minimal approach. However, it complete only the features F.u.0 to F.u.3 and F.a.0 to F.a.4.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.3.png|alt=OAR Cloud Logical View v0.3|Logical View (version 0.3)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main component:&lt;br /&gt;
; OARVirtCLI : It is a command line tool (CLI) that is install on the user&#039;s computer. It allows to :&lt;br /&gt;
*create an instance&lt;br /&gt;
*display the available images&lt;br /&gt;
*run one or more images on an instance&lt;br /&gt;
*connect to a running image&lt;br /&gt;
*stop a running image&lt;br /&gt;
*delete an instance&lt;br /&gt;
&lt;br /&gt;
====How it works====&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=File:DiagLogic.0.3.png&amp;diff=9573</id>
		<title>File:DiagLogic.0.3.png</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=File:DiagLogic.0.3.png&amp;diff=9573"/>
		<updated>2013-03-12T09:33:14Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: Logical diagram of oar cloud project version 0.3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Logical diagram of oar cloud project version 0.3&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9572</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9572"/>
		<updated>2013-03-12T09:08:38Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
*a [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud slide show] about LXC security.&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9571</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9571"/>
		<updated>2013-03-12T09:06:55Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* M1 Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. The current default mount point of cgroups with LXC use /sys/fs/cgroup/. Each [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt subsystems] (cpuset, cpuacct, memory,...) is mount separately on /sys/fs/cgroup/&amp;lt;cgroup-subsystem&amp;gt; where &amp;lt;cgroup-subsystem&amp;gt; is one of the subsystem name. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file, to fit with the cgroups mount points, should eventually makes them works together. After some try, we found out that &#039;&#039;&#039;oarsh&#039;&#039;&#039; and &#039;&#039;&#039;oarsh_shell&#039;&#039;&#039; should be modify too as it is said in the [http://oar.imag.fr/sources/2.5/docs/documentation/OAR-DOCUMENTATION-USER/#cpuset documentation] but the functions to modify does not exists. However it might be possible to configure OAR and to works with LXC if we dig deeper. &lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux. Even so, there is several ways to make a container secure using AppArmor or systemd with a sandbox[http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud].&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9570</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9570"/>
		<updated>2013-03-12T07:25:49Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==09/03==&lt;br /&gt;
*add [[#State of the art | State of the art]] part&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==07/02==&lt;br /&gt;
*add [[#Conception | Conception]] part&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9569</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9569"/>
		<updated>2013-03-12T07:16:08Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* 08/03 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#M1 Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9568</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9568"/>
		<updated>2013-03-12T07:15:42Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===M1 Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9567</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9567"/>
		<updated>2013-03-12T07:15:24Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Journal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
==11/03==&lt;br /&gt;
*begin of M2&lt;br /&gt;
&lt;br /&gt;
==08/03==&lt;br /&gt;
*M1 is closed. OAR cpuset and LXC does not work in competition in the same node (see [[#Conclusion| why]])&lt;br /&gt;
&lt;br /&gt;
==22/02==&lt;br /&gt;
*M1 works in simple mode (OAR does not use cpuset)&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9549</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9549"/>
		<updated>2013-03-09T13:39:17Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Hardware virtualization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that pivot directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9529</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9529"/>
		<updated>2013-03-08T11:22:35Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
We can notice that [http://0pointer.de/public/systemd-man/systemd-nspawn.html#example-nsenter systemd-nspawn], a kind of container launcher based on [http://en.wikipedia.org/wiki/Systemd systemd]. It is currently just a hack tool but it might become an LXC alternative for systemd based distributions.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9528</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9528"/>
		<updated>2013-03-08T10:15:49Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together.&lt;br /&gt;
* The LXC security is not efficient by default. Some distribution are using SELinux to secure the container but OAR is not working with SELinux&lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9527</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9527"/>
		<updated>2013-03-08T10:04:11Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Manipulation of containers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together. &lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-destroy -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9526</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9526"/>
		<updated>2013-03-08T10:03:01Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* M1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
* Is LXC mature enough to use it in production? &lt;br /&gt;
&lt;br /&gt;
===Conclusion===&lt;br /&gt;
&lt;br /&gt;
During this milestone we learned several things:&lt;br /&gt;
* libvirt uses a separate implementation of LXC and not the LXC package itself. Also, it can be harder to use and cuts some LXC functionalities like reboot and shutdown a container.&lt;br /&gt;
* by default OAR and LXC (like it works on Ubuntu 12.04) are in conflict because of the use of cgroups by OAR. It seems that rewriting the cgroups management part of the &#039;&#039;&#039;job_resource_manager_cgroups.pl&#039;&#039;&#039; file to fit with the cgroups mount points should eventually makes them works together. &lt;br /&gt;
* LXC is quite a young project and it&#039;s not stabilized for now. The documentation is a bit poor and makes LXC works depends on a lots of parameters. Moreover, depending on the Linux distribution the LXC configuration is totally different. It makes this tool really hard to understand and configure.&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9516</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9516"/>
		<updated>2013-03-08T09:31:55Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Hardware virtualization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
[http://libvirt.org/ Libvirt] is a useful tool for virtualization. It allows to use different kind of virtualization tools (above-mentioned) within a single interface. It is using XML configuration file to describe the VMs and a dedicated driver for each kind of virtualization tool.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9513</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9513"/>
		<updated>2013-03-08T09:23:52Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Conception */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
Here is the big picture of what could be the entire solution. It aims at giving us an overview of the project and helping us to design a roadmap. &lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9512</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9512"/>
		<updated>2013-03-08T09:20:51Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* OAR Cloud Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. The main goal is to bring the best of the cloud computing in the Grid world.&lt;br /&gt;
&lt;br /&gt;
You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9511</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9511"/>
		<updated>2013-03-08T09:19:14Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Hardware virtualization (in progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9510</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9510"/>
		<updated>2013-03-08T09:18:56Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Network virtualization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization (in progress)===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
In cloud computing infrastructure we need to connect the Virtual Machines (VMs). To achieve this, the network virtualization is used. In the Linux world the most common virtual network used the virtual interface named [http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge bridge]. The bridge is forwarding packet at Layer 2, so it is independent of upper layer protocols. It can be manage via the &#039;&#039;brctl&#039;&#039; command. Advanced features, like filtering or firewalling, are done using the [http://ebtables.sourceforge.net/ ebtable project].&lt;br /&gt;
&lt;br /&gt;
A more complete tools named [http://openvswitch.org/ OpenVSwitch] is open source and commonly used in lots of cloud computing solutions. It&#039;s basically a virtual switch that can handle VMs inside a node or between multiple node over real switch.&lt;br /&gt;
&lt;br /&gt;
To fit our demand regarding the network we will try to use OpenVSwitch to build our solution.&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9506</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9506"/>
		<updated>2013-03-07T18:12:51Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Hardware virtualization (in progress) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization (in progress)===&lt;br /&gt;
There is a lot of system virtualization technologies. For system virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. As we are looking for open source technologies, there is two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API. It recently provide an hardware-assisted virtualization like KVM. &lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is using hardware-assisted virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V). It seems to be quite equivalent to Xen, but some say that it&#039;s quite easier to use.&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. The major drawback is that it works only for Linux OS or program. Also, the actual stable version (0.7.5) is still a work-in-progress and the API is not stabilize yet. There is lots of security issues not really solve for now[http://mattoncloud.org/2012/07/16/are-lxc-containers-enough/] [http://fr.slideshare.net/dpavlin/security-of-linux-containers-in-the-cloud]. The major advantage is speed and the fact that LXC is directly accessible into the kernel.&lt;br /&gt;
&lt;br /&gt;
We want to know if LXC can be a good alternative to Xen or KVM.&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9504</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9504"/>
		<updated>2013-03-07T15:54:01Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization (in progress)===&lt;br /&gt;
There is a lot of hardware virtualization technologies. For hardware virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. There is, for now two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
;Xen&lt;br /&gt;
:Well known and used in big mainframe cloud solution, Xen is consider as reliable. It is a bare-metal (type1) hypervisor that lies directly on hardware. This means that every operating systems that runs on top of this hypervisor needs to be ported to fit with the [http://en.wikipedia.org/wiki/Paravirtualization paravirtualization] API.&lt;br /&gt;
&lt;br /&gt;
;KVM&lt;br /&gt;
:Included to the Linux Kernel, KVM (Kernel-based Virtual Machine) is use hardware virtualization for x86 processors with the virtualization extensions (Intel VT or AMD-V).&lt;br /&gt;
&lt;br /&gt;
;LXC&lt;br /&gt;
:The most recent one, LXC for &#039;&#039;LinuX Container&#039;&#039; use an other kind of virtualization technique based on isolation. Drawbacks, Only Linux. Advantage Speed &lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9500</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9500"/>
		<updated>2013-03-07T13:40:43Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Cloud computing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services, from the hardware to the applications, named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud Amazon EC2]. There IaaS proprietary platform is considered as the industrial standard and almost every other cloud computing solution are compatible with it&#039;s API. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy scaling web applications and services. This is an on-demand self-service and you pay only when you are using it. &lt;br /&gt;
The main features of Amazon EC2 are (from the [http://aws.amazon.com/ec2/#functionality Amazon EC2 web site]):&lt;br /&gt;
*Select a pre-configured, templated Amazon Machine Image (AMI) to get up and running immediately. Or create an AMI containing your applications, libraries, data, and associated configuration settings.&lt;br /&gt;
*Configure security and network access on your Amazon EC2 instance.&lt;br /&gt;
*Choose which instance type(s) you want, then start, terminate, and monitor as many instances of your AMI as needed, using the web service APIs or the variety of management tools provided.&lt;br /&gt;
*Determine whether you want to run in multiple locations, utilize static IP endpoints, or attach persistent block storage to your instances.&lt;br /&gt;
*Pay only for the resources that you actually consume, like instance-hours or data transfer.&lt;br /&gt;
 &lt;br /&gt;
But there is lots of alternatives to Amazon. Several company provide the same kind of services using proprietary or open source solutions. You can see a comparison of some of these solutions [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===Hardware virtualization===&lt;br /&gt;
There is a lot of hardware virtualization technologies. For hardware virtualization Amazon is using the [http://xen.org/ XEN] virtualization technology like most of their competitors. There is, for now two serious alternatives to consider: [http://www.linux-kvm.org/page/Main_Page KVM] and [http://lxc.sourceforge.net/ LXC].&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===System virtualization===&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9499</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9499"/>
		<updated>2013-03-07T12:30:38Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* State of the art */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013. Here is the current state of the art concerning the cloud computing technologies and the underlying virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
==Cloud computing==&lt;br /&gt;
===Definition===&lt;br /&gt;
The cloud computing is the use computing and storing resources through a network. It is providing a stack of services from the hardware to the application named &amp;quot;&#039;&#039;Something&#039;&#039; as a Service&amp;quot;. You can read a more exhaustive definition on [http://en.wikipedia.org/wiki/Cloud_computing Wikipedia].&lt;br /&gt;
===IaaS===&lt;br /&gt;
The layer we are interested in, is the Infrastructure as a Service layer (IaaS). It provided access to computation resources with an hardware abstraction made by virtualization. The leader in this domain is [http://aws.amazon.com/fr/ec2/ Amazon EC2]. There IaaS platform is considered as the industrial standard. They provide, through a Command Line Interface (CLI) and a Web interface, a simple way to deploy web scaling applications and services. They are using the XEN virtualization technology like most of their competitors. But there is lots of alternatives as you can see [http://en.wikipedia.org/wiki/Cloud_computing_comparison here].&lt;br /&gt;
&lt;br /&gt;
==Virtualization technologies==&lt;br /&gt;
===System virtualization===&lt;br /&gt;
===Network virtualization===&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9490</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9490"/>
		<updated>2013-03-07T11:47:59Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=State of the art=&lt;br /&gt;
This project begins on January 2013... TODO&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9369</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9369"/>
		<updated>2013-03-05T17:23:26Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M3&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9368</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9368"/>
		<updated>2013-03-05T15:09:39Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* External links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
*the [https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt cgroups documentation]&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9097</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9097"/>
		<updated>2013-02-22T18:20:43Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* OAR settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the &#039;&#039;cgroup-lite&#039;&#039; service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using&lt;br /&gt;
  service cgroup-lite stop&lt;br /&gt;
solve the problem for OAR but puts LXC down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9096</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9096"/>
		<updated>2013-02-22T18:13:17Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the `cgroup-lite` service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using `service cgroup-lite stop` solve the problem for OAR but puts LXC&lt;br /&gt;
down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9095</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9095"/>
		<updated>2013-02-22T18:12:59Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* M1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#check if killing the job do kill the VM &lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the `cgroup-lite` service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using `service cgroup-lite stop` solve the problem for OAR but puts LXC&lt;br /&gt;
down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9094</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9094"/>
		<updated>2013-02-22T18:06:17Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* M1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
The cigri devel appliance was used as an configuration example for this.&lt;br /&gt;
The Ubuntu 12.04 LTS distribution has been chosen because it seems to be one of&lt;br /&gt;
the few distributions where LXC works out-of-the-box.&lt;br /&gt;
&lt;br /&gt;
===Encountered problems===&lt;br /&gt;
&lt;br /&gt;
====OAR settings====&lt;br /&gt;
&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager_cgroups.pl&amp;quot; generate cpuset errors&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager_cgroups][41][DEBUG] init&lt;br /&gt;
    mount: special device none does not exist&lt;br /&gt;
    rm: cannot remove `/dev/cpuset&#039;: Is a directory&lt;br /&gt;
    ln: failed to create symbolic link `/dev/cpuset/oar_cgroups&#039;: Operation not permitted&lt;br /&gt;
    [job_resource_manager_cgroups][41][ERROR] Failed to mount cgroup pseudo filesystem&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* the job manager &amp;quot;job_resource_manager.pl&amp;quot; generate cpuset errors too&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    [job_resource_manager][40][DEBUG] init&lt;br /&gt;
    [debug] [2013-02-21 20:03:15.153] [MetaSched] Start of meta scheduler&lt;br /&gt;
    sh: 1: cannot create /dev/cpuset//oar/cpu_exclusive: Permission denied&lt;br /&gt;
    [job_resource_manager][40][ERROR] Failed to create cpuset /oar&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I thought the problem come from a database conflict so I tried to use&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo  oar-database --reset&lt;br /&gt;
    Are you sure you want to reset your database ? (The database content will be lost) [y/N]: y&lt;br /&gt;
    resetting the database &#039;oar&#039;...&lt;br /&gt;
    ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;schema&#039; at line 1&lt;br /&gt;
    Fail to execute /usr/lib/oar/database/mysql_reset_structure.sql&lt;br /&gt;
    . at /usr/sbin/oar-database line 188, &amp;lt;FIN&amp;gt; line 1.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
* I tried to run the `update_cpuset_id.sh` script but it shows an error message either:&lt;br /&gt;
    &amp;lt;code&amp;gt;&lt;br /&gt;
    % sudo /etc/oar/update_cpuset_id.sh 127.0.0.1&lt;br /&gt;
    The authenticity of host &#039;[127.0.0.1]:6667 ([127.0.0.1]:6667)&#039; can&#039;t be established.&lt;br /&gt;
    RSA key fingerprint is 72:91:a6:40:29:60:b2:c2:18:ba:b7:66:4a:c5:d7:2f.&lt;br /&gt;
    Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
    Warning: Permanently added &#039;[127.0.0.1]:6667&#039; (RSA) to the list of known hosts.&lt;br /&gt;
    Permission denied (publickey,keyboard-interactive).&lt;br /&gt;
    DBD::mysql::st execute failed: Unknown column &#039;ip&#039; in &#039;where clause&#039; at /usr/share/perl5/OAR/IO.pm line 4774.&lt;br /&gt;
    DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/share/perl5/OAR/IO.pm line 4776.&lt;br /&gt;
    &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem comes from the `cgroup-lite` service that run by default in an Ubuntu 12.04.&lt;br /&gt;
Stop this service using `service cgroup-lite stop` solve the problem for OAR but puts LXC&lt;br /&gt;
down.&lt;br /&gt;
&lt;br /&gt;
I find a trick to make OAR and LXC working together: I disable the cpuset feature of OAR.&lt;br /&gt;
In the /etc/oar/oar.conf (there is a copy in the M1 folder) I have comment CPUSET_PATH and&lt;br /&gt;
set to yes OARSUB_FORCE_JOB_KEY as it is provided in the CPUSET_PATH comment.&lt;br /&gt;
&lt;br /&gt;
Thus, I could run an LXC container inside a job. The container was vanished when the job has been killed.&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
&lt;br /&gt;
* Is the OAR cpuset mandatory, even if the LXC manage it?&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9074</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9074"/>
		<updated>2013-02-21T16:33:51Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* OAR Cloud Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository on [https://github.com/mickours/oar-cloud github].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9073</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9073"/>
		<updated>2013-02-21T16:33:12Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* OAR Cloud Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR]. You can access to the Git repository at this address: [https://github.com/mickours/oar-cloud]&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9072</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9072"/>
		<updated>2013-02-21T16:29:53Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
	<entry>
		<id>https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9071</id>
		<title>Proj-2012-2013-OAR-Cloud</title>
		<link rel="alternate" type="text/html" href="https://air.imag.fr/index.php?title=Proj-2012-2013-OAR-Cloud&amp;diff=9071"/>
		<updated>2013-02-21T16:26:23Z</updated>

		<summary type="html">&lt;p&gt;Mercierm: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=OAR Cloud Project=&lt;br /&gt;
&lt;br /&gt;
This project aims at creating a light cloud computing architecture on top of the batch scheduler [http://oar.imag.fr/ OAR].&lt;br /&gt;
&lt;br /&gt;
=Project Members=&lt;br /&gt;
This project is proposed by:&lt;br /&gt;
&lt;br /&gt;
Olivier Richard - Teacher and researcher in RICM&#039;s Polytech Grenoble training&lt;br /&gt;
&lt;br /&gt;
Three students from RICM are working on it:&lt;br /&gt;
&lt;br /&gt;
*Jordan Calvi (RICM4)&lt;br /&gt;
*Alexandre Maurice (RICM4)&lt;br /&gt;
*Michael Mercier (RICM5)&lt;br /&gt;
&lt;br /&gt;
=Conception=&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
There is two kind of actors that are dealing with OAR cloud, users and administrators. The F.u* and the F.a* are the user and Administrator features describe below.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagContext.png |alt=OAR Cloud Context Diagram|Context Diagram]]&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
===User===&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.0&#039;&#039;&#039; Connect to an account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.1&#039;&#039;&#039; Launch and configure one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.2&#039;&#039;&#039; Deploy an image on one or more instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.3&#039;&#039;&#039; Modify and save images&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.4&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.5&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
Advanced features:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.6&#039;&#039;&#039; Automated resize of an instance (adapt the resources) using predefined rules and schedule&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.7&#039;&#039;&#039; Load balancing between several instances&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.u.8&#039;&#039;&#039; Advanced Network configuration for user: ACL, subnets, VPN...&lt;br /&gt;
&lt;br /&gt;
===Administrator===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.0&#039;&#039;&#039; Create/delete user account&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.1&#039;&#039;&#039; Add/remove and manage resources&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.2&#039;&#039;&#039; Visualize resources and instances states&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.3&#039;&#039;&#039; Install and update nodes operating systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.4&#039;&#039;&#039; Handle users access rights&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.5&#039;&#039;&#039; Setup alarms based on rules using metrics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;F.a.6&#039;&#039;&#039; Being inform by e-mail and/or notification for interesting events&lt;br /&gt;
&lt;br /&gt;
==Logical View==&lt;br /&gt;
Here is the logical view of the OAR Cloud system. Every component on this diagram represents a software component type. The links between these components represent the communication between them.&lt;br /&gt;
&lt;br /&gt;
[[File:DiagLogic.0.1.png|alt=OAR Cloud Logical View|Logical View (version 0.1)]]&lt;br /&gt;
&lt;br /&gt;
Description of the main components:&lt;br /&gt;
; AccountManager : Handle users and admins access rights&lt;br /&gt;
; AccessPoint : The system access point reached by the different access tools&lt;br /&gt;
; InstanceManager : Manage the creation, configuration and deletion of instances all over the severals nodes. It also handles the appliances persistence and deployment&lt;br /&gt;
; UserCLI &amp;amp; AdminCLI : Command line access tools for users and admins&lt;br /&gt;
&lt;br /&gt;
=Milestones=&lt;br /&gt;
This table presents the milestones of the project. Each Milestones are described below. &lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
 |+ Project milestones &lt;br /&gt;
 |&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OAR Resource reservation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | LXC&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | libvirt&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | OpenVSwitch&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | VM SSH Access&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Access Security&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Network isolation&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Resource cleanup&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Client CLI &lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Storage&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M1&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | &lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;row&amp;quot; | M2&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | X&lt;br /&gt;
 | &lt;br /&gt;
 |&lt;br /&gt;
 | X&lt;br /&gt;
 |&lt;br /&gt;
 |&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
==M1==&lt;br /&gt;
In an Ubuntu 12.04 LTS environement&lt;br /&gt;
#install and configure OAR &lt;br /&gt;
#install and configure LXC&lt;br /&gt;
#make OAR reservation&lt;br /&gt;
#launch one or more VM using LXC&lt;br /&gt;
#Connect to the VM&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M2==&lt;br /&gt;
In Ubuntu 12.04 LTS&lt;br /&gt;
#install and configure LXC, libvirt and OpenVswitch&lt;br /&gt;
#launch at least 2 VMs&lt;br /&gt;
#make the VMs to ping each others&lt;br /&gt;
#script this!&lt;br /&gt;
&lt;br /&gt;
==M3==&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=Tools=&lt;br /&gt;
&lt;br /&gt;
==Libvirt and LXC ==&lt;br /&gt;
===LXC===&lt;br /&gt;
&lt;br /&gt;
LXC is a lightweight hypervisor allowing to run isolated appliances. Indeed, it provides a virtual environment that has its own process and network space. It is similar to a chroot. As LXC is implemented on given linux kernel, only operating systems that are compatible with the hosting kernel will be able to run. It is based on cgroups (control groups), a Linux kernel feature to manage ressources like CPU, memory and disk I/O by limiting resources, prioritizing groups, accounting (measuring), isolating (separate namespaces for groups, it means processes, network connections and files are not visible by other groups) and controling groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/!\ LXC as been set up succesfully on ubuntu 12.04 LTS as container launching does not works on Debian Wheeze testing OS. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;aptitude install lxc bridge-utils debootstrap&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ Conteners will be placed in /var/lib/lxc /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mounting cgroups automatically : edit /etc/fstab and add the following&lt;br /&gt;
:&amp;lt;code&amp;gt;cgroup	/sys/fs/cgroup	cgroup defaults	0	0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Enabling previous modifications&lt;br /&gt;
:&amp;lt;code&amp;gt;mount -a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Checking everything is ok&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-checkconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Manipulation of containers====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating a container running Ubuntu&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-create -t ubuntu -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
:/!\ By default, the version of the guest OS is the same as the hosting one. /!\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Showing existing containers and thoses that are running&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-ls&amp;lt;/code&amp;gt;&lt;br /&gt;
:/?\ The first line indicates existing containers and the second one thoses in running state. /?\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Obtaining information about ubuntu1&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-info -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-start -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connection to the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-console -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting down the container&lt;br /&gt;
:&amp;lt;code&amp;gt;lxc-stop -n ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exiting console&lt;br /&gt;
:perform &amp;lt;code&amp;gt;CTRL-a q&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring the container====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At boot time, a virtual machines reads the file /var/lib/lxc/{VM-name}/config to set up its configuration (root file system, number of TTY, limites, etc).&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
lxc.network.type=veth&lt;br /&gt;
lxc.network.link=lxcbr0&lt;br /&gt;
lxc.network.flags=up&lt;br /&gt;
lxc.network.hwaddr = 00:16:3e:24:e5:9a&lt;br /&gt;
lxc.utsname = ubuntu1&lt;br /&gt;
&lt;br /&gt;
lxc.devttydir = lxc&lt;br /&gt;
lxc.tty = 4&lt;br /&gt;
lxc.pts = 1024&lt;br /&gt;
lxc.rootfs = /var/lib/lxc/ubuntu1/rootfs&lt;br /&gt;
lxc.mount  = /var/lib/lxc/ubuntu1/fstab&lt;br /&gt;
lxc.arch = amd64&lt;br /&gt;
lxc.cap.drop = sys_module mac_admin&lt;br /&gt;
lxc.pivotdir = lxc_putold&lt;br /&gt;
&lt;br /&gt;
# uncomment the next line to run the container unconfined:&lt;br /&gt;
#lxc.aa_profile = unconfined&lt;br /&gt;
&lt;br /&gt;
lxc.cgroup.devices.deny = a&lt;br /&gt;
# Allow any mknod (but not using the node)&lt;br /&gt;
lxc.cgroup.devices.allow = c *:* m&lt;br /&gt;
lxc.cgroup.devices.allow = b *:* m&lt;br /&gt;
# /dev/null and zero&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:3 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:5 rwm&lt;br /&gt;
# consoles&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:1 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:0 rwm&lt;br /&gt;
#lxc.cgroup.devices.allow = c 4:1 rwm&lt;br /&gt;
# /dev/{,u}random&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:9 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:8 rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 136:* rwm&lt;br /&gt;
lxc.cgroup.devices.allow = c 5:2 rwm&lt;br /&gt;
# rtc&lt;br /&gt;
lxc.cgroup.devices.allow = c 254:0 rwm&lt;br /&gt;
#fuse&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:229 rwm&lt;br /&gt;
#tun&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:200 rwm&lt;br /&gt;
#full&lt;br /&gt;
lxc.cgroup.devices.allow = c 1:7 rwm&lt;br /&gt;
#hpet&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:228 rwm&lt;br /&gt;
#kvm&lt;br /&gt;
lxc.cgroup.devices.allow = c 10:232 rwm&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Configuring default network and switch====&lt;br /&gt;
see:&lt;br /&gt;
 /etc/default/lxc&lt;br /&gt;
&lt;br /&gt;
===Libvirt===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installation====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Packages installation&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;apt-get install libvirt-bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Creating an XML file configuration to import an existing container in libvirt&#039;&#039;&lt;br /&gt;
: /!\ Notice that libvirt can not install am OS in a container. Therefore, an LXC container with an OS must have been set up previously (that was the we saw before). Then, the file system directory will be given to libvirt when importing the VM. /!\&lt;br /&gt;
&lt;br /&gt;
: In order to create a libvirt container, an XML file describing the VM we want to import must be filled. There is a sample of such an XML file that belong to VM &amp;quot;ubuntu1&amp;quot; we have just created :&lt;br /&gt;
:&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;lxc&#039;&lt;br /&gt;
  &amp;lt;name&amp;gt;ubuntu1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;332768&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type&amp;gt;exe&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;init&amp;gt;/sbin/init&amp;lt;/init&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;destroy&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;emulator&amp;gt;/usr/lib/libvirt/libvirt_lxc&amp;lt;/emulator&amp;gt;&lt;br /&gt;
    &amp;lt;filesystem type=&#039;mount&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source dir=&#039;/var/lib/lxc/ubuntu1/rootfs&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dir=&#039;/&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/filesystem&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;network&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source network=&#039;default&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; /&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Setting the container as a libvirt one&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh --connect lxc:/// define ubuntu1.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Booting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// start ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container localy&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Connecting to the container remotly&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc+{IPDEST}:/// console ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shutting the container &#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// destroy ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Deleting the container&#039;&#039;&lt;br /&gt;
:&amp;lt;code&amp;gt;virsh -c lxc:/// undefine ubuntu1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problemes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using Ubuntu as a host,when connecting to a libvirt VM running Debian, the guest appliance waits for the user to log in through two interfaces at a time (tty1 and console), so it is not possible to get identified.&lt;br /&gt;
&lt;br /&gt;
* Using Debian Wheeze as a host, when connecting to a libvirt VM, the console does not offer the user the possibility to log in. However, when using directly LXC there is no issue.&lt;br /&gt;
&lt;br /&gt;
==Open vSwitch==&lt;br /&gt;
&lt;br /&gt;
==Internal links==&lt;br /&gt;
&lt;br /&gt;
*[[Proj-2012-2013-OAR-Cloud_UML | &#039;&#039;&#039;UML&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*a [https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ getting started page] for using LXC with libvirt&lt;br /&gt;
&lt;br /&gt;
=Journal=&lt;br /&gt;
&lt;br /&gt;
==19/02==&lt;br /&gt;
*milestone definitions&lt;br /&gt;
&lt;br /&gt;
==04/02==&lt;br /&gt;
* We have specified the subject&lt;br /&gt;
* Distribute the work between us. &lt;br /&gt;
** Jordan: LXC and Libvirt&lt;br /&gt;
** Alexandre: OpenVSwitch and Libvirt&lt;br /&gt;
** Michael: OAR and global architecture&lt;/div&gt;</summary>
		<author><name>Mercierm</name></author>
	</entry>
</feed>