lxc4u

Provides tools for managing LXC in Ubuntu 12.04 and Ubuntu 12.04 Containers
Download

lxc4u Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Reuven V. Gonzales
  • Publisher web site:
  • https://github.com/ravenac95/

lxc4u Tags


lxc4u Description

lxc4u is a Python module that provides tools for managing LXC in Ubuntu 12.04 and Ubuntu 12.04 Containers. Other containers are not supported (yet?)- Creates containers using overlayfs- Can handle multiple overlayfs layersWorking examplesCreate a container named test1:import lxc4utest1_lxc = lxc4u.create('test1')# Wait a long time...# Start the containertest1_lxc.start()Create a container that overlays test1:import lxc4utest1_overlay_lxc = lxc4u.create('test1_overlay', base='test1', overlays=)# Start the containertest1_overlay_lxc.start()test1_overlay_lxc.destroy()Create a container with multiple overlays of test1. The right most overlay is the upper most overlay directory:import lxc4utest1_overlay_lxc = lxc4u.create('test1_overlay', base='test1', overlays=)# Start the containertest1_overlay_lxc.start()These examples have not yet been implemented. Soon!Starting a container named test1. This assumes lxc is properly configured in your system:import lxc4u# Start containertest1_lxc = lxc4u.start('test1')# Stop containertest1_lxc.stop()# or lxc4u.stop('test1')Possible interface examplesStarting an ephemeral container using test1 as a base:import lxc4u# Start containertest1_ephemeral_lxc = lxc4u.start('test1', ephemeral=True)# Stop containertest1_ephemeral_lxc.stop()Starting an ephemeral container using test1 with static network settings:import lxc4unetwork_settings = dict( ip="10.0.3.5", gateway="10.0.3.1", netmask="255.255.255.0", network="10.0.3.0",)# Start containertest1_ephemeral_lxc = lxc4u.start('test1', ephemeral=True, static_network=network_settings)# Stop containertest1_ephemeral_lxc.stop()Starting an ephemeral container using with a startup command (must be available on the container's path):import lxc4u# Start containertest1_ephemeral_lxc = lxc4u.start('test1', ephemeral=True, startup_command="/usr/local/bin/somecommand")# Stop containertest1_ephemeral_lxc.stop()Product's homepage


lxc4u Related Software