packer-plugin-xenserver/builder/xenserver/step_start_vm_paused.go
Rob Dobson 4d634aaf70 Initial plugin for building XenServer images using Packer.IO
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-10 18:16:02 +00:00

31 lines
643 B
Go

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