Red Hat Bugzilla – Bug 464647
[RFE] Add the ability to select a MAC address for a virtual job started in condor.
Last modified: 2009-05-08 12:20:22 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):
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.
The ability to select a mac address.
The following change has been merged upstream: You can set the mac address explicitly in the job description file using vm_macaddr = <string>.
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?
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?
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?
Created attachment 334118 [details]
output from command: xm dmesg
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.
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:
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
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.
Created attachment 335504 [details]
dmesg log from XEN host machine - i386
Created attachment 335505 [details]
etc directory from XEN image - i386
Created attachment 335506 [details]
logs from XEN image - i386
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.
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', ]
vfb = ["type=vnc,vncunused=1"]
Created attachment 335855 [details]
This should correct the problem
I wait for new package with this patch.
Author: Benjamin Kreuter <email@example.com>
Commit: Matthew Farrellee <firstname.lastname@example.org>
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
@@ -7468,7 +7468,7 @@ SetVMParams()
tmp_ptr = condor_param(VM_MACAddr, ATTR_JOB_VM_MACADDR);
- buffer.sprintf("%s = %s", ATTR_JOB_VM_MACADDR, tmp_ptr);
+ buffer.sprintf("%s = \"%s\"", ATTR_JOB_VM_MACADDR, tmp_ptr);
Fixed in condor-7.2.2-0.9
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:..."
[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"
[xxx@sun-x4600m2-01 ~]$ condor_submit job1
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.
The same behavior is on condor-7.2.2-0.9 i386 rhel5.3.
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.
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.
That is correct; bridge networking with the MAC address specified without quotations is the correct behavior.
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.