mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
feature: add global mac prefix option
This commit is contained in:
@@ -212,7 +212,7 @@ func (manager *SGuestnetworkManager) GenerateMac(netId string, suggestion string
|
||||
log.Errorf("generate random mac failed: %s", err)
|
||||
continue
|
||||
}
|
||||
mac = fmt.Sprintf("00:22:%02x:%02x:%02x:%02x", b[0], b[1], b[2], b[3])
|
||||
mac = fmt.Sprintf("%s:%02x:%02x:%02x:%02x", options.Options.GlobalMacPrefix, b[0], b[1], b[2], b[3])
|
||||
}
|
||||
q := manager.Query().Equals("mac_addr", mac)
|
||||
if len(netId) > 0 {
|
||||
|
||||
@@ -175,6 +175,8 @@ type ComputeOptions struct {
|
||||
|
||||
ProhibitRefreshingCloudImage bool `help:"Prohibit refreshing cloud image"`
|
||||
|
||||
GlobalMacPrefix string `help:"Global prefix of MAC address, default to 00:22" default:"00:22"`
|
||||
|
||||
esxi.EsxiOptions
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user