This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 887283 - RECIPE_MEMBERS have bad value for VM multihost recipeset
RECIPE_MEMBERS have bad value for VM multihost recipeset
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: beah (Show other bugs)
0.10
Unspecified Unspecified
high Severity urgent (vote)
: 0.12
: ---
Assigned To: Dan Callaghan
Raymond Mancy
MultiHost
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-14 09:38 EST by Tomas Rusnak
Modified: 2014-12-07 20:14 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-11 00:55:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
submit xml (4.62 KB, text/xml)
2012-12-14 09:38 EST, Tomas Rusnak
no flags Details

  None (edit)
Description Tomas Rusnak 2012-12-14 09:38:18 EST
Created attachment 663627 [details]
submit xml

Description of problem
The RECIPE_MEMBERS variable should contain all hostnames from particular recipeset. In my case, I requested 3 VMs on one host (physical system):

host: 
machine1.example.com

guests:
testvm1.example.com
testvm2.example.com
testvm3.example.com


How reproducible:
100%

Steps to Reproduce:
1. submit file from attachment
2. open one of /var/beah/*.env file 
3. search for RECIPE_MEMBERS variable
  
Actual results:
RECIPE_MEMBERS="None machine1.example.com"

Expected results:
RECIPE_MEMBERS="machine1.example.com testvm1.example.com testvm2.example.com testvm3.example.com"
Comment 1 Dan Callaghan 2012-12-16 22:25:11 EST
I assume you are talking about on the host here -- role env vars and RECIPE_MEMBERS should always be set correctly on the guests. On the host you will get None for the guest FQDNs. That's because Beaker doesn't actually know them in advance.

This changed in Beaker 0.10 for bug 655009. Previously Beaker did know the FQDNs in advance, and they were set in RECIPE_MEMBERS and the role env vars. The problem was if the host was on a different VLAN than the allocated guest address it would fail. That was the original point of bug 655009. So Beaker no longer allocates the guest addresses in advance.
Comment 2 Dan Callaghan 2012-12-16 22:40:59 EST
The host can fetch the guest FQDNs from Beaker, but the API is not very nice and it doesn't go through beaker-proxy, so consider this a temporary workaround only. Python script pasted below. Bear in mind this only works once the guests have finished installing and have checked in to the Beaker server -- before that, Beaker doesn't know what their FQDNs will be.

Ultimately we need some new multi-host synchronisation mechanisms for guest recipes, which will allow the host to find its guests and vice versa.

----

#!/usr/bin/python
import os
import xmlrpclib
import xml.dom.minidom

s = xmlrpclib.ServerProxy('%sRPC2' % os.environ['BEAKER'])
recipe_xml = s.recipes.to_xml(os.environ['RECIPEID'])
doc = xml.dom.minidom.parseString(recipe_xml)

guests = []
for recipe in doc.getElementsByTagName('recipe'):
    if recipe.getAttribute('id') == os.environ['RECIPEID']:
        for guestrecipe in doc.getElementsByTagName('guestrecipe'):
            guests.append(guestrecipe.getAttribute('system'))
print ' '.join(guests)
Comment 3 Dan Callaghan 2013-03-25 02:38:31 EDT
On Gerrit:
http://gerrit.beaker-project.org/1823
http://gerrit.beaker-project.org/1824

With these patches, beah will reload roles at the start of every task. So the RECIPE_MEMBERS and role env vars on the host will contain the guest FQDNs, but only for tasks which are started *after* the guests have been installed (so after /distribution/virt/install).
Comment 5 Tomas Rusnak 2013-03-25 05:06:36 EDT
To have updated environment only for a task started after virt/install should be enough for our purpose. Typically for a task runned on Host system in sync with others runned on Guests systems.
Comment 8 Dan Callaghan 2013-04-11 00:55:54 EDT
Beaker 0.12 has been released.

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