BeyondTheClouds / enos

Experimental eNvironment for OpenStack :monkey:
https://beyondtheclouds.github.io/enos/
GNU General Public License v3.0
30 stars 22 forks source link

can't instantiate chameleoncloud example #170

Closed ivotron closed 7 years ago

ivotron commented 7 years ago

This is the example:

provider:
  type: chameleonbaremetal
  key_name: 'enos-key'
  image_name: CC-Ubuntu14.04-Docker
resources:
  storage:
    control: 1
    network: 1

This is the output:

INFO:root:Generate results directory /experiment/enos_2017-08-03T15:43:22.012526
INFO:root:Symlink /experiment/enos_2017-08-03T15:43:22.012526 to /experiment/current
INFO:root:Directory for experiment results is /experiment/enos_2017-08-03T15:43:22.012526
INFO:root:Reloaded configuration file /experiment/reservation.yaml
INFO:root:Loaded provider <module 'enos.provider.chameleonbaremetal' from '/usr/local/lib/python2.7/site-packages/enos/provider/chameleonbaremetal.pyc'>
INFO:root:[glance]: Using image CC-Ubuntu14.04-Docker:10c1c632-1c4d-4c9d-bdd8-7938eeba9f14
INFO:root:[neutron]: Reusing security-groups enos-secgroup
INFO:root:[neutron]: Reusing existing {u'status': u'ACTIVE', u'subnets': [u'5a5fb943-12cb-44b4-94bb-51b5d3ad841b'], u'name': u'sharednet1', u'admin_state_up': True, u'tenant_id': u'570aad8999f7499db99eae22fe9b29bb', u'mtu': 0, u'router:external': False, u'shared': True, u'id': u'915853fe-10c5-4dac-a402-ef1ebc53e427'} network
ERROR:root:Exception
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/enos/utils/enostask.py", line 77, in decorated
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/enos/enos.py", line 106, in up
    provider.init(config, kwargs['--force-deploy'])
  File "/usr/local/lib/python2.7/site-packages/enos/provider/chameleonbaremetal.py", line 164, in init
    env = openstack.check_environment(conf)
  File "/usr/local/lib/python2.7/site-packages/enos/provider/openstack.py", line 335, in check_environment
    allocation_pool=conf['provider']['allocation_pool'])
  File "/usr/local/lib/python2.7/site-packages/enos/provider/openstack.py", line 156, in check_network
    subnet = [s for s in subnets if s['name'] == subnet_name][0]
IndexError: list index out of range
msimonin commented 7 years ago

Hi @ivotron

If you are using https://chi.tacc.chameleoncloud.org the shared net name should be : shared-subnet1. See https://enos.readthedocs.io/en/stable-ocata/provider/openstack.html#id4

The configuration should look like :

provider:
  type: chameleonbaremetal
  key_name: #your key name
  walltime: '2:00:00'
  subnet: {'name': 'shared-subnet1'}
resources:
  compute:
    control: 1
    network: 1
    compute: 1

Moreover I suggest you to update enos to the latest version since #171 has been fixed recently.

ivotron commented 7 years ago

Thanks a lot. Updated and fixed YAML:

provider:
  type: chameleonbaremetal
  key_name: mykey
  image_name: CC-Ubuntu14.04-Docker
  subnet: {'name': 'shared-subnet1'}
resources:
  storage:
    compute: 1

Can I bother with one more question related to this? Is it possible to provide the key name via an environment variable? That would make it easier to re-use/share a reservation YAML file between multiple users (and would also be useful for automated tests).

After using the above reservation.yaml now I get the following:

INFO:root:[nova]: Polling the Deployment
INFO:root:[nova]: 0 deployed servers
INFO:root:[nova]: 0 undeployed servers
INFO:root:[nova]: Polling the Deployment
INFO:root:[nova]: 1 deployed servers
INFO:root:[nova]: 0 undeployed servers
INFO:root:[neutron]: Using floating ip: {u'router_id': None, u'status': u'DOWN', u'tenant_id': u'09f0a22bcd7149d7aff76
5d361d45e13', u'floating_network_id': u'ef2d2d34-635a-4f89-89b6-436e188ad82e', u'fixed_ip_address': None, u'floating_i
p_address': u'129.114.109.35', u'port_id': None, u'id': u'fa58c4de-4dd2-4b3e-a50d-9c5b05e9895d'}
INFO:root:[nova]: Reusing <Server: enos-storage-0> as gateway
INFO:root:{'compute': [<Server: enos-storage-0>], 'storage': [<Server: enos-storage-0>]}
ERROR:root:Exception
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/enos/utils/enostask.py", line 77, in decorated
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/enos/enos.py", line 117, in up
    base_inventory = seekpath(env['config']['inventory'])
KeyError: 'inventory'

The instance gets launched successfully on chameleon. I also tried to use destroy unsuccessfully:

INFO:root:Kolla command
INFO:root:{'--': True, '--env': '/experiment/current', '-v': 0, '<command>': ['destroy', '--yes-i-really-really-mean-i
t'], '--silent': False, 'kolla': True}
INFO:root:['/experiment/enos_2017-08-04T14:18:20.404542/kolla/tools/kolla-ansible', 'destroy', '--yes-i-really-really-
mean-it', '-i', '/experiment/enos_2017-08-04T14:18:20.404542/multinode', '--passwords', '/experiment/enos_2017-08-04T1
4:18:20.404542/passwords.yml', '--configdir', '/experiment/enos_2017-08-04T14:18:20.404542']
ERROR:root:Exception
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/enos/utils/enostask.py", line 77, in decorated
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/enos/utils/enostask.py", line 103, in decorator
    return fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/enos/enos.py", line 667, in kolla
    call(kolla_cmd)
  File "/usr/local/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/local/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/local/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

ivo@mbp:~/src/sirius-popper/experiments/multinode
$ ls -l
total 8.0K
lrwxrwxrwx 1 ivo staff  43 Aug  4 10:18 current -> /experiment/enos_2017-08-04T14:18:20.404542
drwxr-xr-x 3 ivo staff 102 Aug  4 10:28 enos_2017-08-04T14:18:20.404542/
-rwxr-xr-x 1 ivo staff   0 Aug  3 10:43 reservation.yaml

Thanks!

msimonin commented 7 years ago

See below for a minimal configuration file. Maybe you missed the inventory. The inventory will be looked up in the source if not found from your local directory.

Note also that to get a functionnal deployment you need one control, one network and at least one compute role.

---
provider:
  type: chameleonbaremetal
  key_name: #your key name
  walltime: '2:00:00'
  subnet: {'name': 'shared-subnet1'}
resources:
  compute:
    control: 1
    network: 1
    compute: 1

# ############################################### #
# Inventory to use                                #
# ############################################### #

# This will describe the topology of your services
inventory: inventories/inventory.sample

# ############################################### #
# docker registry parameters
# ############################################### #
registry:
  ceph: False

# ############################################### #
# Enos Customizations                             #
# ############################################### #
enable_monitoring: no

# ############################################### #
# Kolla parameters                                #
# ############################################### #
# Repository
kolla_repo: "https://git.openstack.org/openstack/kolla-ansible"
kolla_ref: "stable/ocata"

# Vars : globals.yml
kolla:
  kolla_base_distro: "centos"
  kolla_install_type: "source"
  docker_namespace: "beyondtheclouds"
  enable_heat: "no"
msimonin commented 7 years ago

@ivotron any progress ?

ivotron commented 7 years ago

after adding missing YAML elements, all worked OK. Thanks!