Commit Graph

230 Commits

Author SHA1 Message Date
Justin Cormack
ad4131ad4b Merge pull request #2426 from arm64b/firmware-file-format
qemu: Specify the firmware file format explicitly
2017-08-17 14:56:35 +01:00
Dennis Chen
023dba65c9 qemu: Specify the firmware file format explicitly
Currently we depend on the qemu to detect the firmware file format
automatically, which is dangerous. This patch specify the 'raw'
format explicitly to remove the kind of restrictions.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-08-17 09:27:28 +00:00
Rolf Neugebauer
56ae6d5055 cmd: Allow re-using an existing packet.net machine
This add a -device option which enables the re-use of an existing
device. The device state is update to use a potentially new base-url
ro PXE boot from. This maybe faster than provisioning a new server.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-16 16:27:50 +01:00
Rolf Neugebauer
d246ea9130 cmd: Temporarily use my fork of the packet.net API
This adds a new call to update an existing device.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-16 16:27:50 +01:00
Rolf Neugebauer
4d5bf9d90c Merge pull request #2416 from rn/p4
iPXE boot of arm64 on packet.net
2017-08-15 23:24:11 +01:00
Rolf Neugebauer
a6e25b0825 cmd: Print the packet machine ID when booting
This is useful if the connection to the SOS fails and you
want to debug manually after.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-15 21:36:10 +01:00
Rolf Neugebauer
f8c45539cc cmd: Add iPXE support for arm64 on packet.net
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-15 17:54:38 +01:00
Justin Cormack
b7fbabe2ba Simpler known_hosts parsing
Note it cannot deal with hashed host keys still.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-15 17:22:43 +01:00
Rolf Neugebauer
7ae9fab6b6 cmd: Unify Logging for packet backend
Be less verbose when running.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-15 14:31:44 +01:00
Rolf Neugebauer
2590c66511 cmd: Remove the packet machine when done
Adds a new option, '-keep' which will keep the machine around,
but by default remove the machine when done.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-15 14:31:44 +01:00
Rolf Neugebauer
fced67dab8 cmd: Add a -serve command to the packet.net backend
The -serve command starts a local HTTP server which serves
the kernel and initrd files.  The server can then easily be
made available via ngrok or other means.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-15 14:31:44 +01:00
Rolf Neugebauer
33e8afb292 cmd: Use the proper packet.net go bindings again
The support for always PXE has been merged.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-15 14:31:44 +01:00
Justin Cormack
a3de645048 Merge pull request #2397 from dave-tucker/aws-panic
aws: Fix panic when there is no console output
2017-08-10 21:59:54 +01:00
Dave Tucker
90bf0cc2f6 aws: Fix panic when there is no console output
When an AWS machine is stopped and there is no console output the CLI
panics due to a nil pointer dereference. This commit checks that the
console output is not null before attempting to decode it.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-08-10 17:28:09 +01:00
Dave Tucker
f574ada213 aws: Honour the zone variable when creating an instance
Instances were being created in a different AZ to the one specified in
the zone variable. This could lead to situations where the disks and the
instance were in different AZs and would result in an error.

This commit adds placement information to the API call used to create
the instance.

Fixes: #2388

Signed-off-by: Dave Tucker <dt@docker.com>
2017-08-10 16:49:56 +01:00
Rolf Neugebauer
1a9d736f75 Merge pull request #2392 from rn/p2
Better kernel cmdline handling on packet.net
2017-08-09 14:20:55 +01:00
Rolf Neugebauer
a885eb3304 cmd: Append the kernel command line args when booting on Packet
The iPXE needs the hard coded value of 'kernel-params' but
we should append the kernel command line from the YAML in case
it sets other parameters.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-09 13:18:41 +01:00
Rolf Neugebauer
934d818bf1 cmd: Restructure iPXE script code for packet backend
Break it into multiple instructions. The single line was
super hard to parse.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-09 12:19:31 +01:00
Justin Cormack
34dc65561b Robustify ISO/kernel detection on hyperkit
Much easier to follow and more correct; also ignores directories.

