[ovirt-users] [ovirt-devel] Feature Page: Mac Pool per DC

Martin Mucha mmucha at redhat.com
Tue Apr 22 08:04:31 UTC 2014


Hi,

I like to answer questions. Presence of questions in "motivated environment" means that there is flaw in documentation/study material, which needs to be fixed :)

To answer your question. 
You got pool you want to use -- either global one (explicitly using method org.ovirt.engine.core.bll.network.macPoolManager.ScopedMacPoolManager#defaultScope()) or related to some scope, which you identify somehow -- like in previous mail: "give me pool for this data center". When you have this pool, you can allocate *some* new mac (system decides which one it will be) or you can allocate *explicit* one, use MAC address you've specified. I think that the latter is what you've meant by "assigning by hand". There is just performance difference between these two allocation. Once the pool, which has to be used, is identified, everything which comes after it happens on *this* pool.

Example(I'm using naming from code here, storagePool is a db table for data center):
ScopedMacPoolManager.scopeFor().storagePool(storagePoolId).getPool().addMac("00:1a:4a:15:c0:fe");

Lets discuss parts from this command:

ScopedMacPoolManager.scopeFor() // means "I want scope ..."
ScopedMacPoolManager.scopeFor().storagePool(storagePoolId)   //... which is related to storagePool and identified by storagePoolID
ScopedMacPoolManager.scopeFor().storagePool(storagePoolId).getPool()    //... and I want existing pool for this scope
ScopedMacPoolManager.scopeFor().storagePool(storagePoolId).getPool().addMac("00:1a:4a:15:c0:fe")   //... and I want to add this mac address to it.

So in short, whatever you do with pool you get anyhow, happens on this pool only. You do not have code-control on what pool you get, like if system is configured to use single pool only, then request for datacenter-related pool still return that sole one, but once you have that pool, everything happen on this pool, and, unless datacenter configuration is altered, same request in future for pool should return same pool.

Now small spoiler(It's not merged to production branch yet) -- performance difference between allocating user provided MAC and MAC from mac pool range: You should try to avoid to allocate MAC which is outside of ranges of configured mac pool(either global or scoped one). It's perfectly OK, to allocate specific MAC address from inside these ranges, actually is little bit more efficient than letting system pick one for you. But if you use one from outside of those ranges, your allocated MAC end up in less memory efficient storage(approx 100 times less efficient). So if you want to use user-specified MACs, you can, but tell system from which range those MACs will be(via mac pool configuration).

M.

----- Original Message -----
From: "Sven Kieske" <S.Kieske at mittwald.de>
To: "Martin Mucha" <mmucha at redhat.com>, "Itamar Heim" <iheim at redhat.com>
Cc: users at ovirt.org, devel at ovirt.org
Sent: Tuesday, April 22, 2014 8:31:31 AM
Subject: Re: [ovirt-devel] [ovirt-users] Feature Page: Mac Pool per DC

Hi,

thanks for the very detailed answers.

So here is another question:

How are MACs handled which got assigned "by hand"?
Do they also get registered with a global or with
the datacenter pool?
Are they tracked anyway?
I'm currently assigning macs via API directly
to the vms and do not let ovirt decide itself
which mac goes where.

Am 18.04.2014 12:17, schrieb Martin Mucha:
> Hi, 
> 
> I'll try to describe it little bit more. Lets say, that we've got one data center. It's not configured yet to have its own mac pool. So in system is only one, global pool. We create few VMs and it's NICs will obtain its MAC from this global pool, marking them as used. Next we alter data center definition, so now it uses it's own mac pool. In system from this point on exists two mac pools, one global and one related to this data center, but those allocated MACs are still allocated in global pool, since new data center creation does not (yet) contain logic to get all assigned MACs related to this data center and reassign them in new pool. However, after app restart all VmNics are read from db and placed to appropriate pools. Lets assume, that we've performed such restart. Now we realized, that we actually don't want that data center have own mac pool, so we alter it's definition removing mac pool ranges. Pool related to this data center will be removed and it's content will be 
>  moved to a scope above this data center -- into global scope pool. We know, that everything what's allocated in pool to be removed is still used, but we need to track it elsewhere and currently there's just one option, global pool. So to answer your last question. When I remove scope, it's pool is gone and its content moved elsewhere. Next, when MAC is returned to the pool, the request goes like: "give me pool for this virtual machine, and whatever pool it is, I'm returning this MAC to it." Clients of ScopedMacPoolManager do not know which pool they're talking to. Decision, which pool is right for them, is done behind the scenes upon their identification (I want pool for this logical network).
> 
> Notice, that there is one "problem" in deciding which scope/pool to use. There are places in code, which requires pool related to given data center, identified by guid. For that request, only data center scope or something broader like global scope can be returned. So even if one want to use one pool per logical network, requests identified by data center id still can return only data center scope or broader, and there are no chance returning pool related to logical network (except for situation, where there is sole logical network in that data center).
> 
> Thanks for suggestion for another scopes. One question: if we're implementing them, would you like just to pick a *sole* non-global scope you want to use in your system (like data center related pools ONLY plus one global, or logical network related pools ONLY plus one global) or would it be (more) beneficial to you to have implemented some sort of cascading and overriding? Like: "this data center uses *this* pool, BUT except for *this* logical network, which should use *this* one instead."
> 
> I'll update feature page to contain these paragraphs.
> 
> M.
> 
> 
> ----- Original Message -----
> From: "Itamar Heim" <iheim at redhat.com>
> To: "Martin Mucha" <mmucha at redhat.com>, users at ovirt.org, devel at ovirt.org
> Sent: Thursday, April 10, 2014 9:04:37 AM
> Subject: Re: [ovirt-users] Feature Page: Mac Pool per DC (was: new feature)
> 
> On 04/10/2014 09:59 AM, Martin Mucha wrote:
>> Hi,
>>
>> I'd like to notify you about new feature, which allows to specify distinct MAC pools, currently one per data center.
>> http://www.ovirt.org/Scoped_MacPoolManager
>>
>> any comments/proposals for improvement are very welcomed.
>> Martin.
> 
> 
> (changed title to reflect content)
> 
>> When specified mac ranges for given "scope", where there wasn't any definition previously, allocated MAC from default pool will not be moved to "scoped" one until next engine restart. Other way, when removing "scoped" mac pool definition, all MACs from this pool will be moved to default one.
> 
> cna you please elaborate on this one?
> 
> as for potential other "scopes" - i can think of cluster, vm pool and 
> logical network as potential ones.
> 
> one more question - how do you know to "return" the mac address to the 
> correct pool on delete?


-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen



More information about the Users mailing list