fog / fog-libvirt

libvirt provider for fog
MIT License
16 stars 42 forks source link

lxc support #5

Closed plribeiro3000 closed 3 years ago

plribeiro3000 commented 9 years ago

Hello, I've had a quick look at getting lxc support in the libvirt driver. I'm no programmer, and have no experience with ruby. With the following changes I was able to create a lxc container using the libvirt driver.

I would like to see lxc support in some fashion in the libvirt driver, hope this can help that happen.

# diff libvirt/models/compute/templates/server.xml.erb.lxc  libvirt/models/compute/templates/server.xml.erb
9d8
<     <init>'<%= os_init %>'</init>
11a11,15
>   <features>
>     <acpi/>
>     <apic/>
>     <pae/>
>   </features>
13,15d16
<   <on_poweroff>destroy</on_poweroff>
<   <on_reboot>restart</on_reboot>
<   <on_crash>destroy</on_crash>
39a41,43
>     <serial type='pty'>
>       <target port='0'/>
>     </serial>
41c45
<       <target type='lxc' port='0'/>

---
>       <target port='0'/>
42a47,52
>     <input type='tablet' bus='usb'/>
>     <input type='mouse' bus='ps2'/>
>     <graphics type='<%= display[:type] %>' port='<%= display[:port] %>' autoport='yes' <% if display[:listen] and !(display[:listen].empty?)  %> listen='<%= display[:listen] %>'<% end %> <% if display[:password] and !(display[:password].empty?) %>passwd='<%=display[:password] %>'<% end %> />
>     <video>
>       <model type='cirrus' vram='9216' heads='1'/>
>     </video>
#diff libvirt/models/compute/server.rb libvirt/models/compute/server.rb.lxc 
15a16
>         attribute :os_init
361c362,363
<             :os_type                => "hvm",

---
>             :os_type                => "exe",
>             :os_init                => "/bin/init",
363c365
<             :domain_type            => "kvm",

---
>             :domain_type            => "lxc",

Original issue opened by @selund at fog/fog#3221

cc/ @selund @geemus

github-actions[bot] commented 3 years ago

This issue has been marked inactive and will be closed if no further activity occurs.