[azure] deallocate instead of just power-off
1. allegedly prevents error where fails because VM still appears running 2. prevents left-behind VM's after failures from accumulating charges
This commit is contained in:
parent
d344675660
commit
e189db97d4
|
@ -28,7 +28,7 @@ func NewStepPowerOffCompute(client *AzureClient, ui packer.Ui) *StepPowerOffComp
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StepPowerOffCompute) powerOffCompute(ctx context.Context, resourceGroupName string, computeName string) error {
|
func (s *StepPowerOffCompute) powerOffCompute(ctx context.Context, resourceGroupName string, computeName string) error {
|
||||||
f, err := s.client.VirtualMachinesClient.PowerOff(ctx, resourceGroupName, computeName)
|
f, err := s.client.VirtualMachinesClient.Deallocate(ctx, resourceGroupName, computeName)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = f.WaitForCompletion(ctx, s.client.VirtualMachinesClient.Client)
|
err = f.WaitForCompletion(ctx, s.client.VirtualMachinesClient.Client)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue