745 Commits

Author SHA1 Message Date
375b0cc132 fix: adjust helper string in machine_common
[NO NEW TESTS NEEDED]

Signed-off-by: Rick Rackow <rick.rackow@gmail.com>
2023-11-03 21:24:05 +01:00
9e05fb14a4 fix: adjust helper string in machine_common
[NO NEW TESTS NEEDED]

Signed-off-by: Rick Rackow <rick.rackow@gmail.com>
2023-11-03 20:32:20 +01:00
5fc7585334 Merge pull request #20420 from jakecorrenti/refactor-socket-mapping
Refactor machine socket mapping
2023-11-03 18:33:54 +00:00
b5f854458d fix: adjust helper string in machine_common
[NO NEW TESTS NEEDED]

Signed-off-by: Rick Rackow <rick.rackow@gmail.com>
2023-11-03 15:42:00 +01:00
48b8b372a6 Merge pull request #20417 from baude/checkforsystemconnection
check system connections before machine init
2023-11-02 21:49:33 +00:00
613f50c7ad check system connections before machine init
we should exit early if a system connection name exists with the name of
the proposed podman machine (i.e. podman-machine-default).

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-11-02 10:31:49 -05:00
ea4775ec9e Consume OCI images for machine image
allow podman machine to extract its disk image from an oci registry or
oci-dir locally.  for now, the image must be relatively inflexible. it
must have 1 layer.  the layer must possess one image. so a dockerfile
like:

FROM scratch
COPY ./myimage.xz /myimage.xz

when using an oci dir, the directory structure must adhere to the
typical directory structure of a an oci image (with one layer).

── blobs
│   └── sha256
│       ├── 53735773573b3853bb1cae16dd21061beb416239ceb78d4ef1f2a0609f7e843b
│       ├── 80577866ec13c041693e17de61444b4696137623803c3d87f92e4f28a1f4e87b
│       └── af57637ac1ab12f833e3cfa886027cc9834a755a437d0e1cf48b5d4778af7a4e
├── index.json
└── oci-layout

in order to identify this new input, you must use a transport/schema to
differentiate from current podman machine init --image-path behavior. we
will support `oci-dir://` and `docker://` as transports.

when using the docker transport, you can only use an empty transport for
input.  for example, `podman machine init --image-path docker://`.  A
fully quailified image name will be supported in the next iteration.

the transport absent anything means, i want to pull the default fcos
image stored in a registry.  podman will determine its current version
and then look for its correlating manifest.  in this default use case,
it would look for:

quay.io/libpod/podman-machine-images:<version>

that manifest would then point to specific images that contain the
correct arch and provider disk image. i.e.

quay.io/libpod/podman-machine-images:4.6-qcow2

this PR does not enable something like
docker://quay.io/mycorp/myimage:latest yet.

names, addresses, andf schema/transports are all subject to change. the
plan is to keep this all undocumented until things firm up.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-11-02 10:23:14 -05:00
ce9c1b9b86 Refactor machine socket mapping
Refactors machine socket mapping to prevent using similar/the same code
paths. Moves the shared code to `pkg/machine/sockets.go`.

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-11-01 23:09:17 -04:00
f6ec210f3b AppleHV: Fix machine rm error message
Fix machine not found error message on rm to be consistent with qemu.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-01 15:02:30 -04:00
7153124f97 Log gvproxy and server9 to file on log-level=debug
Logging to os.Stdout and os.Stderr does not seem to work in
Powershell. I am not entirely certain why.

Logfiles are the best alternative I can think of.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-10-31 10:14:06 -04:00
d9c388e2fe Change to using gopsutil for cross-OS process ops
Instead of trying to write out own code to do basic process
operations (e.g. checking if a PID is still running in a multi-OS
friendly manner), use shirou/gopsutil, a multi-platform library
that should abstract all the complexity away. Unlike our previous
approach on Windows, this one should actually work.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-10-31 10:14:06 -04:00
642fa98976 Initial addition of 9p code to Podman
This includes two new hidden commands: a 9p server,
`podman machine server9p`, and a 9p client,
`podman machine client9p` with `server9p` currently only
configured to run on Windows and serve 9p via HyperV vsock, and
`client9p` only configured to run on Linux. The server is run by
`podman machine start` and has the same lifespan as gvproxy
(waits for the gvproxy PID to die before shutting down). The
client is run inside the VM, also by `podman machine start`, and
mounts uses kernel 9p mount code to complete the mount. It's
unfortunately not possible to use mount directly without the
wrapper; we need to set up the vsock and pass it to mount as an
FD.

