elasticluster / elasticluster

Create clusters of VMs on the cloud and configure them with Ansible.
http://elasticluster.readthedocs.io/
GNU General Public License v3.0
335 stars 150 forks source link

Check for network information in config #482

Open verdurin opened 7 years ago

verdurin commented 7 years ago

If I try to start a cluster without network information, elasticluster should complain before even trying to build the cluster. As it is, it will try and then gives a rather obscure error message:

gc3.elasticluster[3822] ERROR Could not start node `compute001`: Bad network format: missing 'uuid' (HTTP 40
0) (Request-ID: req-47443c25-1b94-483b-908d-21f5f0280ae0) -- <class 'novaclient.exceptions.BadRequest'>
Traceback (most recent call last):
  File "/home/centos/adam/elasticluster/src/elasticluster/cluster.py", line 493, in _start_node
    node.start()
  File "/home/centos/adam/elasticluster/src/elasticluster/cluster.py", line 1086, in start
    **self.extra)
  File "/home/centos/adam/elasticluster/src/elasticluster/providers/openstack.py", line 473, in start_instance
    vm = self.nova_client.servers.create(node_name, image_id, flavor, **vm_start_args)
  File "/home/centos/adam/elasticluster/lib/python2.7/site-packages/novaclient/v2/servers.py", line 1403, in create
    **boot_kwargs)
  File "/home/centos/adam/elasticluster/lib/python2.7/site-packages/novaclient/v2/servers.py", line 802, in _boot
    return_raw=return_raw, **kwargs)
  File "/home/centos/adam/elasticluster/lib/python2.7/site-packages/novaclient/base.py", line 361, in _create
    resp, body = self.api.client.post(url, body=body)
  File "/home/centos/adam/elasticluster/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 294, in post
    return self.request(url, 'POST', **kwargs)
  File "/home/centos/adam/elasticluster/lib/python2.7/site-packages/novaclient/client.py", line 83, in request
    raise exceptions.from_response(resp, body, url, method)
BadRequest: Bad network format: missing 'uuid' (HTTP 400) (Request-ID: req-47443c25-1b94-483b-908d-21f5f0280ae0)
riccardomurri commented 7 years ago

The error really comes from OpenStack and bubbles through layers until it hits ElastiCluster.

What's not clear to me is whether it is now always required in OpenStack to specify a network in order to start a VM, or if it's an installation option (i.e., depends on the OpenStack sysadmins -- some may still configure with a default network for all VMs).

In the first case, I agree that network_ids should be made mandatory.