Revision b3c728dc
b/lib/cmdlib.py | ||
---|---|---|
9540 | 9540 |
osname, node) |
9541 | 9541 |
|
9542 | 9542 |
|
9543 |
def _CreateInstanceAllocRequest(op, disks, nics, beparams): |
|
9543 |
def _CreateInstanceAllocRequest(op, disks, nics, beparams, node_whitelist):
|
|
9544 | 9544 |
"""Wrapper around IAReqInstanceAlloc. |
9545 | 9545 |
|
9546 | 9546 |
@param op: The instance opcode |
9547 | 9547 |
@param disks: The computed disks |
9548 | 9548 |
@param nics: The computed nics |
9549 | 9549 |
@param beparams: The full filled beparams |
9550 |
@param node_whitelist: List of nodes which should appear as online to the |
|
9551 |
allocator (unless the node is already marked offline) |
|
9550 | 9552 |
|
9551 | 9553 |
@returns: A filled L{iallocator.IAReqInstanceAlloc} |
9552 | 9554 |
|
... | ... | |
9561 | 9563 |
spindle_use=spindle_use, |
9562 | 9564 |
disks=disks, |
9563 | 9565 |
nics=[n.ToDict() for n in nics], |
9564 |
hypervisor=op.hypervisor) |
|
9566 |
hypervisor=op.hypervisor, |
|
9567 |
node_whitelist=node_whitelist) |
|
9565 | 9568 |
|
9566 | 9569 |
|
9567 | 9570 |
def _ComputeNics(op, cluster, default_ip, cfg, ec_id): |
... | ... | |
9937 | 9940 |
#TODO Export network to iallocator so that it chooses a pnode |
9938 | 9941 |
# in a nodegroup that has the desired network connected to |
9939 | 9942 |
req = _CreateInstanceAllocRequest(self.op, self.disks, |
9940 |
self.nics, self.be_full) |
|
9943 |
self.nics, self.be_full, |
|
9944 |
None) |
|
9941 | 9945 |
ial = iallocator.IAllocator(self.cfg, self.rpc, req) |
9942 | 9946 |
|
9943 | 9947 |
ial.Run(self.op.iallocator) |
... | ... | |
10845 | 10849 |
insts = [_CreateInstanceAllocRequest(op, _ComputeDisks(op, default_vg), |
10846 | 10850 |
_ComputeNics(op, cluster, None, |
10847 | 10851 |
self.cfg, ec_id), |
10848 |
_ComputeFullBeParams(op, cluster)) |
|
10852 |
_ComputeFullBeParams(op, cluster), |
|
10853 |
None) |
|
10849 | 10854 |
for op in self.op.instances] |
10850 | 10855 |
|
10851 | 10856 |
req = iallocator.IAReqMultiInstanceAlloc(instances=insts) |
Also available in: Unified diff