In theory this can be generalized so that the server can run
anywhere and over almost any transport, but I haven't done this
here as I don't think we have a usecase other than HyperV right
now.

[NO NEW TESTS NEEDED] This requires changes to Podman in the VM,
so we need to wait until a build with this lands in FCOS to test.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-10-31 10:14:02 -04:00
95a5ad258b Small fixes for wacko CI environments
In the unusual case where the `runtimeDir` is not already created, we
should do so on `machine init`.

When starting gvproxy from podman, we now ensure it is running (for
applehv) but waiting for the unixgram socket to appear in the filesystem
before moving on.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-10-27 10:33:39 -05:00
1850670f1e Fix typo
Signed-off-by: Alan Cha <Alan.cha1@ibm.com>
2023-10-23 23:21:55 -04:00
3661c87d3c Merge pull request #20412 from ashley-cui/lastup
hyperV: Update lastUp time
2023-10-21 18:05:48 +00:00
d6f44d956d hyperV: Update lastUp time
LastUp now correctly reports the lastUp time for podman machine on
hyperv, for both inspect and list.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-10-20 15:00:48 -04:00
64f43fed4d lint: fix warnings found by inamedparam
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-20 16:27:41 +02:00
4c249a219e Change default QEMU CPU level to qemu64 on Windows amd64
Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
2023-10-19 00:37:09 +03:00
9a29eb05ef Merge pull request #20400 from baude/issue20361
Fix path for omvf vars on Darwin/arm64
2023-10-18 20:07:53 +00:00
d4d76479c1 Kill gvproxy when machine rm -f
In applehv, we were not killing gvproxy when stopping via podman machine rm with force.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-10-18 12:12:23 -05:00
cad4d0ee9f Fix path for omvf vars on Darwin/arm64
On darwin arm64, we need to set the location of the ovmf vars. It should be put into the imageDir (also known as as dataDir).  But because qemu determines the image path late in Init(), the image path is set something like a stream marker.

Fixes #20361

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-10-18 10:40:08 -05:00
aa0e96e781 Merge pull request #20274 from ashley-cui/cleanup
Machine: Teardown on init failure
2023-10-13 14:22:46 +00:00
5afa949a43 Merge pull request #20322 from jakecorrenti/set-lock
Implement SetLock for all virt providers
2023-10-12 23:15:40 +00:00
cb53bcf23f Run codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-12 12:45:44 -04:00
987dc2b8bb SetLock for all virt providers
Implements a shared `GetLock` function for virtualization providers. Returns
a pointer to a lockfile used for serializing write operations.

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-10-12 12:06:31 -04:00
61e0b64b91 Machine: Teardown on init failure
If init fails, or if a SIGINT is sent during init, podman machine should remove all files and configs
created during the init. This includes config jsons, image files, ssh
id's, and system connections. On Windows, the VM instances are also
unregistered.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-10-12 09:26:06 -04:00
158b11a10d Merge pull request #20245 from jakecorrenti/qemu-wrapper
Create Qemu command wrapper
2023-10-05 12:38:30 +00:00
516a03a6f2 Merge pull request #20266 from n1hility/fix-resolved-disable
Adjust to path name change for resolved unit on WSL backend
2023-10-05 08:21:30 +00:00
0414f88b3a Create Qemu command wrapper
Creates a wrapper around the Qemu command line implementation to prevent
the need to hard-code the different command line options in Init and
Start.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-10-04 23:17:15 -04:00
df6a000263 Adjust to path name change for resolved unit
Leave the legacy name around for now

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-10-04 17:12:03 -05:00
2a38f30b6c Revert "Fix WSL systemd detection"
This reverts commit 5b990c3835ac167cc7f5b51fae3f719edf031965.
PR #19994

