Commit Graph

148 Commits

Author SHA1 Message Date
Justin Cormack
583c5755fa Merge pull request #1944 from justincormack/qemu-multiple-disks
Support multiple disks in qemu
2017-06-01 14:17:51 +01:00
Justin Cormack
25a1e12cf3 Support multiple disks in qemu
This changes the CLI specification for disks, as it needs to be able to
be repeated.

```
linuxkit run qemu -disk name,size=1G,format=qcow2 ...
```

Options may be omitted.

Currently other local backends may not support multiple disks, but this
can be added in future. Code for cloud backends has not changed as the
disk support is specific to the platform.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-01 13:40:20 +01:00
Riyaz Faizullabhoy
abb19f847d Merge pull request #1929 from thebsdbox/push_vcenter
vCenter push capability
2017-05-31 13:41:24 -07:00
thebsdbox
6d9a3c5312 vCenter push capability
Re-factored the `run` code to create the `push` functionality.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-31 21:04:27 +01:00
Riyaz Faizullabhoy
c983441dae Merge pull request #1935 from thebsdbox/pushUsageFix
Fix correct usage function
2017-05-30 12:00:33 -07:00
Rolf Neugebauer
cbecd19c51 cli: Update qemu runner to use the new qemu image
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-30 17:15:13 +01:00
thebsdbox
9e7214a1f8 Fix correct usage function
This fixes the push function as it currently gives the help for `run`
not `push`.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-30 15:56:01 +01:00
Rolf Neugebauer
360e9870d6 Merge pull request #1926 from MagnusS/no-networking
hyperkit: Add --networking option
2017-05-29 19:23:52 +01:00
Magnus Skjegstad
eadb3066f3 hyperkit: Add --networking option
Adds a new --networking option to simplify selection of networking modes
for `linuxkit run hyperkit`. The new modes are "docker-for-mac",
"vpnkit" and "none".

By default docker-for-mac will be used for networking. HyperKit will
then connect to the default VPNKit socket location used by Docker for
Mac.

In vpnkit-mode a new VPNKit instance is started and the socket
"vpnkit_eth.sock" is created in the state directory. This mode also
enables port forwarding via 9p and vsock. The vpnkit mode optionally
accepts a path to an existing VPNKit socket. This allows two or more VMs
to be connected to the same virtual network - but only the VM that
created the the socket can use port forwarding.

Mode "none" disables networking.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-29 19:49:13 +02:00
thebsdbox
bbde9f5baa Fixes disk size output typo
The error was incorrect when unable to parse the disk size.

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-29 14:15:56 +01:00
Justin Cormack
4e32ad7817 Only output qemu disk creation info in debug mode
As I am using this command in the internals of `moby` the
verboseness is annoying.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-26 16:43:49 +01:00
Magnus Skjegstad
938091c9fb linuxkit: add -vpnkit-socket flag
Add a new flag to set the VPNKit ethernet socket path. Defaults to the
standard location for the socket in Docker for Mac.

This flag can be used to connect to the VPNKit instance started by
another linuxkit VM launched with `-start-vpnkit`. VMs connected to the
same VPNKit instance will be on the same virtual internal network.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-26 13:06:26 +02:00
Rolf Neugebauer
df141841c5 Merge pull request #1891 from MagnusS/add-9p-linuxkit
Add -start-vpnkit flag to linuxkit run hyperkit
2017-05-26 10:34:59 +01:00
Magnus Skjegstad
9c4dc38883 linuxkit: add -start-vpnkit flag
Adds a flag to launch a new vpnkit instance. This enables port
forwarding via a 9p mount (tag:port) if the guest supports it. Vsock
port 62373 is also opened so vpnkit can forward connections back to the
guest.

If -start-vpnkit is not specified HyperKit will connect to the
vpnkit instance managed by Docker for Mac, as before.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-26 10:09:21 +02:00
thebsdbox
6fe7d0e66f Adding of VMware govmomi to vendors
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-25 08:48:48 +01:00
thebsdbox
1e6243357f VMware vCenter run capability
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-24 18:35:01 +01:00
Rolf Neugebauer
f90fde5a6f cmd: Unify disk command line options for local hypervisors
- '-disk-size' is now defaults to MB (but can be GB when appending 'G')
- The disk will be created if it doesn't exist (didn't happen in qemu)