fix #2385

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-09 12:00:00 +01:00
Rolf Neugebauer
04a689fcc4 cmd: Enable console access for packet.net
On 'linuxkit run packet' ssh into the SOS for the newly created
machine. This requires that you have set up your ssh keys and
have at least once logged into the ssh so that the host keys
are present in the 'known_hosts' file.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-07 21:35:41 +01:00
Rolf Neugebauer
148b51347f vendor: add ssh agent package
This is needed for ssh into the serial console on packet.net

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-07 21:35:41 +01:00
Rolf Neugebauer
c804ff0dc1 cmd: Enable always-pxe for packet.net
This option configures the machine to always PXE boot. By
default it would only PXE boot for the first time.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-07 21:35:41 +01:00
Rolf Neugebauer
bdc06ee30a cmd: Add packet.net env variable names to help message
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-07 21:35:41 +01:00
Rolf Neugebauer
71a4cd2f3c cmd: Prefix packet.net host name with username
If a packet account is shared between users, this makes it
clearer who created the machine.

Also, switch "moby" to "linuxkit"

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-07 21:35:41 +01:00
Rolf Neugebauer
a837312cc7 cmd: Switch packet.net API to github.com/bzub/packngo
This fork has initial support for always-pxe and was
suggested to use be used as an interim solution here:
https://github.com/packethost/packngo/issues/22#issuecomment-319973502

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-07 21:35:41 +01:00
Justin Cormack
73b516f09b Merge pull request #2302 from dave-tucker/mdgcp
linuxkit: Better GCP disk handling
2017-08-07 16:01:53 +01:00
Ian Campbell
97da92dc65 linuxkit: Bump to logrus 1.0.2 (with case change).
To enable this bump github.com/Azure/go-ansiterm and github.com/docker/docker
to their latest version which have switched to lower case.

This in turn requires bumping golang.org/x/sys since github.com/docker/docker/pkg/term
now uses `unix.IoctlGetTermios`. I picked the revision from docker/docker's vendor.conf.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-08-07 12:11:43 +01:00
Zachery Hostens
9173d88456 save mac address within state
Signed-off-by: Zachery Hostens <zacheryph@gmail.com>
2017-08-06 22:39:34 -05:00
Rolf Neugebauer
7c3f9690d5 cmd/qemu: Better handling of arch
- When executing on aarch64, use it as the default arch
- When selecting aarch64 on a non aarch64 system set the
  CPU flag to a default value (not 'host').

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-04 15:45:00 +01:00
Justin Cormack
d7caf92708 Merge pull request #2355 from justincormack/bootrom
Support UEFI ISO boot on hyperkit
2017-08-04 12:45:27 +01:00
Justin Cormack
317ddb09df Do not try to autodetect UEFI mode
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-04 11:42:30 +01:00
Justin Cormack
8aa811540f Support UEFI ISO boot on hyperkit
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-04 11:34:51 +01:00
Eric Briand
5e53f548a1 Fix AWS push
Signed-off-by: Eric Briand <eric.briand@gmail.com>
2017-08-04 10:36:00 +02:00
Rolf Neugebauer
684ad6778d cmd: Use qemu multi-arch image for qemu runner
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-08-03 17:36:22 +01:00
Nick Jones
f65a4e803d Update OpenStack run and push support
This commit updates the support for pushing images into OpenStack by
inheriting environment variables for endpoint and authentication
information, when available.

It also attempts to make the `openstack run` support more consistent
with other providers (specifically GCP and AWS), i.e just take the name
of the image as the argument and launch an instance using that.

Finally, it also updates the relevant documentation for OpenStack
support.

Signed-off-by: Nick Jones <nick@dischord.org>
2017-08-02 22:45:38 +01:00
Justin Cormack
550bf41d0b Merge pull request #2337 from zacheryph/qemu-pidfile
save qemu pid in state directory
2017-08-02 15:53:17 +01:00
Nick Jones
a6f3f99d72 Initial support for launching instances on OpenStack
This commit provides rudimentary support for launching instances on an
OpenStack platform.

Signed-off-by: Nick Jones <nick@dischord.org>
2017-08-02 14:40:38 +01:00
Zachery Hostens
aa48795203 save qemu pid in state directory
Signed-off-by: Zachery Hostens <zacheryph@gmail.com>
2017-08-01 11:23:43 -05:00
Dave Tucker
3dd45d41aa linuxkit: Better GCP disk handling
This commit allows the GCP backend to use the familiar `-disk` behaviour
that the local hypervisors use. The `file` attribute is used as the disk
name in GCP. The size is converted to GB and is always > 1GB.
This has the benefit of allowing multiple disks to be used with GCP
instances.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-07-26 20:53:50 +01:00
Rolf Neugebauer
896c3574ab cmd: Change logic for using EFI FW when qemu is run in a container
By default we want qemu to use the EFI firmware image in the qemu
container. However the logic in the code would always bind mount
the FW image into the container.

