Bug 464647

Summary: [RFE] Add the ability to select a MAC address for a virtual job started in condor.
Product: Red Hat Enterprise MRG Reporter: Charlie Wyse <cwyse>
Component: gridAssignee: Benjamin Kreuter <bkreuter>
Status: CLOSED ERRATA QA Contact: Martin Kudlej <mkudlej>
Severity: medium Docs Contact:
Priority: medium    
Version: betaCC: iboverma, jneedle, lans.carstensen, matt, mkudlej
Target Milestone: 1.1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-21 16:18:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Logs, settings and VM job description.
none
output from command: xm dmesg
none
dmesg log from XEN host machine - i386
none
etc directory from XEN image - i386
none
logs from XEN image - i386
none
This should correct the problem none

Description Charlie Wyse 2008-09-29 19:48:52 UTC
Description of problem: Currently you can not give a virtual machine created by condor a mac address.  This is very important for large DHCP shops that do not allow machines with unknown mac addresses on their network.


Version-Release number of selected component (if applicable):


How reproducible:
Every time.

Steps to Reproduce:
1. Create a virtual job.
2. Watch it boot with a random mac address.
3. Wonder how to force a mac address.
  
Actual results:
Random Mac.


Expected results:
The ability to select a mac address.


Additional info:

Comment 1 Benjamin Kreuter 2008-10-21 15:07:10 UTC
The following change has been merged upstream:  You can set the mac address explicitly in the job description file using vm_macaddr = <string>.

Comment 3 Martin Kudlej 2009-02-26 15:58:45 UTC
I tried to test this bug, but I were not able to run Xen vm in condor properly. VM started, but after few seconds it shutdown. Logs, settings and job description are in attachment. I used Xen image from our wiki http://sputnik-prod/pub/local/milan/rhel52-64.img.gz ( http://wiki.brq.redhat.com/XenInstall?highlight=(xen) ). Is there any magic to run Xen VM images in condor? Could you help me with setting it up, please?

Comment 4 Martin Kudlej 2009-02-27 09:00:44 UTC
Created attachment 333446 [details]
Logs, settings and VM job description.

This is the attachment. And I forgot to ask in which version should be fixed this bug?

Comment 5 Benjamin Kreuter 2009-02-28 17:27:33 UTC
Martin --

This code is available in version 7.2, which you appear to be using.

From what I see in the logs you attached, your VM is crashing shortly after it starts up.  Can you run this VM without condor (e.g. virsh create ...)?  Also, could you send the output of "xm dmesg" after the VM crashes?

Thanks.

-- Ben

Comment 6 Martin Kudlej 2009-03-05 10:31:20 UTC
Created attachment 334118 [details]
output from command: xm dmesg

Comment 7 Martin Kudlej 2009-03-05 10:35:19 UTC
VM start with command "xm create -c _name_" works ok. _name_ is description file in /etc/xen as describe howto on wiki ( http://wiki.brq.redhat.com/XenInstall?highlight=(xen) ).
I attached "xm dmesg" output.

Comment 8 Martin Kudlej 2009-03-16 11:04:45 UTC
I finally can run XEN image without crash:)

I add to job description file 
vm_macaddr = 00:16:3E:29:14:8C
and it ended with error:

Submitting job(s)
ERROR: Parse error in expression: 
        JobVM_MACADDR = 00:16:3E:29:14:8C
                          ^^^
Error in submit file


Is this MAC address format correct?
Tested on RHEL5.3 condor 7.2.2-0.8.el5

Comment 9 Matthew Farrellee 2009-03-16 11:31:35 UTC
A quick look at src/condor_submit/submit.cpp suggests you might need to do: vm_macaddr = "00:16:..."

If so, that's a bug.

Comment 10 Martin Kudlej 2009-03-17 10:46:32 UTC
Created attachment 335504 [details]
dmesg log from XEN host machine - i386

Comment 11 Martin Kudlej 2009-03-17 10:47:43 UTC
Created attachment 335505 [details]
etc directory from XEN image - i386

Comment 12 Martin Kudlej 2009-03-17 10:48:25 UTC
Created attachment 335506 [details]
logs from XEN image - i386

Comment 13 Martin Kudlej 2009-03-17 10:53:12 UTC
I tried to set MAC address in format vm_macaddr = "00:16:..." and it didn't work.
There are some logs and setting in comments 10, 11 and 12.
Tested on RHEL 5.3, condor 7.2.2-0.8.el5, arch i386 and x86_64.

-->ASSIGNED

Comment 14 Martin Kudlej 2009-03-17 10:56:50 UTC
I tried to set MAC address in format vm_macaddr = "00:16:..." and it didn't work.
There are some logs and setting in comments 10, 11 and 12.
Tested on RHEL 5.3, condor 7.2.2-0.8.el5, arch i386 and x86_64.

-->ASSIGNED