Update the documentation.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-24 16:05:06 +01:00
Justin Cormack
838d845003 Clean up of Qemu run
For all output formats except kernel+initrd, you must use the full path of
the file they want to run. Make the options auto detect.

Split the uefi option to mean "use uefi firmware" not be ISO specific.

Allow specifying a bootable disk image, so we can test disk image output
formats with qemu too.

Add a test case for qcow2 boot under qemu.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-23 09:22:39 +01:00
Justin Cormack
8afd318e97 Fixes for running qemu-img in a container
- show errors by outputting stderr
- as no input is wired up, fails as requests a tty, so don't do that

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-22 14:36:00 +01:00
Justin Cormack
809213230d Allow specifying the format of a qemu drive
Default remains qcow2 but you can specify raw or other supported formats.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-22 11:16:20 +01:00
Ian Campbell
2df30ac26c Pass --tty to docker run when running Qemu via a container
Otherwise escape codes (arrow keys etc) do not work.

This is done only when stdin is a tty.

For clarity spell `--tty-` and `--interactive` out in full rather than using
the short versions.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-18 21:07:22 +01:00
Ian Campbell
bb787b49be Allow forcing qemu backend to use container via command line
`linuxkit run --containerized foo`

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-18 17:19:01 +01:00
Magnus Skjegstad
f0e7e41424 linuxrun: add -vsock-ports option to HyperKit
When `-vsock-ports` is specified, the listed guest vsock
ports will be made available through unix domain sockets
in the state directory.

Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
2017-05-15 20:14:30 +02:00
Rolf Neugebauer
a16d1683f8 cmd: Add a -state argument to VMware runner
The state directory is used to store any user data disk images
and the .vmx file. At run time, it is also used to keep
various other files, such as the nvram, log and lock files, etc.

While at it, also clean up the code a little more and fix the
handling of the "-disk-size" argument when no "-disk" argument
is specified. This brings it in line with the other runners.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:13:55 +01:00
Rolf Neugebauer
243967db6f cmd: Unify the coding style somewhat
There is no need to prefix local variables and try to name
variables which refer to the same/simialr thing the same
across runners.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:09:48 +01:00
Rolf Neugebauer
5231e06dec cmd: Add a -state option to hyperkit runner (and enable vsock)
The state directory is used to store:
- the disk image, if not specified via '-disk'
- the ISO for metadata, if '-data' is used
- the Unix domain socket for virtio sockets
- the PID of the hyperkit process
- a JSON file with the hyperkit configuration

This patch also enables the virtio socket device for the VM.

While at it, also fix .gitignore to ignore kernel images again.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-15 12:09:48 +01:00
Justin Cormack
b86fcd5253 Merge pull request #1813 from thebsdbox/vmware_disk_fix
Added matching capability to create a disk
2017-05-14 10:39:54 +01:00
thebsdbox
3e9a0ae94c Added matching capability to create a disk
- What I did
Added the capability to re-use or create a disk from the linuxkit
VMware cli

- How I did it
Using the vmware-diskmanager that comes with Fusion/Workstation

- How to verify it
Run linuxkit run vmware with the -disk -disk-size arguments

- Description for the changelog
Persistent disk functionality added into the VMware backend.

- A picture of a cute animal (not mandatory but encouraged)
nope

Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-05-13 19:29:55 +01:00
Dave Tucker
7027dc814c Fix path handling in QEMU to allow containers outside the PWD
Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-12 20:12:59 +01:00
Ian Campbell
c1ce8b4688 Consolidate metadata ISO writing into a single function
Used by both `metadata create` and the hyperkit runner.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 19:25:28 +01:00
Ian Campbell
36eaa44d7e Add linuxkit metadata command
Only subcommand is currently `create` which is a thin wrapper to create an iso
file in the format expected by `pkg/metadata`.

Currently very basic and just takes the content on the command line but could
be extended to read from a file etc.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-05-11 19:25:27 +01:00
Justin Cormack
56e30fdbc5 Clean up initrd creation library
Remove duplicated code and clean up file handling a little.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-09 13:30:14 +01:00
Justin Cormack
fb3dab399d Code in the initrd generator to split a single tarball
In the WIP code in `moby` we now have a standard base tarball format,
that includes the kernel and cmdline as files in `/boot` so that the
entire output of the yaml file can default to a single tarball. Then
this can be split back up by LinuxKit into initrd, kernel and cmdline
as needed. This will probably become the only output of the `moby build`
stage, with a `moby package` stage dealing with output formats.

