Enable VlanID
This commit is contained in:
parent
b8554dad7d
commit
48b6cc0650
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
type StepConfigureVlan struct {
|
||||
vlanId string
|
||||
VlanID string
|
||||
}
|
||||
|
||||
func (s *StepConfigureVlan) Run(state multistep.StateBag) multistep.StepAction {
|
||||
|
@ -24,10 +24,11 @@ func (s *StepConfigureVlan) Run(state multistep.StateBag) multistep.StepAction {
|
|||
|
||||
ui.Say("Configuring vlan...")
|
||||
|
||||
vlanId := s.vlanId
|
||||
vlanId := s.VlanID
|
||||
|
||||
if vlanId == "" {
|
||||
vlanId = "1724"
|
||||
// If no vlan ID is specified, do not enable Virtual LAN Identification
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
err := driver.SetNetworkAdapterVlanId(switchName, vlanId)
|
||||
|
|
|
@ -87,6 +87,7 @@ type Config struct {
|
|||
|
||||
BootCommand []string `mapstructure:"boot_command"`
|
||||
SwitchName string `mapstructure:"switch_name"`
|
||||
VlandID string `mapstructure:"vlan_id"`
|
||||
Cpu uint `mapstructure:"cpu"`
|
||||
Generation uint `mapstructure:"generation"`
|
||||
EnableMacSpoofing bool `mapstructure:"enable_mac_spoofing"`
|
||||
|
@ -353,6 +354,10 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||
IsoPaths: b.config.SecondaryDvdImages,
|
||||
Generation: b.config.Generation,
|
||||
},
|
||||
|
||||
&hypervcommon.StepConfigureVlan{
|
||||
VlanID: b.config.VlandID,
|
||||
},
|
||||
|
||||
&hypervcommon.StepRun{
|
||||
BootWait: b.config.BootWait,
|
||||
|
|
Loading…
Reference in New Issue