This commit changes the logic to only bind mount the FW image if
it was specified on the commandline.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-07-26 18:14:28 +01:00
Rolf Neugebauer
4b25e00c7d cmd: Update qmeu container image hash
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-07-26 18:14:28 +01:00
Ian Campbell
096aec0a19 qemu: Add -networking option, with various new alternatives
This follows the model in the hyperkit runner, although the options are
different.

The options are:

- `user`: the existing user mode networking (the default).
- `tap,«device»`: replaces the previous `-tap-device «device»` option.
- `bridge,«name»`: tap device on (preexisting) named bridge.
- `none`: No networking at all.

If not running as root then `bridge` mode requires host configuration
http://wiki.qemu.org/Features/HelperNetworking. TL;DR: you need to `chmod u+s`
the `qemu-bridge-helper` and to whitelist specific bridges in
`/etc/qemu/bridge.conf`.

Pass an explicit virtio nic and configure a random MAC since QEMU seems to use
the same one by default.

In the hyperkit runner the various `networking*` constants become
`hyperkitNetworking*` to avoid namespace clashes (e.g. for `None`). The QEMU
equivalents are `qemuNetworking*`.

Both hyperkit and qemu now support an explicit `-networking default` or
`-networking ''` to make scripting easier.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-25 16:17:22 +01:00
Ian Campbell
cb86cdb027 qemu: Generate a random uuid and pass via -uuid
This is the same behaviour as the LinuxKit backend.

This populates /sys/class/dmi/id/product_uuid, which newer version of weave-net
appears to require.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-25 16:17:22 +01:00
Nick Jones
7c65860a5c Refactor OpenStack push support to use Gophercloud
This commit refactors the OpenStack push support to make use of the
Gophercloud library in order to handle authentication and talking to the
right image service as defined in the service catalogue.

Signed-off-by: Nick Jones <nick@dischord.org>
2017-07-24 13:47:18 +01:00
Rolf Neugebauer
3219daa674 Merge pull request #2264 from tych0/support-tap-qemu
support tap devices in qemu backend
2017-07-21 10:56:24 +01:00
Tycho Andersen
d237c92273 support tap devices in qemu backend
The motivation for this is networking out (in particular, testing NFS
support) from the VM.

We could be a lot more user friendly (a la libvirt) by creating the tap
device for users and allowing them to specify a bridge instead, but then
we'd need root to create this tap device. For now, let's make people do
their own tap devices, and just use them. A tap device can be created for a
bridge as follows:

    # ip tuntap add linuxkit0 mode tap user `whoami`
    # ip link set linuxkit0 up
    # ip link set linuxkit0 master $bridge_name

and then used by:

    $ ./bin/linuxkit run qemu -tap-device linuxkit0 linuxkit

Signed-off-by: Tycho Andersen <tycho@docker.com>
2017-07-20 12:40:07 -06:00
thebsdbox
41f2d2c256 OpenStack Push support
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
2017-07-20 16:24:48 +01:00
Dennis Chen
3b1dfb69c7 ARM64: specify external firware binary for containerized qemu
Current implementation uses a fixed firmware(bios) binary
installed by the build process of the qemu container image,
which will prevent us from providing an external firmware binary
outside the container. This patch removes this limitation, thus we
can assign a firware binary image file with "-fw" option.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-07-14 09:10:42 +00:00
Justin Cormack
944793312a Merge pull request #2197 from ijc/qemu-envvar-overrides
qemu: allow kvm and containerized options to be overridden by the env…
2017-07-13 16:25:51 +01:00
Ian Campbell
cc8bd94960 qemu: allow kvm and containerized options to be overridden by the environment
This is useful in the case where Moby is shelling out to LinuxKit for certain
image types (currently raw and qcow2). Currently to experiment with different
options (e.g. when comparing performance to CI) you have to edit either the
moby or linuxkit tool to change the options used.

The environment variables take precedence over any explict command line options
given.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-07-13 15:23:14 +01:00