Comment 15 Martin Kudlej 2009-03-17 11:01:32 UTC
I tried to set MAC address in format vm_macaddr = "00:16:..." and it didn't work.
There are some logs and setting in comments 10, 11 and 12.
Tested on RHEL 5.3, condor 7.2.2-0.8.el5, arch i386 and x86_64.

-->ASSIGNED

Comment 16 Martin Kudlej 2009-03-17 13:12:08 UTC
If I ran it with "xm create" and with this def file, it worked.

name = "rhel5.64"
memory = "200"
disk = [ 'tap:aio:/home/yyy/rhel52.img,xvda1,w', ]
vif = [ 'mac=00:16:3E:34:A1:5A, bridge=xenbr0', ]
bootloader="/usr/bin/pygrub"
vcpus=1
vfb = ["type=vnc,vncunused=1"]

Comment 17 Benjamin Kreuter 2009-03-19 14:04:17 UTC
Created attachment 335855 [details]
This should correct the problem

Comment 18 Martin Kudlej 2009-03-19 15:09:46 UTC
I wait for new package with this patch.

Comment 19 Matthew Farrellee 2009-03-19 16:59:11 UTC
Resolved upstream.

commit baca3df68361244fdfd0b6aceeab2c556944633c
Author: Benjamin Kreuter <bkreuter>
Commit: Matthew Farrellee <matt>

    Fixed vm_macaddr parsing by condor_submit, %s -> "%s"
    
    VERSION HISTORY: Resolved bug where vm_macaddr was improperly parsed, and th
us ignored, by condor_submit for jobs in the VM Universe.

diff --git a/src/condor_submit.V6/submit.cpp b/src/condor_submit.V6/submit.cpp
index 18014bf..c9e583c 100644
--- a/src/condor_submit.V6/submit.cpp
+++ b/src/condor_submit.V6/submit.cpp
@@ -7468,7 +7468,7 @@ SetVMParams()
   tmp_ptr = condor_param(VM_MACAddr, ATTR_JOB_VM_MACADDR);
   if(tmp_ptr)
     {
-      buffer.sprintf("%s = %s", ATTR_JOB_VM_MACADDR, tmp_ptr);
+      buffer.sprintf("%s = \"%s\"", ATTR_JOB_VM_MACADDR, tmp_ptr);
       InsertJobExpr(buffer, false);
     }

Comment 20 Matthew Farrellee 2009-03-25 12:54:45 UTC
Fixed in condor-7.2.2-0.9

Comment 21 Martin Kudlej 2009-04-03 07:09:27 UTC
It tested on condor-7.2.2-0.9  x86_64 rhel5.3.
I still can't submit job with MAC address in format vm_macaddr = "00:16:..."

Output:
[xxx@sun-x4600m2-01 ~]$ cat job1
universe = vm
vm_type = xen
vm_networking = yes
xen_disk = /root/rhel52-32.img:xvda1:w
xen_transfer_files = /root/rhel52-32.img
xen_kernel = included
executable = /bin/sleep
arguments = "100"
vm_memory = 256
vm_cdrom_files = a.txt
vm_should_transfer_cdrom_files = YES
xen_cdrom_device = /dev/xvda2
vm_macaddr = "00:16:3E:29:14:8C"

QUEUE
[xxx@sun-x4600m2-01 ~]$ condor_submit job1 
Submitting job(s)
ERROR: Parse error in expression: 
        JobVM_MACADDR = ""00:16:3E:29:14:8C""
                          ^^^
Error in submit file

If I change MAC address format to vm_macaddr = 00:16:3E:29:14:8C, it submits job, but it doesn't change MAC address of the running VM machine.

Comment 22 Martin Kudlej 2009-04-03 08:09:22 UTC
The same behavior is on condor-7.2.2-0.9  i386 rhel5.3.

Comment 23 Benjamin Kreuter 2009-04-06 21:43:17 UTC
In your condor_config (/etc/condor/condor_config), is VM_NETWORKING_TYPE set to "bridge" or "nat" ?  The MAC address patch only applies when VM_NETWORKING_TYPE is set to "bridge" -- I just tested this on a RHEL-5.3 system with condor-7.2.2-0.9 and it is working and sets the correct MAC address.

Comment 24 Martin Kudlej 2009-04-07 12:39:52 UTC
So it works with "bridge" but vm_macaddr must be in format 00:1A:4B:F4:20:AD without quotation marks. Is this correct? Or must it be in string format with quotation marks? If this is correct behaviour then I'll change status to VERIFIED.

Comment 25 Benjamin Kreuter 2009-04-07 13:18:19 UTC
That is correct; bridge networking with the MAC address specified without quotations is the correct behavior.

Comment 26 Martin Kudlej 2009-04-07 14:37:41 UTC
-->VERIFIED

Comment 28 errata-xmlrpc 2009-04-21 16:18:35 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0434.html