]> git.proxmox.com Git - pve-esxi-import-tools.git/log
pve-esxi-import-tools.git
5 days agobump version to 0.7.2 master
Thomas Lamprecht [Thu, 12 Sep 2024 10:27:13 +0000 (12:27 +0200)]
bump version to 0.7.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 days agocargo: update pico-args dependency to version 0.5
Thomas Lamprecht [Thu, 12 Sep 2024 10:29:41 +0000 (12:29 +0200)]
cargo: update pico-args dependency to version 0.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 days agofix #5587: add support for older version of vmx storage filepaths
Daniel Kral [Wed, 21 Aug 2024 13:57:48 +0000 (15:57 +0200)]
fix #5587: add support for older version of vmx storage filepaths

Allow the ESXi storage disk entry property "fileName" to be flatcased
("filename") in addition to being camelcased ("fileName"). This adds
compatibility with older ESXi .vmx configuration files.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
2 months agobuild: force debug symbols in release build
Fabian Grünbichler [Thu, 20 Jun 2024 08:32:12 +0000 (10:32 +0200)]
build: force debug symbols in release build

they then get stripped into their own package anyway, but without this we don't
get debug symbols at all with rustc >= 1.77

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agobump version to 0.7.1
Wolfgang Bumiller [Fri, 7 Jun 2024 11:23:51 +0000 (13:23 +0200)]
bump version to 0.7.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoimprove error handling before mounting
Dominik Csapak [Fri, 10 May 2024 13:56:57 +0000 (15:56 +0200)]
improve error handling before mounting

when we fail early in the mount process, we did not log any error to the
syslog, but only the top most one to stderr.

sadly we were not able to see them anywhere, so improve the log by
* log the complete error chain with log::error (so we also can see the
  causes)
* add more context hints

This can help debug issues where we failed early and could not see any
error output otherwise, e.g. this thread in the forum:

https://forum.proxmox.com/threads/146248/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agofix --help output formatting
Wolfgang Bumiller [Fri, 5 Apr 2024 06:18:58 +0000 (08:18 +0200)]
fix --help output formatting

