Commit Graph

169 Commits

Author SHA1 Message Date
Dennis Chen
3a9c88c0c5 ARM64: Remove the hardcode of virtual machine type
Current implementation hardcodes the virtual machine as
"q35" for x86, this patch remove this hardcode and config
the machine type according to the arch the VM is running.
Also, in order to make sure the qemu can run on arm64 platform,
we need to specify the vcpu type in the command line.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-07-07 21:54:15 +08:00
Rolf Neugebauer
4a9c00a5e0 src: Update qemu image to latest
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-07-01 19:24:15 +01:00
Ian Campbell
7151f1af52 qemu: Add -enable-kvm to force (attempted) use (or not) of KVM
The default is set by probing for /dev/kvm. Use of KVM can be forcibly disabled
with `-enable-kvm=false`. Note that passing `-enable-kvm=true` when `/dev/kvm` is
not present still boots but complains:

    Could not access KVM kernel module: No such file or directory
    failed to initialize KVM: No such file or directory
    Back to tcg accelerator.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-27 12:20:25 +01:00
Justin Cormack
c20f10f7f8 Add vmnet support to linuxkit run hyperkit
Allows routed networking, so long as you runhyperkit as root.

This has quite a few downsides, including the requirement to
run as root in order to set up the networking, but some people
really want VMs that are routable from the host.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-16 10:54:32 -07:00
Rolf Neugebauer
2f212e6c74 cmd: Unify the push coding style
- Use 'flags' for the subcommand FlagSet
- Use %v to print errors
- Use 'path' for the path
- Fix cases where the 'path' refers to a different directory
- Don't use CamelCase for command line options

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-15 17:31:28 -07:00
Justin Cormack
d194cf7cf7 Update hyperkit and support multiple disks
Now hyperkit Go API has multiple disk support, allow using them from linuxkit

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-15 13:31:46 -07:00
Ian Campbell
e2eb17ef6c Only create qemu runner state dir if it is going to be used.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-13 17:22:08 +01:00
Ian Campbell
13a94c7a3c Add metadata support to Qemu runner.
Based on the hyperkit runner's code.

project/kubernetes/boot.sh now works, although lack of network connectivity
between individual VMs remains an issue.

Also manually validated containerized operation with:

    rm -rf kube-node-0-state && ../../bin/linuxkit run qemu --containerized  -cpus 2 -mem 4096 -state kube-node-0-state -disk size=4G -data "foo bar" kube-node

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-13 11:08:53 +01:00
Ian Campbell
a09090e6cd Add state dir support to Qemu runner.
Modelled on the Hyperkit runner, for now only used for the disk.

This is one step closer to having project/kubernetes/boot.sh work on Linux.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-13 11:08:53 +01:00
Rolf Neugebauer
a42a3ffb39 cmd: Add initial Hyper-V run backend
The Hyper-V backend is loosly based on the docker-machine code
as well as ./scripts/LinuxKit.ps1. It shells out to Powershell
for most of the configuration.

Console is provided by github.com/Azure/go-ansiterm/winterm
and the ode surrounding it is loosely based on the equivalent
code in containerd and moby/moby.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-11 09:11:06 +01:00
Rolf Neugebauer
309ae23c2e cmd: Use github.com/rn/iso9660wrap for metadata
The repository was moved...

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-11 09:11:06 +01:00
Rolf Neugebauer
ce8de92978 cmd: Fix disk "size" handling
commit bdf9b1f31a introduced a bug with disk size handling
where GB was not handled correctly. Fix it.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-11 09:11:06 +01:00
Rolf Neugebauer
bdf9b1f31a cmd: Default disk "size" parameter to GB
Most cloud providers allow disk size allocation on in units
of GB. Make it the default for linuxkit disk "size" arguments.
Users can override the unit by appending a M to the disk size.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-06-09 11:51:48 +01:00
Riyaz Faizullabhoy
d31413c39c Merge pull request #1973 from kencochrane/fix_aws_name
Added more log statements to linuxkit push aws command
2017-06-06 13:31:22 -07:00
Ken Cochrane
67c2a230fb Fixed AWS push command, name wasn't set correctly
Signed-off-by: Ken Cochrane <kencochrane@gmail.com>
2017-06-06 15:50:25 -04:00
Justin Cormack
3f8d627be6 Merge pull request #1969 from DieterReuter/fix-aws-default-img-name
Fix empty AWS default image name
2017-06-06 19:25:57 +01:00
Dieter Reuter
fc5135b5cc Fix empty AWS default image name
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
2017-06-06 19:10:21 +02:00
thebsdbox
7cc2bc43e4 Added capability to wait for the OpenVM tools to report the IP of new VM
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-06-06 17:52:18 +01:00
Justin Cormack
d617db19bf Merge pull request #1964 from dave-tucker/aws
Add AWS Support to LinuxKit Push and Run
2017-06-06 12:06:50 +01:00
Dave Tucker
8f4408310d docs: Add basic docs for AWS support
Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:36:43 +01:00
Dave Tucker
719f260e01 linuxkit: Order push/run backends and cases alphabetically
This makes it easier to identify where a new backend should be added.
It's also simpler to match help text and case statements.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:36:43 +01:00
Dave Tucker
3dcd8a2730 linuxkit: Add run support for AWS
Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:36:31 +01:00
Dave Tucker
0737694eb7 linuxkit: Add push support for AWS
Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-06 10:06:28 +01:00
Justin Cormack
12a2ea5143 Merge pull request #1959 from justincormack/mobyup
Update moby tool and qemu fixes
2017-06-05 17:42:06 +01:00
Justin Cormack
e782a469d5 Update moby tool and qemu fixes
- no longer uses several of the `mkimage-*` tools in favour of dogfooding
with `linuxkit` and using the `mkimage` package.
- fix the qemu docker container fallbacks to work better when multiple
paths are used for disks and the image.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-05 16:34:26 +01:00
radu-matei
0f2e41f138 Add Azure push and run
azure: React to change requests

azure: Fix push and run message and update example

azure: Remove docker dependency and upload VHD

Modify %s to %v for Go errors

Signed-off-by: radu-matei <matei.radu94@gmail.com>
2017-06-02 14:41:28 +03:00
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