Causes wsl nsenter script to infinitely loop in standard operation

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-10-04 16:25:47 -05:00
e78e76c237 Merge pull request #20205 from jakecorrenti/build-applehv-intel
Build applehv for Intel Macs
2023-10-04 12:55:04 +00:00
cbca395291 Fix locale issues with WSL version detection
Since wsl --version triggers help, which triggers an error code,
use that instead of text detection.

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-10-03 08:37:27 -05:00
85ed9eddef Build applehv for Intel Macs
Changes build tags to allow the applehv code to be built for Intel Macs

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-09-29 22:42:22 -04:00
59e0919bc7 update vfkit vendored code
upstream reversed width and height and now we get an unusable gui

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-29 12:46:58 -05:00
cc8c28eb7c Merge pull request #20198 from jakecorrenti/remove-extra-files-line
Remove `c.ExtraFiles` line in machine
2023-09-29 06:41:02 -04:00
26ae0ba851 Merge pull request #20190 from baude/issue20122
podman machine: disable zincati update service
2023-09-28 21:14:20 -04:00
9b39641116 Remove c.ExtraFiles line in machine
Removes the line in applehv and qemu `machine.go` file. These are
remnants from #19723. This lines was written to add stdin, stdout,
stderr as extra files, but that is not how `c.ExtraFiles` works (unlike
`os.ProcAttr`).

go source: https://cs.opensource.google/go/go/+/go1.21.1:src/os/exec/exec.go;l=147

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-09-28 19:24:06 -04:00
5e216a2a74 Merge pull request #20193 from ashley-cui/lastupnever
New machines should show Never as LastUp
2023-09-28 17:59:19 -04:00
bcfd9f3403 New machines should show Never as LastUp
After creating a podman machine, and before starting it, the LastUp value for podman machine ls should display Never. Previously, the LastUp value was the same as creation time. This also changes the LastUp value for inspect to ZeroTime instead of creation time.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-28 14:16:26 -04:00
94818f5941 podman machine: disable zincati update service
As explained in #21022, there are all kinds of downsides to a machine
updating itself (via zincati) automatically, like interuption of
service, lost mounts, etc.

disabling zincati will at least allow stop these downsides.  we are
likely to contemplate if podman will take over the update process
externally where interuption of services will not occur etc.

Fixes #20122

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-28 13:01:52 -05:00
5b990c3835 Fix WSL systemd detection
[NO NEW TESTS NEEDED]

Signed-off-by: Frederik Boster <frederik@boster.de>
2023-09-28 12:18:11 +02:00
0d4526e61c wsl: enable machine init tests
many of wsl's attributes are not as configurable as other providers.
small tweaks and conditional tests have been added.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-27 12:10:08 -05:00
d05c77799b Merge pull request #20159 from baude/applehvenablerm
applehv: machine tests for stop and rm
2023-09-27 09:13:32 -04:00
31f9e678fa Merge pull request #20160 from baude/applehvenablestart
applehv: enable machine tests for start
2023-09-27 04:41:54 -04:00
1724944234 applehv: enable machine tests for start
leftover debug was breaking -q tests

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-26 16:02:41 -05:00
2ff43429f7 applehv: machine tests for stop and rm
change behaviour of stopped a stopped/exited machine to match qemu in that stopping a stopped machine is NOT an error.

add condition to machine rm where rm is not run twice due to a logic error

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-09-26 15:30:36 -05:00
127ebe2b27 Update machine tests README
Windows now has a winmake file for easier testing, so document that.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-26 15:51:33 -04:00
995a6a8ac4 Add podman socket info to machine inspect
HyperV and appleHV machine inspect commands were missing podman socket
info. This also fixes machine inspect tests on hyperV

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-26 15:50:00 -04:00
80952db0ba Fix podman machine info test for hyperV
We do not guarantee that the amount of machines that exist on the system
is 0 before running a test.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-09-26 15:49:55 -04:00