Bug 464647 - [RFE] Add the ability to select a MAC address for a virtual job started in condor.
[RFE] Add the ability to select a MAC address for a virtual job started in co...
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: grid (Show other bugs)
beta
All Linux
medium Severity medium
: 1.1.1
: ---
Assigned To: Benjamin Kreuter
Martin Kudlej
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-29 15:48 EDT by Charlie Wyse
Modified: 2009-05-08 12:20 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-21 12:18:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Logs, settings and VM job description. (61.56 KB, application/x-gzip)
2009-02-27 04:00 EST, Martin Kudlej
no flags Details
output from command: xm dmesg (8.52 KB, text/plain)
2009-03-05 05:31 EST, Martin Kudlej
no flags Details
dmesg log from XEN host machine - i386 (5.86 KB, application/x-gzip)
2009-03-17 06:46 EDT, Martin Kudlej
no flags Details
etc directory from XEN image - i386 (2.41 MB, application/x-gzip)
2009-03-17 06:47 EDT, Martin Kudlej
no flags Details
logs from XEN image - i386 (51.23 KB, application/x-gzip)
2009-03-17 06:48 EDT, Martin Kudlej
no flags Details
This should correct the problem (474 bytes, patch)
2009-03-19 10:04 EDT, Benjamin Kreuter
no flags Details | Diff

  None (edit)
Description Charlie Wyse 2008-09-29 15:48:52 EDT
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 11:07:10 EDT
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 10:58:45 EST
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 04:00:44 EST
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 12:27:33 EST
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 05:31:20 EST
Created attachment 334118 [details]
output from command: xm dmesg
Comment 7 Martin Kudlej 2009-03-05 05:35:19 EST
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 07:04:45 EDT
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 07:31:35 EDT
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 06:46:32 EDT
Created attachment 335504 [details]
dmesg log from XEN host machine - i386
Comment 11 Martin Kudlej 2009-03-17 06:47:43 EDT
Created attachment 335505 [details]
etc directory from XEN image - i386
Comment 12 Martin Kudlej 2009-03-17 06:48:25 EDT
Created attachment 335506 [details]
logs from XEN image - i386
Comment 13 Martin Kudlej 2009-03-17 06:53:12 EDT
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 06:56:50 EDT
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 07:01:32 EDT
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 09:12:08 EDT
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 10:04:17 EDT
Created attachment 335855 [details]
This should correct the problem
Comment 18 Martin Kudlej 2009-03-19 11:09:46 EDT
I wait for new package with this patch.
Comment 19 Matthew Farrellee 2009-03-19 12:59:11 EDT
Resolved upstream.

commit baca3df68361244fdfd0b6aceeab2c556944633c
Author: Benjamin Kreuter <bkreuter@redhat.com>
Commit: Matthew Farrellee <matt@redhat.com>

    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 08:54:45 EDT
Fixed in condor-7.2.2-0.9
Comment 21 Martin Kudlej 2009-04-03 03:09:27 EDT
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 04:09:22 EDT
The same behavior is on condor-7.2.2-0.9  i386 rhel5.3.
Comment 23 Benjamin Kreuter 2009-04-06 17:43:17 EDT
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 08:39:52 EDT
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 09:18:19 EDT
That is correct; bridge networking with the MAC address specified without quotations is the correct behavior.
Comment 26 Martin Kudlej 2009-04-07 10:37:41 EDT
-->VERIFIED
Comment 28 errata-xmlrpc 2009-04-21 12:18:35 EDT
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

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