コード例 #1
0
ファイル: openstack.py プロジェクト: jrbalderrama/enos
 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
コード例 #2
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)