Bug 1272045 - lago fails to initialize workspace - network
Summary: lago fails to initialize workspace - network
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: ovirt-system-tests
Classification: Community
Component: Core
Version: 0.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Yaniv Bronhaim
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-15 10:51 UTC by Anatoly Litovsky
Modified: 2016-09-26 21:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-27 19:38:47 UTC
oVirt Team: ---
Embargoed:
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Anatoly Litovsky 2015-10-15 10:51:15 UTC
Description of problem:
Initializing workspace fails


Steps to Reproduce:
1.
lagocli init /
$PWD/testd-eployment /
/usr/share/ovirtlago/config/virt/centos7.json /
--template-repo-path=$PWD/lago-template-repositories/office.json


Actual results:

2015-10-15 13:43:49,651 - root - DEBUG - Running command: qemu-img create -f qcow2 -b /home/tlitovsk/workspace/ci/lago_var/store/in_office_repo:centos7_host:v5 /home/tlitovsk/workspace/ci/lago_run/test-deployment/images/host0_root.qcow2
2015-10-15 13:43:49,651 - root - DEBUG - Running command: ['qemu-img', 'create', '-f', 'qcow2', '-b', u'/home/tlitovsk/workspace/ci/lago_var/store/in_office_repo:centos7_host:v5', u'/home/tlitovsk/workspace/ci/lago_run/test-deployment/images/host0_root.qcow2']
2015-10-15 13:43:49,750 - root - DEBUG - command exit with 0
2015-10-15 13:43:49,751 - root - DEBUG - command stdout: Formatting '/home/tlitovsk/workspace/ci/lago_run/test-deployment/images/host0_root.qcow2', fmt=qcow2 size=53687091200 backing_file='/home/tlitovsk/workspace/ci/lago_var/store/in_office_repo:centos7_host:v5' encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

2015-10-15 13:43:49,751 - root - INFO - Successfully created disk at /home/tlitovsk/workspace/ci/lago_run/test-deployment/images/host0_root.qcow2
2015-10-15 13:43:49,753 - root - ERROR - Error occured, aborting
Traceback (most recent call last):
  File "/usr/bin/lagocli", line 531, in main
    func(args)
  File "/usr/bin/lagocli", line 78, in do_init
    prefix.virt_conf(virt_conf, repo, store)
  File "/usr/lib/python2.7/site-packages/lago/__init__.py", line 348, in virt_conf
    self._config_net_topology(conf)
  File "/usr/lib/python2.7/site-packages/lago/__init__.py", line 220, in _config_net_topology
    self._allocate_ips_to_nics(conf)
  File "/usr/lib/python2.7/site-packages/lago/__init__.py", line 202, in _allocate_ips_to_nics
    net['gw'],
KeyError: 'gw'


Expected results:
success

Additional info:
version : lago-0.2-153_g948690d.fc22.noarch.rpm

Comment 1 Yaniv Bronhaim 2015-10-22 10:50:30 UTC
we don't always have gw declared in the specific net value. here you use :

    "nets": {
        "lago": {
            "type": "nat",
            "dhcp": {
                "start": 100,
                "end": 254
            },
            "management": true
        }
    }

which does not state the gateway - so we should use default value in 
lago/__init__.py line 202
its part of commit 59411f1
>>.
                vacant = _create_ip(                                            
                    net['gw'],                                                  
                    set(range(2, 255)).difference(                              
                        set(                                                    
                            [                                                   
                                int(ip.split('.')[-1]) for ip in allocated      
                            ]                                                   
                        )                                                       
                    ).pop()                                                     
                )   
<<<

Comment 2 David Caro 2016-01-27 19:38:47 UTC
Moved to https://github.com/lago-project/lago/issues/59


Note You need to log in before you can comment on or make changes to this bug.