[ovirt-users] ovirt-shell

Juan Hernandez jhernand at redhat.com
Thu Jul 10 14:31:02 UTC 2014


On 07/10/2014 04:07 PM, Steve Kilduff wrote:
> Hi All,
> 
> Trying to add a nic to a vm with a specific mac address.
> 
> [oVirt shell (connected)]# add nic --vm-identifier ov31 --network-name
> backend --name eth4 --mac-address HH:HH:EE:HH:HH:01
> 
>   ======== ERROR =============================
>   status: 400
>   reason: Bad Request
>   detail: MAC address must be in format "HH:HH:HH:HH:HH:HH" where H is a
> hexadecimal character (either a digit or A-F, case is insignificant).
>   =============================================
> 
> 
> Also interesting is when I change the beginning of the mac address to 00
> instead of HH, I get :
> 
> [oVirt shell (connected)]# add nic --vm-identifier ov31 --network-name
> backend --name eth4 --mac-address 01:HH:EE:HH:HH:01
>   ============================================ ERROR
> ==========================================
>                        wrong number of arguments, try 'help add' for help.
>  
> =============================================================================================
> 
> 
> 
> I have tried some things like enclosing in single and double quotes but
> no success.
> 
> I have also tried to read the help sections on the shell interface but I
> also could not figure it out.
> 
> Thanks in advance,
> 

There are two issues here. One is that currently the CLI doesn't work
correctly with parameters that start with a number, as the lexer splits
it into a number and a word, and then it thinks that there are two
parameters instead of one. We have a bug (a RHEV bug, it it affects
oVirt as well) for that already:

  https://bugzilla.redhat.com/show_bug.cgi?id=1110366

You can workaround this using quotes, either simple or double.

The other issue is that you are probably a *multicast* MAC address. That
is what the server is actually checking, not just that it is
syntactically correct. This basically means that the eight bit can't be
1, as that is what indicates multicast. Just make sure that you use a
MAC address whose second character isn't an odd number. For example,
this will fail:

  # add nic --vm-identifier ov31 --network-name backend --name eth4
--mac-address '01:01:01:01:01:01'

But this will succeed:

  # add nic --vm-identifier ov31 --network-name backend --name eth4
--mac-address '00:01:01:01:01:01'

The error message could be better. You may want to open a bug requesting
an improvement.

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Users mailing list