packer-plugin-xenserver/builder/xenserver/step_start_vm_paused.go

29 lines
609 B
Go
Raw Normal View History

package xenserver
import (
2014-12-08 09:34:48 -06:00
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
)
2014-12-08 09:34:48 -06:00
type stepStartVmPaused struct{}
func (self *stepStartVmPaused) Run(state multistep.StateBag) multistep.StepAction {
2014-12-08 09:34:48 -06:00
client := state.Get("client").(XenAPIClient)
ui := state.Get("ui").(packer.Ui)
2014-12-08 09:34:48 -06:00
ui.Say("Step: Start VM Paused")
2014-12-08 09:34:48 -06:00
instance, _ := client.GetVMByUuid(state.Get("instance_uuid").(string))
2014-12-08 09:34:48 -06:00
instance.Start(true, false)
2014-12-08 09:34:48 -06:00
domid, _ := instance.GetDomainId()
state.Put("domid", domid)
2014-12-08 09:34:48 -06:00
return multistep.ActionContinue
}
func (self *stepStartVmPaused) Cleanup(state multistep.StateBag) {
}