LXC Containers

<% require 'toaster/util/lxc' require 'toaster/test/test_orchestrator' message = nil lxcs = {} prototypes = [] if param('updateHosts') != "" && param('lxcHosts') != "" $session['lxcHosts'] = param('lxcHosts') end if !$session['lxcHosts'] || $session['lxcHosts'] == "" $session['lxcHosts'] = "localhost:8385" end def esc_quot(str) str.gsub(/"/, '"') end begin duration = 0 if $session['lxcHosts'] before = Time.new.to_i hosts = $session['lxcHosts'].split(/[\s,;]+/) lxcs = Toaster::LXC.get_containers_for_hosts(hosts) || [] after = Time.new.to_i duration = after - before #puts lxcs.inspect end cmd_out = "" if param("submitShCmd") != "" orch = TestOrchestrator.new if param("execTarget") == "__all__" lxcs.each do |host,lxc| orch.add_host(host) end else orch.add_host(param("execTarget")) end cmd_out = orch.exec_on_all_hosts(param("shCmd") + " 2>&1", false) end if param('createProto') != "" name = param('protoName') if !name.match(/^[a-zA-Z0-9_]+$/) message += "The prototype name must match the pattern [a-zA-Z0-9_]+" elsif prototypes.include?(name) message += "A prototype with the same name already exists." else distro = param('protoOS') output = Toaster::LXC.new_prototype(param('server'), name, distro) $session['gen.prototypes'] = "" end end if lxcs count = 0 changed = false lxcs.each do |ip,lxc| client = Toaster::ToasterAppClient.new(ip) if param("destroy_#{count}") != "" client.clean() changed = true end count += 1 end if changed hosts = $session['lxcHosts'].split(/[\s,;]+/) lxcs = Toaster::LXC.get_containers_for_hosts(hosts) || [] end end rescue => ex %>
Error:
<%= ex %>
<% end lxcs ||= {} %> This page provides details about the available LXC containers (light-weight VMs) which are used for testing purposes.

Host Machines

<% if message %>
<%= message %>
<% end %> Host Node(s):


<% if lxcs %>

Container Details

Requesting information from hosts took <%= to_minutes(duration) %>. <% counter = -1 lxcs.each do |ip,lxc| %>

Host Machine '<%= ip %>':

<% i = 0 lxc.each do |l,config| %> <% end %>
#Container NameStateIP Address
<%= (i=i+1) %><%= l %><%= config['state'] %><%= config['ip'] %>
<% end %> <% end %>

Setup LXC Prototype

Host Server:"/>
Name:
Operating System: