drivers/hyperv/hyperv.go
func (d *Driver) PreCreateCheck() error {
	// Check that powershell was found
	if powershell == "" {
		return ErrPowerShellNotFound
	}

	// Check that hyperv is installed
	if err := hypervAvailable(); err != nil {
		return err
	}

	// Check that the user is an Administrator
	isAdmin, err := isAdministrator()
	if err != nil {
		return err
	}
	if !isAdmin {
		return ErrNotAdministrator
	}

	// Check that there is a virtual switch already configured
	if _, err := d.chooseVirtualSwitch(); err != nil {
		return err
	}

	// Downloading boot2docker to cache should be done here to make sure
	// that a download failure will not leave a machine half created.
	b2dutils := mcnutils.NewB2dUtils(d.StorePath)
	err = b2dutils.UpdateISOCache(d.Boot2DockerURL)
	return err
}
func (d *Driver) PreCreateCheck() error {
	// Check that powershell was found
	if powershell == "" {
		return ErrPowerShellNotFound
	}

	// Check that hyperv is installed
	if err := hypervAvailable(); err != nil {
		return err
	}

	// Check that the user is an Administrator
	isAdmin, err := isAdministrator()
	if err != nil {
		return err
	}
	if !isAdmin {
		return ErrNotAdministrator
	}

	// Check that there is a virtual switch already configured
	if _, err := d.chooseVirtualSwitch(); err != nil {
		return err
	}

	// Downloading boot2docker to cache should be done here to make sure
	// that a download failure will not leave a machine half created.
	b2dutils := mcnutils.NewB2dUtils(d.StorePath)
	err = b2dutils.UpdateISOCache(d.Boot2DockerURL)
	return err
}
func ( d * Driver ) PreCreateCheck ( ) error { // Check that powershell was found if powershell == " " { return ErrPowerShellNotFound } // Check that hyperv is installed if err := hypervAvailable ( ) ; err != nil { return err } // Check that the user is an Administrator isAdmin , err := isAdministrator ( ) if err != nil { return err } if ! isAdmin { return ErrNotAdministrator } // Check that there is a virtual switch already configured if _ , err := d . chooseVirtualSwitch ( ) ; err != nil { return err } // Downloading boot2docker to cache should be done here to make sure // that a download failure will not leave a machine half created. b2dutils := mcnutils . NewB2dUtils ( d . StorePath ) err = b2dutils . UpdateISOCache ( d . Boot2DockerURL ) return err }
// PreCreateCheck checks that the machine creation process can be started safely.
PreCreateCheck checks that the machine creation process can be started safely .