Skip to content

Commit 29ca1bd

Browse files
guillaumerosepraveenkumar
authored andcommitted
drivers: don't start the VM when creating it
Drivers were changed to not start the VM when calling Create(). crc has to do it now. crc can now better control what happens at creation time.
1 parent b5ae93f commit 29ca1bd

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

pkg/crc/machine/hyperkit/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "fmt"
66

77
const (
88
MachineDriverCommand = "crc-driver-hyperkit"
9-
MachineDriverVersion = "0.12.11"
9+
MachineDriverVersion = "0.12.14"
1010
HyperKitCommand = "hyperkit"
1111
HyperKitVersion = "v0.20200224-44-gb54460"
1212
)

pkg/crc/machine/libvirt/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const (
1616

1717
const (
1818
MachineDriverCommand = "crc-driver-libvirt"
19-
MachineDriverVersion = "0.12.14"
19+
MachineDriverVersion = "0.12.15"
2020
)
2121

2222
var (

pkg/drivers/hyperv/hyperv.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ func (d *Driver) Create() error {
203203
return err
204204
}
205205

206-
log.Debugf("Starting VM...")
207-
return d.Start()
206+
return nil
208207
}
209208

210209
func (d *Driver) chooseVirtualSwitch() (string, error) {

pkg/libmachine/libmachine.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ func (api *Client) performCreate(ctx context.Context, h *host.Host) error {
117117
return fmt.Errorf("Error in driver during machine creation: %s", err)
118118
}
119119

120+
if err := h.Driver.Start(); err != nil {
121+
return fmt.Errorf("Error in driver during machine start: %s", err)
122+
}
123+
120124
if err := api.Save(h); err != nil {
121125
return fmt.Errorf("Error saving host to store after attempting creation: %s", err)
122126
}

0 commit comments

Comments
 (0)