Commit Graph

118 Commits

Author SHA1 Message Date
Jean-Laurent de Morlhon b6ca1035bd Fix for #1737 - Better detect non default VirtualBox Installation Path
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-11-10 09:52:38 +01:00
Todor Minchev 36ca9c6063 Fix DHCP server and host-only adapter IP address clash
When setting up a host-only network we need to pass the IP address
of the host adapter (e.g 192.168.99.1) to the getRandomIPinSubnet function.
Passing the network address (e.g 192.168.1.0) can result in bypassing the IP
clash check and having the same address assigned to both the DHCP server
and the host-only network interface.

Signed-off-by: Todor Minchev <todor.minchev@linux.intel.com>
2015-11-03 11:26:31 -08:00
David Gageot 0176f05db8 FIX #2127 Detect that HW virtualization is not supported
Signed-off-by: David Gageot <david@gageot.net>
2015-10-30 16:19:38 +01:00
David Gageot 970c630fd3 FIX #2093 warn in case we think VT-X is not enabled.
Signed-off-by: David Gageot <david@gageot.net>
2015-10-28 22:22:04 +01:00
Fabian Ruff 5021ffd2e7 support github enterprise urls for b2d downloads
This commit allows downloading boot2docker releases not only from the official releases url (https://api.github.com/repos/boot2docker/boot2docker/releases) but from arbitrary github repositories that publish releases with a boot2docker.iso artifact. It also supports downloading from github enterprise.

Signed-off-by: Fabian Ruff <fabian@progra.de>
2015-10-22 16:12:21 +02:00
Chris Abernethy 6a7c8c2a25 Additional validation on virtualbox-hostonly-cidr
Check that the CIDR provided for a virtualbox host only CIDR is specified as a host IP and netmask, e.g., 192.168.100.1/24, and not a network IP and netmask, e.g., 192.168.100.0/24. This will help prevent confusion like #1383

Signed-off-by: Chris Abernethy <cabernet@chrisabernethy.com>

Signed-off-by: David Gageot <david@gageot.net>
2015-10-21 20:46:13 +02:00
Dave Henderson e2856e36f4 Adding support for darwin to IsVTXDisabled
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-20 21:20:40 -04:00
David Gageot 94361315a8 Add tests to virtualbox driver
Signed-off-by: David Gageot <david@gageot.net>
2015-10-20 19:08:18 +02:00
David Gageot 4a33fabe8b Check that VT-X/AMD-v is enabled
Signed-off-by: David Gageot <david@gageot.net>
2015-10-20 09:56:43 +02:00
Dave Henderson 2a6e3dbf40 Fix log.* method calls which meant to be log.*f
Stuff like `log.Debug("foo bar: %s", baz)` really wants to be
`log.Debugf("foo bar: %s", baz)`...

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-17 15:59:25 -04:00
Nathan LeClaire c8edb33ecd Move towards using external binaries / RPC plugins
- First RPC steps

- Work on some flaws in RPC model

- Remove unused TLS settings from Engine and Swarm options

- Add code to correctly encode data over the network

- Add client driver for RPC

- Rename server driver file

- Start to make marshal make sense

- Fix silly RPC method args and add client

- Fix some issues with RPC calls, and marshaling

- Simplify plugin main.go

- Move towards 100% plugin in CLI

- Ensure that plugin servers are cleaned up properly

- Make flag parsing for driver flags work properly

Includes some work carried from @dmp42 updating the build process and
tests to use the new method.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-16 16:34:56 -07:00
Nathan LeClaire f0ebeab041 Move VBox detection to Precreate and print version
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-07 20:41:26 -07:00
Nathan LeClaire 9453df4859 Fix Docker daemon wait
Also, a few various cleanups are bundled:

1. Only call GetDriver() once to get the object in provision/utils.go
2. SSH command wrapper will return the error and let the consumer decide
   what to do with it instead of bailing automatically on non-255

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 15:19:25 -07:00
Nathan LeClaire b5927f10c4 Make libmachine usable by outside world
- Clear out some cruft tightly coupling libmachine to filestore

- Comment out drivers other than virtualbox for now

- Change way too many things

- Mostly, break out the code to be more modular.

- Destroy all traces of "provider" in its current form.  It will be
brought back as something more sensible, instead of something which
overlaps in function with both Host and Store.

- Fix mis-managed config passthru

- Remove a few instances of state stored in env vars

- This should be explicitly communicated in Go-land, not through the
shell.

- Rename "store" module to "persist"

- This is done mostly to avoid confusion about the fact that a concrete
instance of a "Store" interface is oftentimes referred to as "store" in
the code.

- Rip out repetitive antipattern for getting store

- This replaces the previous repetive idiom for getting the cert info, and
consequently the store, with a much less repetitive idiom.

- Also, some redundant methods in commands.go for accessing hosts have
either been simplified or removed entirely.

- First steps towards fixing up tests

- Test progress continues

- Replace unit tests with integration tests

- MAKE ALL UNIT TESTS PASS YAY

- Add helper test files

- Don't write to disk in libmachine/host

- Heh.. coverage check strikes again

- Fix remove code

- Move cert code around

- Continued progress: simplify Driver

- Fixups and make creation work with new model

- Move drivers module inside of libmachine

- Move ssh module inside of libmachine

- Move state module to libmachine

- Move utils module to libmachine

- Move version module to libmachine

- Move log module to libmachine

- Modify some constructor methods around

- Change Travis build dep structure

- Boring gofmt fix

- Add version module

- Move NewHost to store

- Update some boring cert path infos to make API easier to use

- Fix up some issues around the new model

- Clean up some cert path stuff

- Don't use shady functions to get store path :D

- Continue artifact work

- Fix silly machines dir bug

- Continue fixing silly path issues

- Change up output of vbm a bit

- Continue work to make example go

- Change output a little more

- Last changes needed to make create finish properly

- Fix config.go to use libmachine

- Cut down code duplication and make both methods work with libmachine

- Add pluggable logging implementation

- Return error when machine already in desired state

- Update example to show log method

- Fix file:// bug

- Fix Swarm defaults

- Remove unused TLS settings from Engine and Swarm options

- Remove spurious error

- Correct bug detecting if migration was performed

- Fix compilation errors from tests

- Fix most of remaining test issues

- Fix final silly bug in tests

- Remove extraneous debug code

- Add -race to test command

- Appease the gofmt

- Appease the generate coverage

- Making executive decision to remove Travis coverage check

In the early days I thought this would be a good idea because it would
encourage people to write tests in case they added a new module.  Well,
in fact it has just turned into a giant nuisance and made refactoring
work like this even more difficult.

- Move Get to Load
- Move HostListItem code to CLI

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 12:30:15 -07:00
Evan Hazlett 3c712ae30a
change debug env var to MACHINE_DEBUG
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-09-05 08:57:03 -04:00
Evan Hazlett b8f7c3446b Merge pull request #1674 from csakoda/fix-VBox-getRandomIPinSubnet
Fix VirtualBox DHCPServer always uses x.x.x.1, despite getRandomIPinSubnet()
2015-08-28 18:29:01 -04:00
Palanivelrajan Balasubramanian 5f362aca6b added support for configuring nictype and nicpromise mode in virtualbox
Signed-off-by: Palanivelrajan Balasubramanian <praveen12bnitt@gmail.com>
2015-08-19 16:49:42 -04:00
Chuck Sakoda c2c942411b Assign the last octet of random subnet IP to a random value, instead of always 1
Signed-off-by: Chuck Sakoda <cms235@gmail.com>
2015-08-12 13:20:58 -07:00
David McKay 07e7604f0e * Added option to disable virtualbox vbfs user home directory mount
* Updated documentation with new option
* Updated flag name

Signed-off-by: David McKay <david@rawkode.com>
2015-08-12 20:37:06 +01:00
Nathan LeClaire 8ba5a57072 Revert "Merge pull request #1552 from ehazlett/b2d-next"
This reverts commit 736ebb14fb, reversing
changes made to c6660bf62c.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-08-03 14:46:52 -07:00
Evan Hazlett cb80c434ac b2d: use direct urls until release; devicemapper for engine opts tests
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

b2d-ng: use driver names for iso versions

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett c6e9849783 vbox: restrict regex matching for msys translated paths
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: remove tar loading from virtual disk creation

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

tests: use btrfs instead of overlay for custom option test

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett e09f2fdd9c vbox: change to get latest released iso instead of pre-release
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: fix windows share dir for homedir

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: update tests for b2d

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett ab31d52165 update vbox driver to work with new b2d
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: lock down shared folders to user home dir

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use env var for user for cross platform

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: remove sudo from setting ssh key for user

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use homedir for share

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-23 19:40:07 -04:00
Nathan LeClaire 8089e222c3 Remove synthcpu flag for Virtualbox 5 support
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-09 10:42:46 -07:00
Evan Hazlett 69dc9fd7f3 Merge pull request #1273 from hairyhenderson/default-driver-impl
refactor: Extracting a base Driver struct
2015-07-09 01:59:05 -06:00
Nathan LeClaire 9053ee24c7 Fix choke when starting from Saved state
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-07 14:36:21 -07:00
Dave Henderson 3d002187fe Refactoring drivers to embed drivers.DefaultDriver
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-07-07 11:24:00 -04:00
Evan Hazlett a6a6e16329
vbox: fix vbox race with unregistervm
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-15 17:04:46 -04:00
Nathan LeClaire e91c28fad6 Check for IP to be assigned before returning from Start()
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-06-11 14:02:27 -07:00
Evan Hazlett 5a59fa8f12
added deprecation comment
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-11 16:24:49 -04:00
Evan Hazlett f26fb12664
vbox: fix panic with custom cidr
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-11 14:04:48 -04:00
Evan Hazlett 2f4d8c4237 vbox: refactor random IP allocation to func
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-09 11:05:29 -04:00
Evan Hazlett ca5f0738e2 vbox: allow specifying host only adapter cidr
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-09 11:05:29 -04:00
Evan Hazlett 3304bf8923 virtualbox: check for hostonly iface and add if needed on start
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-09 11:05:29 -04:00
Evan Hazlett 98e38006c0 Merge pull request #1218 from ehazlett/vbox-intel-nic
vbox: use intel driver for nic
2015-05-26 11:04:19 -04:00
Evan Hazlett f82032b28d remove provider
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-05-21 10:41:03 -04:00
Nathan LeClaire 2f78b7f92a Move code to use SSH "backends"
Default to shelling out to SSH when available.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-05-19 15:02:57 -07:00
Evan Hazlett 76ba5b258e
vbox: use intel driver for nic
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-05-19 09:26:24 -04:00
Evan Hazlett a3e08a010d Merge pull request #1108 from ibuildthecloud/vbox-sleep
Fix issue where GetIP in VirtualBox failes due to no SSH
2015-05-07 13:33:26 -07:00
Evan Hazlett 60be4c292c virtualbox: windows share support
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-05-05 11:31:43 -07:00
Darren Shepherd 8afe967a80 Fix issue where GetIP failes due to no SSH
The main goal of this patch was to make the VirtualBox driver wait for
SSH before trying to get the IP of the VM.  The generic WaitForSSH
method required a Host struct as an arg.  This patch moves most of the
logic to the driver package so that drivers can call WaitForSSH.  The
existing functions in host are just wrappers to the real
implementation in drivers now.

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-05-05 09:32:45 -07:00
Dave Henderson 3739e4d067 Harmonizing drivers so IPAddress property is kept up-to-date
Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
2015-04-30 19:59:23 -04:00
Nathan LeClaire 142ffadc2c Refactor logging to focus on simple STDOUT/STDERR
This also lays the foundation for the possibility of log drivers in the
future, if it is decided that is a direction to pursue.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-30 12:04:52 -07:00
Evan Hazlett 03c245cf4f Merge pull request #1033 from ehazlett/env-shell-selection
shell selection for env
2015-04-30 14:03:23 -04:00
Evan Hazlett 6fe4331fdd
vbox: stop before rm for stability
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-04-30 10:36:59 -04:00
Evan Hazlett 03c1fbadc5 Merge pull request #1073 from ehazlett/vbox-use-single-core
vbox: use single cpu by default
2015-04-29 14:07:17 -04:00
Evan Hazlett 9e1185e06e
vbox: use dns pass through
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-04-29 12:33:10 -04:00
Evan Hazlett e8704b14f1
vbox: use single cpu by default
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-04-29 09:45:33 -04:00
John Fieber f42177983f Remove stray sleep()
This is just a bit of development debris.

Signed-off-by: John Fieber <jrf@ursamaris.org>
2015-04-27 16:58:57 -07:00