For the sake of having the string indented, we use
backslash-line-continuations, but they swallow up all the spaces at
the beginning of the next line, so we use `\n  \` explicitly with
spaces between the newline and the line-continuation to introduce the
indentation in the output.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump version to 0.7.0
Thomas Lamprecht [Thu, 4 Apr 2024 16:18:52 +0000 (18:18 +0200)]
bump version to 0.7.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: add help and version flags as long and short option
Thomas Lamprecht [Thu, 4 Apr 2024 16:10:55 +0000 (18:10 +0200)]
esxi: add help and version flags as long and short option

even though this is in libexec and not meant for direct use it can be
still useful to get the version of the installed file to compare with
the one of a mounted FS, or to get the help output if one is testing
something manually.

So add the classic -v or --version and the -h or --help flags,
respectively.

Any of those will cause an early (successful) exit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoversion file: skip repo revision for now
Thomas Lamprecht [Thu, 4 Apr 2024 15:53:27 +0000 (17:53 +0200)]
version file: skip repo revision for now

The current git revision is not exposed by cargo, so we'd need a
build.rs script to get this, like we do in PBS (well in a sub-crate to
avoid frequent costly rebuilds). For now that's not worth it, having
the version exposed is enough to see if the mount is old.

And do not concat the three version atoms manually, we can use the
CARGO_PKG_VERSION environment variable.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoadd .version file to root of the fuse mount
Wolfgang Bumiller [Thu, 4 Apr 2024 14:33:29 +0000 (16:33 +0200)]
add .version file to root of the fuse mount

containing 2 lines:
1) the cargo version as
2) the git commit hash

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agocatch NotFound in handle_lookup explicitly
Wolfgang Bumiller [Wed, 3 Apr 2024 07:48:48 +0000 (09:48 +0200)]
catch NotFound in handle_lookup explicitly

this is currently not produced, but better safe than sorry, since we
do have NotFound as well as Errno(ENOENT) meaning the same thing

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agouse send_replace on watch channels
Wolfgang Bumiller [Thu, 4 Apr 2024 13:24:21 +0000 (15:24 +0200)]
use send_replace on watch channels

To avoid errors about closed channels, as we'd then keep a receiver
without a sender in the active-lookup tables.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agouse new InodeEntries for Datastores
Wolfgang Bumiller [Wed, 3 Apr 2024 07:45:42 +0000 (09:45 +0200)]
use new InodeEntries for Datastores

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agofactor deduplicated entry lookup out of Dir
Wolfgang Bumiller [Wed, 3 Apr 2024 07:35:39 +0000 (09:35 +0200)]
factor deduplicated entry lookup out of Dir

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agorefcount cache enable state
Wolfgang Bumiller [Thu, 4 Apr 2024 13:40:18 +0000 (15:40 +0200)]
refcount cache enable state

Otherwise, if the kernel has multiple `Open` requests for a file, a
`Release` request will disable the cache for all of them. This was
not a problem without Open/Release, as Lookups aren't dropped as long
as any references are around...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump version to 0.6.1
Thomas Lamprecht [Tue, 2 Apr 2024 08:23:53 +0000 (10:23 +0200)]
bump version to 0.6.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoreformat let-else for better readability
Thomas Lamprecht [Tue, 2 Apr 2024 08:30:37 +0000 (10:30 +0200)]
reformat let-else for better readability

`cargo fmt` still mostly ignores let-else, so format it manually in
how most examples use it, with the just the inside of the else branch
block on a new, indented line. As otherwise, with no indentation
change between the assignment and the else in a new line it reads like
being two separate statements.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoupdate gitignore file
Thomas Lamprecht [Tue, 2 Apr 2024 08:26:04 +0000 (10:26 +0200)]
update gitignore file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agouse session cookie to avoid generating a new one on each request
Wolfgang Bumiller [Tue, 2 Apr 2024 07:36:34 +0000 (09:36 +0200)]
use session cookie to avoid generating a new one on each request

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump version to 0.6.0
Thomas Lamprecht [Thu, 28 Mar 2024 15:09:58 +0000 (16:09 +0100)]
bump version to 0.6.0

just to get the slightly more understandable (from user POV) changelog
update out

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agod/changelog: expand and reword slightly
Thomas Lamprecht [Thu, 28 Mar 2024 13:42:30 +0000 (14:42 +0100)]
d/changelog: expand and reword slightly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobump version to 0.5.1
Wolfgang Bumiller [Thu, 28 Mar 2024 12:44:42 +0000 (13:44 +0100)]
bump version to 0.5.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoattempt to negotiate http2 protocol via alpn
Wolfgang Bumiller [Thu, 28 Mar 2024 12:21:27 +0000 (13:21 +0100)]
attempt to negotiate http2 protocol via alpn

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump d/control
Wolfgang Bumiller [Thu, 28 Mar 2024 12:21:15 +0000 (13:21 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoexplicitly enable http2 in hyper
Wolfgang Bumiller [Thu, 28 Mar 2024 10:20:39 +0000 (11:20 +0100)]
explicitly enable http2 in hyper

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agofix error message when not finding password-file
Wolfgang Bumiller [Thu, 28 Mar 2024 12:11:39 +0000 (13:11 +0100)]
fix error message when not finding password-file

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoguard read requests so they cannot fail with ENOSYS
Wolfgang Bumiller [Thu, 28 Mar 2024 09:51:31 +0000 (10:51 +0100)]
guard read requests so they cannot fail with ENOSYS

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoupdate help to show how to specify a port
Wolfgang Bumiller [Thu, 28 Mar 2024 09:40:26 +0000 (10:40 +0100)]
update help to show how to specify a port

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolitvms: add --port parameter
Wolfgang Bumiller [Thu, 28 Mar 2024 09:33:27 +0000 (10:33 +0100)]
litvms: add --port parameter

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoupdate d/control
Wolfgang Bumiller [Wed, 27 Mar 2024 15:54:57 +0000 (16:54 +0100)]
update d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoclamp worker threads between 2 and 4 based on core count
Wolfgang Bumiller [Wed, 27 Mar 2024 15:54:18 +0000 (16:54 +0100)]
clamp worker threads between 2 and 4 based on core count

via num_cpus

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolimit async runtime to 4 worker and 2 blocking threads
Wolfgang Bumiller [Wed, 27 Mar 2024 15:12:36 +0000 (16:12 +0100)]
limit async runtime to 4 worker and 2 blocking threads

like we do for the qemu backup drivers, instead of having tokio just
spawn as many as there are cores, which is excessive...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump version to 0.5.0
Thomas Lamprecht [Wed, 27 Mar 2024 14:20:41 +0000 (15:20 +0100)]
bump version to 0.5.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoactually fail reads on http 500
Wolfgang Bumiller [Wed, 27 Mar 2024 13:57:37 +0000 (14:57 +0100)]
actually fail reads on http 500

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolimit to 4 concurrent requests and synchronize retry loops
Wolfgang Bumiller [Wed, 27 Mar 2024 13:45:11 +0000 (14:45 +0100)]
limit to 4 concurrent requests and synchronize retry loops

this is a very simple variant with a semaphore for the concurrent
requests and a mutex for the retry loop...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump version to 0.4.1
Thomas Lamprecht [Wed, 27 Mar 2024 11:37:06 +0000 (12:37 +0100)]
bump version to 0.4.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi fuse: reduce log of retrying due to rate-limit to warn
Thomas Lamprecht [Wed, 27 Mar 2024 11:36:35 +0000 (12:36 +0100)]
esxi fuse: reduce log of retrying due to rate-limit to warn

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobump version to 0.4.0
Thomas Lamprecht [Wed, 27 Mar 2024 11:21:53 +0000 (12:21 +0100)]
bump version to 0.4.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agofix-up version tracked in cargo.toml
Thomas Lamprecht [Wed, 27 Mar 2024 11:21:36 +0000 (12:21 +0100)]
fix-up version tracked in cargo.toml

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobuildsys: skip checking build-dependencies for generating the DSC
Thomas Lamprecht [Wed, 27 Mar 2024 11:19:01 +0000 (12:19 +0100)]
buildsys: skip checking build-dependencies for generating the DSC

allows to build a DSC that is then further used via sbuild, or the
like, without having to install all build-dependencies on the host one
is connected to.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobump version to 0.4.0
Thomas Lamprecht [Wed, 27 Mar 2024 11:13:14 +0000 (12:13 +0100)]
bump version to 0.4.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agolistvms: remove unused import and unaccessed exception
Max Carrara [Wed, 27 Mar 2024 10:38:56 +0000 (11:38 +0100)]
listvms: remove unused import and unaccessed exception

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms.py: improve error message when password file is missing
Wolfgang Bumiller [Wed, 27 Mar 2024 09:51:33 +0000 (10:51 +0100)]
listvms.py: improve error message when password file is missing

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: improve error message for invalid credentials
Wolfgang Bumiller [Wed, 27 Mar 2024 09:45:41 +0000 (10:45 +0100)]
listvms.py: improve error message for invalid credentials

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: just print the errors as they are
Wolfgang Bumiller [Wed, 27 Mar 2024 09:45:18 +0000 (10:45 +0100)]
listvms.py: just print the errors as they are

they are unexpected by nature...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: drop squeeze helper
Wolfgang Bumiller [Wed, 27 Mar 2024 09:34:05 +0000 (10:34 +0100)]
listvms.py: drop squeeze helper

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: actually don't use Path for the types
Wolfgang Bumiller [Wed, 27 Mar 2024 09:27:17 +0000 (10:27 +0100)]
listvms.py: actually don't use Path for the types

we just want to pass whatever we get onward to perl & rust and not
place restrictions on it

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agouse mypy for automatic type checks in Python
Max Carrara [Fri, 22 Mar 2024 18:06:24 +0000 (19:06 +0100)]
use mypy for automatic type checks in Python

This commit adds mypy [0] as build dependency and ensures it is
invoked during the package build process.

mypy can also be manually invoked via `make lint`.

A mypy.ini file [1] is also added to disable errors regarding missing
type stubs for pyVmomi and pyVim.

[0]: https://www.mypy-lang.org/
[1]: https://mypy.readthedocs.io/en/stable/config_file.html

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms: run formatter
Max Carrara [Fri, 22 Mar 2024 18:06:23 +0000 (19:06 +0100)]
listvms: run formatter

This commit formats the script using `black -l 80` [0], even though we
don't have an official style guide for Python.

[0]: https://github.com/psf/black

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms: dump json directly to stdout
Max Carrara [Fri, 22 Mar 2024 18:06:22 +0000 (19:06 +0100)]
listvms: dump json directly to stdout

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms: add arg parser, context manager for connections, fetch helper
Max Carrara [Fri, 22 Mar 2024 18:06:21 +0000 (19:06 +0100)]
listvms: add arg parser, context manager for connections, fetch helper

In order to make the CLI interface more friendly to humans, Python's
`argparse` [0] module from the standard library is used to parse the
arguments provided to the script. Each option and positional argument
also contain a short help text that is shown when running the script
with either "-h" or "--help".

Additionally, this commit also adds a context manager [1] for
establishing connections to an ESXi host. The context manager ensures
that the connection is closed in its inner `finally` block.

The inner part of the VM-data-fetching loop in `main()` is factored
out into a separate helper function, which now raises a `RuntimeError`
if the datacenter of a VM cannot be looked up.

In general, should any exception be thrown inside the loop, its output
is subsequently logged to stderr. The loop then just continues like
before.

Any exception that is not caught inside of `main()` is now printed to
stderr, followed by exiting with `1`.

Overall, the script's behaviour and output on successful operations
remains the same, except regarding unsuccessful argument parsing and
displaying error messages. In other words, invocations prior to this
patch should result in the same JSON output (if successful).

This was tested by piping the outputs of this script before and after
this commit through `jq` and then comparing the outputs with `diff`.

[0]: https://docs.python.org/3.11/library/argparse.html
[1]: https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms: improve typing and add dataclasses to represent dicts
Max Carrara [Fri, 22 Mar 2024 18:06:20 +0000 (19:06 +0100)]
listvms: improve typing and add dataclasses to represent dicts

This commit replaces some of the explicitly imported types from the
`typing` module with their inbuilt counterparts, e.g. `typing.List`
becomes `list`. This is supported since Python 3.9 [0].

Additionally, file paths are now represented as `pathlib.Path` [1],
which also checks whether the given string is actually a valid path
when constructed.

Furthermore, the `dict`s with values of mixed types are now
represented as dataclasses [2] instead, in order to make them more
type-safe (--> allow for better linting).

Because dataclasses and `pathlib.Path`s are not JSON-serializable by
default however, a helper function is added, which allows for more
fine-grained control regarding how those objects are serialized.

[0]: https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections
[1]: https://docs.python.org/3.11/library/pathlib.html
[2]: https://docs.python.org/3.11/library/dataclasses.html

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms: reorder imports
Max Carrara [Fri, 22 Mar 2024 18:06:19 +0000 (19:06 +0100)]
listvms: reorder imports

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agolistvms: remove unused import and variable
Max Carrara [Fri, 22 Mar 2024 18:06:18 +0000 (19:06 +0100)]
listvms: remove unused import and variable

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
5 months agobump version to 0.3.0
Thomas Lamprecht [Fri, 22 Mar 2024 15:14:31 +0000 (16:14 +0100)]
bump version to 0.3.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoreduce log spam on startup, log when the mount is ready
Wolfgang Bumiller [Fri, 22 Mar 2024 12:19:56 +0000 (13:19 +0100)]
reduce log spam on startup, log when the mount is ready

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump d/control
Wolfgang Bumiller [Fri, 22 Mar 2024 12:17:24 +0000 (13:17 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: reword certificate validation error
Wolfgang Bumiller [Fri, 22 Mar 2024 10:48:07 +0000 (11:48 +0100)]
listvms.py: reword certificate validation error

this seems to be more clear and describes the specific actions to take
less ambiguously

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: make cert validation errors show a more conside message
Wolfgang Bumiller [Fri, 22 Mar 2024 10:00:38 +0000 (11:00 +0100)]
listvms.py: make cert validation errors show a more conside message

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agolistvms.py: output connection error via stderr
Wolfgang Bumiller [Fri, 22 Mar 2024 09:55:33 +0000 (10:55 +0100)]
listvms.py: output connection error via stderr

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agodepend on proxmox-fuse 0.1.7 so --change-user/group work
Wolfgang Bumiller [Thu, 21 Mar 2024 11:35:05 +0000 (12:35 +0100)]
depend on proxmox-fuse 0.1.7 so --change-user/group work

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agomake datastores discoverable
Wolfgang Bumiller [Tue, 19 Mar 2024 14:11:37 +0000 (15:11 +0100)]
make datastores discoverable

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agobump version to 0.2.0
Thomas Lamprecht [Tue, 12 Mar 2024 15:00:57 +0000 (16:00 +0100)]
bump version to 0.2.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoRevert "buildsys: add d/rustup_home, register force system toolchain"
Thomas Lamprecht [Tue, 12 Mar 2024 15:14:31 +0000 (16:14 +0100)]
Revert "buildsys: add d/rustup_home, register force system toolchain"

This reverts commit 826e60c5c59f05cc3a0ac033a66f16d0f46ef89a, it's
introduction of an absolute link to /usr breaks source directory
boundary, failing dpkg-source.

Devs that need to have rustup and related binaries earlier in $PATH
than the system ones can just create a system toolchain via something
like `rustup toolchain link system /usr` and be done, it's their
custom setup/environment that breaks build, so default packaging
should not have to care, at least not in a way that breaks default
build in clean environments (like sbuild).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agorename --insecure option to --skip-cert-verification
Thomas Lamprecht [Tue, 12 Mar 2024 14:59:23 +0000 (15:59 +0100)]
rename --insecure option to --skip-cert-verification

a bit more telling about what it actually does.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: clean-up more
Thomas Lamprecht [Tue, 12 Mar 2024 15:05:00 +0000 (16:05 +0100)]
buildsys: clean-up more

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobump version to 0.1.2
Wolfgang Bumiller [Tue, 12 Mar 2024 12:46:53 +0000 (13:46 +0100)]
bump version to 0.1.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi-folder-fuse: add --insecure option
Wolfgang Bumiller [Tue, 12 Mar 2024 12:45:38 +0000 (13:45 +0100)]
esxi-folder-fuse: add --insecure option

to disable certificate verification, and verify certificates by
default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agolistvms.py: add --insecure parameter, verify cert by default
Wolfgang Bumiller [Tue, 12 Mar 2024 12:29:58 +0000 (13:29 +0100)]
listvms.py: add --insecure parameter, verify cert by default

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agobump version to 0.1.1
Wolfgang Bumiller [Tue, 12 Mar 2024 08:17:12 +0000 (09:17 +0100)]
bump version to 0.1.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agolistvms.py: include power status in vm info
Wolfgang Bumiller [Mon, 11 Mar 2024 12:46:08 +0000 (13:46 +0100)]
listvms.py: include power status in vm info

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agolistvms.py: don't iterate through vms twice, add disk info
Wolfgang Bumiller [Mon, 11 Mar 2024 10:12:11 +0000 (11:12 +0100)]
listvms.py: don't iterate through vms twice, add disk info

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agolistvms.py: add function to query disk info for vms
Wolfgang Bumiller [Mon, 11 Mar 2024 10:11:44 +0000 (11:11 +0100)]
listvms.py: add function to query disk info for vms

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agolistvms.py: factor out datastore/path file name parsing
Wolfgang Bumiller [Mon, 11 Mar 2024 10:11:11 +0000 (11:11 +0100)]
listvms.py: factor out datastore/path file name parsing

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agobuildsys: add d/rustup_home, register force system toolchain
Wolfgang Bumiller [Mon, 11 Mar 2024 12:22:15 +0000 (13:22 +0100)]
buildsys: add d/rustup_home, register force system toolchain

and set RUSTUP_HOME in d/rules, so building also actually works when
rustup is in $PATH

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agobump version to 0.1.0
Thomas Lamprecht [Fri, 8 Mar 2024 14:17:10 +0000 (15:17 +0100)]
bump version to 0.1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: drop odd cargo/rustc overrides
Thomas Lamprecht [Sun, 10 Mar 2024 15:10:19 +0000 (16:10 +0100)]
buildsys: drop odd cargo/rustc overrides

those should not be required for a functioning build..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: allow to generate packages artefacts at the top-level
Thomas Lamprecht [Sun, 10 Mar 2024 14:45:04 +0000 (15:45 +0100)]
buildsys: allow to generate packages artefacts at the top-level

Allow building packages with their output being written at the
top-level, just like basically all our other repos (that contain a
hand-full of source packages at max), and make that the default.

If one want to have a double directory hierarchy for the build they
can just call:
 make OUTPUT_DIR=build/ deb

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agopackagin: ship script and tool in arch-agnostic /usr/libexec
Thomas Lamprecht [Sun, 10 Mar 2024 14:39:55 +0000 (15:39 +0100)]
packagin: ship script and tool in arch-agnostic /usr/libexec

no need to use the architecture triple, not like we plan to support
co-installable multi-arch anyway.

Rather just use the arch-agnostic /usr/libexec dir, which the FHS
specifies for:
> Directory contains binaries for internal use only and they are not
> meant to be executed directly by users shell or scripts.

Which pretty much is what this tools are made for, in our use case
anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/control: avoid rust- prefix for source package name
Thomas Lamprecht [Fri, 8 Mar 2024 14:57:38 +0000 (15:57 +0100)]
d/control: avoid rust- prefix for source package name

not using debcargo so we do not need to adhere to it's quirks

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: avoid dcmd, just use already defined variables
Thomas Lamprecht [Fri, 8 Mar 2024 14:56:06 +0000 (15:56 +0100)]
buildsys: avoid dcmd, just use already defined variables

makes it easier to copy this from a build host to an upload host by
allowing to see the full command when running `make -n upload`

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: add convenience sbuild target
Thomas Lamprecht [Fri, 8 Mar 2024 14:54:36 +0000 (15:54 +0100)]
buildsys: add convenience sbuild target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: track dbgsym package
Thomas Lamprecht [Fri, 8 Mar 2024 14:54:14 +0000 (15:54 +0100)]
buildsys: track dbgsym package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: use variables for output and build directory
Thomas Lamprecht [Fri, 8 Mar 2024 14:53:11 +0000 (15:53 +0100)]
buildsys: use variables for output and build directory

the target directories are still named in a slightly confusing way,
but don't care about that for now.

If it's really a problem we could use output/ for the, well, output
directory variable.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: DSC has no arch
Thomas Lamprecht [Fri, 8 Mar 2024 14:51:35 +0000 (15:51 +0100)]
buildsys: DSC has no arch

it's the source package which normally is arch agnostic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/source: mark as native package
Thomas Lamprecht [Fri, 8 Mar 2024 14:49:29 +0000 (15:49 +0100)]
d/source: mark as native package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoadd upload target
Wolfgang Bumiller [Tue, 5 Mar 2024 14:08:11 +0000 (15:08 +0100)]
add upload target

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agopackaging updates
Wolfgang Bumiller [Tue, 5 Mar 2024 13:56:58 +0000 (14:56 +0100)]
packaging updates

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agomore eof handling fixups
Wolfgang Bumiller [Thu, 29 Feb 2024 11:01:11 +0000 (12:01 +0100)]
more eof handling fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agolru rotation fixup
Wolfgang Bumiller [Mon, 26 Feb 2024 14:39:39 +0000 (15:39 +0100)]
lru rotation fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agodeal with file size changes during reading
Wolfgang Bumiller [Wed, 21 Feb 2024 14:44:12 +0000 (15:44 +0100)]
deal with file size changes during reading

We cache file sizes, but if the vmx config files change they can of
course very well also change their size, in which case we might get an
http 416 Range Not Satisfiable response. Let's consider the File
handle to be at EOF at that point.

additionally, partial reads return a `content-range` header which
includes the file's size, so use this to keep track of it

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agodrop file caches on close
Wolfgang Bumiller [Wed, 21 Feb 2024 12:54:22 +0000 (13:54 +0100)]
drop file caches on close

makes reading updated vmx files easier

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agobump d/control
Wolfgang Bumiller [Thu, 15 Feb 2024 13:02:45 +0000 (14:02 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agoswitch from env_logger to syslog
Wolfgang Bumiller [Thu, 15 Feb 2024 13:02:17 +0000 (14:02 +0100)]
switch from env_logger to syslog

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agoadd --ready-fd parameter
Wolfgang Bumiller [Thu, 15 Feb 2024 12:41:10 +0000 (13:41 +0100)]
add --ready-fd parameter

a simple way to signal readiness - we just close the file descriptor
when we start serving fuse requests

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agoadd options to drop privileges
Wolfgang Bumiller [Thu, 15 Feb 2024 12:06:30 +0000 (13:06 +0100)]
add options to drop privileges

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agolistvms.py: make connection errors less noisy
Wolfgang Bumiller [Thu, 15 Feb 2024 09:34:53 +0000 (10:34 +0100)]
listvms.py: make connection errors less noisy

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agod/control: fixup python3 deps
Wolfgang Bumiller [Thu, 15 Feb 2024 09:16:23 +0000 (10:16 +0100)]
d/control: fixup python3 deps

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agobuildsys improvements
Wolfgang Bumiller [Thu, 15 Feb 2024 09:11:20 +0000 (10:11 +0100)]
buildsys improvements

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>