Commit c78995f0 authored by Guido Trotter's avatar Guido Trotter
Browse files

LUCreateInstance: accept mac = VALUE_GENERATE

VALUE_GENERATE is handled exactly the same as VALUE_AUTO and the mac
address is generated randomly.

Forward-port-of: r1886, Reviewed-by: iustinp

Reviewed-by: imsnah
parent 3c8886a9
......@@ -3334,7 +3334,7 @@ class LUCreateInstance(LogicalUnit):
self.check_ip = hostname1.ip
# MAC address verification
if self.op.mac != "auto":
if self.op.mac not in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
if not utils.IsValidMac(self.op.mac.lower()):
raise errors.OpPrereqError("invalid MAC address specified: %s" %
......@@ -3588,7 +3588,7 @@ class LUCreateInstance(LogicalUnit):
instance = self.op.instance_name
pnode_name =
if self.op.mac == "auto":
if self.op.mac in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
mac_address = self.cfg.GenerateMAC()
mac_address = self.op.mac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment