Module: TestLab::Container::LXC
- Included in:
- TestLab::Container
- Defined in:
- lib/testlab/container/lxc.rb
Instance Method Summary collapse
-
#console ⇒ Object
Container Console.
-
#exists? ⇒ Boolean
Does the container exist?.
-
#fs_root ⇒ String
Container root filesystem path.
-
#lxc ⇒ LXC
LXC::Container object.
Instance Method Details
#console ⇒ Object
Container Console
Opens an LXC console into the container.
This command will replace the current process with an SSH session that will execute the appropriate LXC console command on the parent node of this container.
13 14 15 16 |
# File 'lib/testlab/container/lxc.rb', line 13 def console @ui.stdout.puts("Press CTRL-A Q to exit the console. (CTRL-A CTRL-A to enter a CTRL-A itself)".red.bold) self.node.ssh.console(%(-t 'sudo lxc-console -n #{self.id}')) end |
#exists? ⇒ Boolean
Does the container exist?
31 32 33 34 35 |
# File 'lib/testlab/container/lxc.rb', line 31 def exists? @ui.logger.debug { "Container Exists?: #{self.id} " } self.lxc.exists? end |
#fs_root ⇒ String
Container root filesystem path
40 41 42 |
# File 'lib/testlab/container/lxc.rb', line 40 def fs_root self.lxc.fs_root(self.lxc_clone.exists?) end |
#lxc ⇒ LXC
LXC::Container object
Returns a LXC::Container class instance configured for this container.
24 25 26 |
# File 'lib/testlab/container/lxc.rb', line 24 def lxc @lxc ||= self.node.lxc.container(self.id) end |