We may remove the output format specification from the yaml file as well,
and just have it in the command.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-08 16:15:50 +01:00
Lorenzo Fontana
82e6534e9c Port forwarding in qemu runner
Example usage:
	linuxkit run qemu -publish 1111:1111/udp -publish 8081:80/tcp example

Signed-off-by: Lorenzo Fontana <lo@linux.com>
2017-05-06 00:34:44 +02:00
Rolf Neugebauer
5ce03cc884 cmd: Unify 'run' cmdline options
- Use 'disk-size' for disk size
- Use 'disk' for the path to the disk image
- Use 'fw' for the path to the EFI firmware

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-02 17:00:57 +01:00
Dave Tucker
ccfbcceebd linuxkit: Make gcp push honour the img-name flag
This fixes a regression where `linuxkit push gcp` no longer allows for a
custom destination to be provided via the `-img-name` flag or the
`CLOUDSDK_IMAGE_NAME` environment variable

Signed-off-by: Dave Tucker <dt@docker.com>
2017-05-02 12:36:09 +01:00
Justin Cormack
6155e8c8bc Change to use kernel not bzImage everywhere
Previously we hardcoded `bzImage` which is not used for all
use cases or architectures.

fix #1630

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 16:24:15 +01:00
Phil Estes
5612718b0f The -drive parameter for qemu run requires more flags
To use `-drive` as an analog for `-hda` or `-hdb`, etc. the qemu
docs note that "media" and "index" are required flags. Local
testing shows that drive shows up properly as `/dev/sda` after
this change.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2017-04-27 13:33:03 -04:00
Lorenzo Fontana
b28eab3912 Using the actual invoked command for help messages
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2017-04-26 23:56:14 +02:00
Carlton-Semple
f512541868 Fix for old moby reference in linuxkit CLI
Signed-off-by: Carlton-Semple <carlton.semple@ibm.com>
2017-04-25 14:18:10 -04:00
Justin Cormack
252e32aac5 Remove the moby tool from this repo
Updated go-compile to be able to compile remotely. Note I
did not update the oter users of go-compile as it does not affect
them.

Update `go get` instructions to fetch new one, or `make && make install`
will still work.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-25 14:53:32 +01:00
Rolf Neugebauer
f0ee1ee707 src: Remove the infrakit plugin
It has been merged/moved to https://github.com/docker/infrakit

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-25 13:17:04 +01:00
Justin Cormack
6f80f664ce Split cli into moby and linuxkit
moby just does the simple `build` cases, while `linuxkit` does
`push` and `run`.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 20:03:22 +01:00
Justin Cormack
2709ee88bc Split build and push, and remove push code from run
This currently only changes the `gcp` target, but is the new
model - the `build` command will only do things locally, then
you need to `push` to an image store such as GCP or other ones
in order to `run` for platforms that cannot boot directly from
a local image.

Fix #1618

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-24 17:12:05 +01:00
Dave Tucker
48daeda07e moby: Add container fallback for moby run qemu
This commit allows moby run qemu to fallback to using a container if
qemu isn't installed on the host OS

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-24 15:16:57 +01:00
Rolf Neugebauer
9bdd831b37 src: Use hyperkit from the the moby org
HyperKit got moved from docker to moby. Update vendoring and
imports.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-04-24 10:53:59 +01:00
Riyaz Faizullabhoy
2ec3884283 Merge pull request #1653 from dave-tucker/ltp-ci
Changes required to run LTP tests in CI
2017-04-23 13:22:40 -07:00
Dave Tucker
bbe8078755 moby: add skip-cleanup flag to moby run gcp
This is used as the CI will cleanup after itself

Signed-off-by: Dave Tucker <dt@docker.com>
2017-04-19 16:02:48 +01:00
Daniel Finneran
6f9d0247c9 Fix for prefix for linuxkit
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-04-18 19:00:31 -05:00
solidnerd
2c836c28ab Rename package initrd in build.go
This will rename github.com/docker/moby/src/initrd to github.com/linuxkit/linuxkit/src/initrd

Signed-off-by: solidnerd <niclas@mietz.io>
2017-04-18 20:19:21 +02:00