Beispiel #1
0
 def init(self, conf, force_deploy=False):
     logging.info("Openstack provider")
     enoslib_conf = self.build_config(conf)
     _conf = Configuration.from_dictionnary(enoslib_conf)
     openstack = Enos_Openstack(_conf)
     roles, networks = openstack.init(force_deploy=force_deploy)
     return roles, networks
Beispiel #2
0
 def destroy(self, env):
     conf = env['config']
     enoslib_conf = _build_enoslib_conf(conf)
     openstack = Enos_Openstack(enoslib_conf)
     openstack.destroy()
Beispiel #3
0
    "prefix": "plop",
    "resources": {
        "machines": [{
            "roles": ["control"],
            "flavour": "m1.medium",
            "number": 1,
        }, {
            "roles": ["compute"],
            "flavour": "m1.medium",
            "number": 5,
        }],
        "networks": ["network_interface"]
    }
}

tc = {
    "enable": True,
    "default_delay": "20ms",
    "default_rate": "1gbit",
}
inventory = os.path.join(os.getcwd(), "hosts")
conf = Configuration.from_dictionnary(provider_conf)
provider = Openstack(conf)
provider.destroy()
roles, networks = provider.init()
generate_inventory(roles, networks, inventory)
wait_ssh(inventory)
generate_inventory(roles, networks, inventory, check_networks=True)
emulate_network(roles, inventory, tc)
validate_network(roles, inventory)
Beispiel #4
0
    "key_name": "enos_matt",
    "user": "******",
    "image": "CC-Ubuntu16.04",
    "prefix": "plop",
    "resources": {
        "machines": [
            {
                "roles": ["control"],
                "flavour": "m1.medium",
                "number": 1
            },
            {
                "roles": ["compute"],
                "flavour": "m1.medium",
                "number": 5
            },
        ],
        "networks": ["network_interface"],
    },
}

tc = {"enable": True, "default_delay": "20ms", "default_rate": "1gbit"}
inventory = os.path.join(os.getcwd(), "hosts")
conf = Configuration.from_dictionnary(provider_conf)
provider = Openstack(conf)
roles, networks = provider.init()
discover_networks(roles, networks)
netem = Netem(roles, networks)
netem.deploy()
netem.validate()