Compare commits
11 Commits
v0.9.90
...
a66449541d
Author | SHA1 | Date | |
---|---|---|---|
a66449541d | |||
d28fb71f57 | |||
e5e9c7086a | |||
f29b4c2755 | |||
0adec2be0d | |||
b994e1a26c | |||
6d6420a695 | |||
94e0287fc4 | |||
2886176762 | |||
4dc4c975f1 | |||
8f3120baf3 |
@ -1,5 +1,13 @@
|
|||||||
## PVC Changelog
|
## PVC Changelog
|
||||||
|
|
||||||
|
###### [v0.9.91](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.91)
|
||||||
|
|
||||||
|
* [Client CLI] Fixes a bug and improves output during cluster task events.
|
||||||
|
* [Client CLI] Improves the output of the task list display.
|
||||||
|
* [Provisioner] Fixes some missing cloud-init modules in the default debootstrap script.
|
||||||
|
* [Client CLI] Fixes a bug with a missing argument to the vm_define helper function.
|
||||||
|
* [All] Fixes inconsistent package find + rm commands to avoid errors in dpkg.
|
||||||
|
|
||||||
###### [v0.9.90](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.90)
|
###### [v0.9.90](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.90)
|
||||||
|
|
||||||
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
||||||
|
@ -150,6 +150,10 @@
|
|||||||
from daemon_lib.vmbuilder import VMBuilder
|
from daemon_lib.vmbuilder import VMBuilder
|
||||||
|
|
||||||
|
|
||||||
|
# These are some global variables used below
|
||||||
|
default_root_password = "test123"
|
||||||
|
|
||||||
|
|
||||||
# The VMBuilderScript class must be named as such, and extend VMBuilder.
|
# The VMBuilderScript class must be named as such, and extend VMBuilder.
|
||||||
class VMBuilderScript(VMBuilder):
|
class VMBuilderScript(VMBuilder):
|
||||||
def setup(self):
|
def setup(self):
|
||||||
@ -498,11 +502,15 @@ class VMBuilderScript(VMBuilder):
|
|||||||
ret = os.system(
|
ret = os.system(
|
||||||
f"debootstrap --include={','.join(deb_packages)} {deb_release} {temp_dir} {deb_mirror}"
|
f"debootstrap --include={','.join(deb_packages)} {deb_release} {temp_dir} {deb_mirror}"
|
||||||
)
|
)
|
||||||
|
ret = int(ret >> 8)
|
||||||
if ret > 0:
|
if ret > 0:
|
||||||
self.fail("Failed to run debootstrap")
|
self.fail(f"Debootstrap failed with exit code {ret}")
|
||||||
|
|
||||||
# Bind mount the devfs so we can grub-install later
|
# Bind mount the devfs so we can grub-install later
|
||||||
os.system("mount --bind /dev {}/dev".format(temp_dir))
|
ret = os.system("mount --bind /dev {}/dev".format(temp_dir))
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"/dev bind mount failed with exit code {ret}")
|
||||||
|
|
||||||
# Create an fstab entry for each volume
|
# Create an fstab entry for each volume
|
||||||
fstab_file = "{}/etc/fstab".format(temp_dir)
|
fstab_file = "{}/etc/fstab".format(temp_dir)
|
||||||
@ -589,11 +597,13 @@ After=multi-user.target
|
|||||||
- migrator
|
- migrator
|
||||||
- bootcmd
|
- bootcmd
|
||||||
- write-files
|
- write-files
|
||||||
|
- growpart
|
||||||
- resizefs
|
- resizefs
|
||||||
- set_hostname
|
- set_hostname
|
||||||
- update_hostname
|
- update_hostname
|
||||||
- update_etc_hosts
|
- update_etc_hosts
|
||||||
- ca-certs
|
- ca-certs
|
||||||
|
- users-groups
|
||||||
- ssh
|
- ssh
|
||||||
|
|
||||||
cloud_config_modules:
|
cloud_config_modules:
|
||||||
@ -686,23 +696,36 @@ GRUB_DISABLE_LINUX_UUID=false
|
|||||||
# Do some tasks inside the chroot using the provided context manager
|
# Do some tasks inside the chroot using the provided context manager
|
||||||
with chroot(temp_dir):
|
with chroot(temp_dir):
|
||||||
# Install and update GRUB
|
# Install and update GRUB
|
||||||
os.system(
|
ret = os.system(
|
||||||
"grub-install --force /dev/rbd/{}/{}_{}".format(
|
"grub-install --force /dev/rbd/{}/{}_{}".format(
|
||||||
root_volume["pool"], vm_name, root_volume["disk_id"]
|
root_volume["pool"], vm_name, root_volume["disk_id"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
os.system("update-grub")
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"GRUB install failed with exit code {ret}")
|
||||||
|
|
||||||
|
ret = os.system("update-grub")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"GRUB update failed with exit code {ret}")
|
||||||
|
|
||||||
# Set a really dumb root password so the VM can be debugged
|
# Set a really dumb root password so the VM can be debugged
|
||||||
# EITHER CHANGE THIS YOURSELF, here or in Userdata, or run something after install
|
# EITHER CHANGE THIS YOURSELF, here or in Userdata, or run something after install
|
||||||
# to change the root password: don't leave it like this on an Internet-facing machine!
|
# to change the root password: don't leave it like this on an Internet-facing machine!
|
||||||
os.system("echo root:test123 | chpasswd")
|
ret = os.system(f"echo root:{default_root_password} | chpasswd")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Root password change failed with exit code {ret}")
|
||||||
|
|
||||||
# Enable cloud-init target on (first) boot
|
# Enable cloud-init target on (first) boot
|
||||||
# Your user-data should handle this and disable it once done, or things get messy.
|
# Your user-data should handle this and disable it once done, or things get messy.
|
||||||
# That cloud-init won't run without this hack seems like a bug... but even the official
|
# That cloud-init won't run without this hack seems like a bug... but even the official
|
||||||
# Debian cloud images are affected, so who knows.
|
# Debian cloud images are affected, so who knows.
|
||||||
os.system("systemctl enable cloud-init.target")
|
ret = os.system("systemctl enable cloud-init.target")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Enable of cloud-init failed with exit code {ret}")
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""
|
"""
|
||||||
@ -727,7 +750,7 @@ GRUB_DISABLE_LINUX_UUID=false
|
|||||||
temp_dir = "/tmp/target"
|
temp_dir = "/tmp/target"
|
||||||
|
|
||||||
# Unmount the bound devfs
|
# Unmount the bound devfs
|
||||||
os.system("umount {}/dev".format(temp_dir))
|
os.system("umount -f {}/dev".format(temp_dir))
|
||||||
|
|
||||||
# Use this construct for reversing the list, as the normal reverse() messes with the list
|
# Use this construct for reversing the list, as the normal reverse() messes with the list
|
||||||
for volume in list(reversed(self.vm_data["volumes"])):
|
for volume in list(reversed(self.vm_data["volumes"])):
|
||||||
@ -744,7 +767,7 @@ GRUB_DISABLE_LINUX_UUID=false
|
|||||||
):
|
):
|
||||||
# Unmount filesystem
|
# Unmount filesystem
|
||||||
retcode, stdout, stderr = pvc_common.run_os_command(
|
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||||
f"umount {mount_path}"
|
f"umount -f {mount_path}"
|
||||||
)
|
)
|
||||||
if retcode:
|
if retcode:
|
||||||
self.log_err(
|
self.log_err(
|
||||||
|
@ -150,6 +150,11 @@
|
|||||||
from daemon_lib.vmbuilder import VMBuilder
|
from daemon_lib.vmbuilder import VMBuilder
|
||||||
|
|
||||||
|
|
||||||
|
# These are some global variables used below
|
||||||
|
default_root_password = "test123"
|
||||||
|
default_local_time = "UTC"
|
||||||
|
|
||||||
|
|
||||||
# The VMBuilderScript class must be named as such, and extend VMBuilder.
|
# The VMBuilderScript class must be named as such, and extend VMBuilder.
|
||||||
class VMBuilderScript(VMBuilder):
|
class VMBuilderScript(VMBuilder):
|
||||||
def setup(self):
|
def setup(self):
|
||||||
@ -524,13 +529,23 @@ class VMBuilderScript(VMBuilder):
|
|||||||
ret = os.system(
|
ret = os.system(
|
||||||
f"rinse --arch {rinse_architecture} --directory {temporary_directory} --distribution {rinse_release} --cache-dir {rinse_cache} --add-pkg-list /tmp/addpkg --verbose {mirror_arg}"
|
f"rinse --arch {rinse_architecture} --directory {temporary_directory} --distribution {rinse_release} --cache-dir {rinse_cache} --add-pkg-list /tmp/addpkg --verbose {mirror_arg}"
|
||||||
)
|
)
|
||||||
|
ret = int(ret >> 8)
|
||||||
if ret > 0:
|
if ret > 0:
|
||||||
self.fail("Failed to run rinse")
|
self.fail(f"Rinse failed with exit code {ret}")
|
||||||
|
|
||||||
# Bind mount the devfs, sysfs, and procfs so we can grub-install later
|
# Bind mount the devfs, sysfs, and procfs so we can grub-install later
|
||||||
os.system("mount --bind /dev {}/dev".format(temporary_directory))
|
ret = os.system("mount --bind /dev {}/dev".format(temporary_directory))
|
||||||
os.system("mount --bind /sys {}/sys".format(temporary_directory))
|
ret = int(ret >> 8)
|
||||||
os.system("mount --bind /proc {}/proc".format(temporary_directory))
|
if ret > 0:
|
||||||
|
self.fail(f"/dev bind mount failed with exit code {ret}")
|
||||||
|
ret = os.system("mount --bind /sys {}/sys".format(temporary_directory))
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"/sys bind mount failed with exit code {ret}")
|
||||||
|
ret = os.system("mount --bind /proc {}/proc".format(temporary_directory))
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"/proc bind mount failed with exit code {ret}")
|
||||||
|
|
||||||
# Create an fstab entry for each volume
|
# Create an fstab entry for each volume
|
||||||
fstab_file = "{}/etc/fstab".format(temporary_directory)
|
fstab_file = "{}/etc/fstab".format(temporary_directory)
|
||||||
@ -642,41 +657,76 @@ GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=
|
|||||||
# Do some tasks inside the chroot using the provided context manager
|
# Do some tasks inside the chroot using the provided context manager
|
||||||
with chroot(temporary_directory):
|
with chroot(temporary_directory):
|
||||||
# Fix the broken kernel from rinse by setting a systemd machine ID and running the post scripts
|
# Fix the broken kernel from rinse by setting a systemd machine ID and running the post scripts
|
||||||
os.system("systemd-machine-id-setup")
|
ret = os.system("systemd-machine-id-setup")
|
||||||
os.system(
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Machine ID setup failed with exit code {ret}")
|
||||||
|
|
||||||
|
ret = os.system(
|
||||||
"rpm -q --scripts kernel-core | grep -A20 'posttrans scriptlet' | tail -n+2 | bash -x"
|
"rpm -q --scripts kernel-core | grep -A20 'posttrans scriptlet' | tail -n+2 | bash -x"
|
||||||
)
|
)
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"RPM kernel reinstall failed with exit code {ret}")
|
||||||
|
|
||||||
# Install any post packages
|
# Install any post packages
|
||||||
os.system(f"dnf install -y {' '.join(post_packages)}")
|
if len(post_packages) > 0:
|
||||||
|
ret = os.system(f"dnf install -y {' '.join(post_packages)}")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"DNF install failed with exit code {ret}")
|
||||||
|
|
||||||
# Install and update GRUB config
|
# Install and update GRUB config
|
||||||
os.system(
|
ret = os.system(
|
||||||
"grub2-install --force /dev/rbd/{}/{}_{}".format(
|
"grub2-install --force /dev/rbd/{}/{}_{}".format(
|
||||||
root_volume["pool"], vm_name, root_volume["disk_id"]
|
root_volume["pool"], vm_name, root_volume["disk_id"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"GRUB install failed with exit code {ret}")
|
||||||
|
|
||||||
os.system("grub2-mkconfig -o /boot/grub2/grub.cfg")
|
os.system("grub2-mkconfig -o /boot/grub2/grub.cfg")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"GRUB update failed with exit code {ret}")
|
||||||
|
|
||||||
# Set a really dumb root password so the VM can be debugged
|
# Set a really dumb root password so the VM can be debugged
|
||||||
# EITHER CHANGE THIS YOURSELF, here or in Userdata, or run something after install
|
# EITHER CHANGE THIS YOURSELF, here or in Userdata, or run something after install
|
||||||
# to change the root password: don't leave it like this on an Internet-facing machine!
|
# to change the root password: don't leave it like this on an Internet-facing machine!
|
||||||
os.system("echo root:test123 | chpasswd")
|
ret = os.system(f"echo root:{default_root_password} | chpasswd")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Root password change failed with exit code {ret}")
|
||||||
|
|
||||||
# Enable dbus-broker
|
# Enable dbus-broker
|
||||||
os.system("systemctl enable dbus-broker.service")
|
ret = os.system("systemctl enable dbus-broker.service")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Enable of dbus-broker failed with exit code {ret}")
|
||||||
|
|
||||||
# Enable NetworkManager
|
# Enable NetworkManager
|
||||||
os.system("systemctl enable NetworkManager.service")
|
os.system("systemctl enable NetworkManager.service")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Enable of NetworkManager failed with exit code {ret}")
|
||||||
|
|
||||||
# Enable cloud-init target on (first) boot
|
# Enable cloud-init target on (first) boot
|
||||||
# Your user-data should handle this and disable it once done, or things get messy.
|
# Your user-data should handle this and disable it once done, or things get messy.
|
||||||
# That cloud-init won't run without this hack seems like a bug... but even the official
|
# That cloud-init won't run without this hack seems like a bug... but even the official
|
||||||
# Debian cloud images are affected, so who knows.
|
# Debian cloud images are affected, so who knows.
|
||||||
os.system("systemctl enable cloud-init.target")
|
os.system("systemctl enable cloud-init.target")
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Enable of cloud-init failed with exit code {ret}")
|
||||||
|
|
||||||
# Set the timezone to UTC
|
# Set the timezone to UTC
|
||||||
os.system("ln -sf ../usr/share/zoneinfo/UTC /etc/localtime")
|
ret = os.system(
|
||||||
|
f"ln -sf ../usr/share/zoneinfo/{default_local_time} /etc/localtime"
|
||||||
|
)
|
||||||
|
ret = int(ret >> 8)
|
||||||
|
if ret > 0:
|
||||||
|
self.fail(f"Localtime update failed with exit code {ret}")
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""
|
"""
|
||||||
|
@ -27,7 +27,7 @@ from distutils.util import strtobool as dustrtobool
|
|||||||
import daemon_lib.config as cfg
|
import daemon_lib.config as cfg
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.90"
|
version = "0.9.91"
|
||||||
|
|
||||||
# API version
|
# API version
|
||||||
API_VERSION = 1.0
|
API_VERSION = 1.0
|
||||||
|
@ -687,7 +687,10 @@ def cli_cluster_task(task_id, wait_flag, format_function):
|
|||||||
|
|
||||||
if wait_flag:
|
if wait_flag:
|
||||||
# First validate that this is actually a valid task that is running
|
# First validate that this is actually a valid task that is running
|
||||||
|
echo(CLI_CONFIG, "Querying cluster for tasks...", newline=False)
|
||||||
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, None)
|
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, None)
|
||||||
|
echo(CLI_CONFIG, " done.")
|
||||||
|
echo(CLI_CONFIG, "")
|
||||||
if task_id in [i["id"] for i in retdata]:
|
if task_id in [i["id"] for i in retdata]:
|
||||||
task = [i for i in retdata if i["id"] == task_id][0]
|
task = [i for i in retdata if i["id"] == task_id][0]
|
||||||
retmsg = wait_for_celery_task(
|
retmsg = wait_for_celery_task(
|
||||||
@ -699,7 +702,10 @@ def cli_cluster_task(task_id, wait_flag, format_function):
|
|||||||
retmsg = f"No task with ID {task_id} found."
|
retmsg = f"No task with ID {task_id} found."
|
||||||
finish(retcode, retmsg)
|
finish(retcode, retmsg)
|
||||||
else:
|
else:
|
||||||
|
echo(CLI_CONFIG, "Querying cluster for tasks...", newline=False)
|
||||||
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, task_id)
|
retcode, retdata = pvc.lib.common.task_status(CLI_CONFIG, task_id)
|
||||||
|
echo(CLI_CONFIG, " done.")
|
||||||
|
echo(CLI_CONFIG, "")
|
||||||
finish(retcode, retdata, format_function)
|
finish(retcode, retdata, format_function)
|
||||||
|
|
||||||
|
|
||||||
|
@ -645,6 +645,24 @@ def cli_cluster_task_format_pretty(CLI_CONFIG, task_data):
|
|||||||
if _task_type_length > task_type_length:
|
if _task_type_length > task_type_length:
|
||||||
task_type_length = _task_type_length
|
task_type_length = _task_type_length
|
||||||
|
|
||||||
|
for arg_name, arg_data in task["kwargs"].items():
|
||||||
|
# Skip the "run_on" argument
|
||||||
|
if arg_name == "run_on":
|
||||||
|
continue
|
||||||
|
|
||||||
|
# task_arg_name column
|
||||||
|
_task_arg_name_length = len(str(arg_name)) + 1
|
||||||
|
if _task_arg_name_length > task_arg_name_length:
|
||||||
|
task_arg_name_length = _task_arg_name_length
|
||||||
|
|
||||||
|
task_header_length = (
|
||||||
|
task_id_length + task_name_length + task_type_length + task_worker_length + 3
|
||||||
|
)
|
||||||
|
max_task_data_length = (
|
||||||
|
MAX_CONTENT_WIDTH - task_header_length - task_arg_name_length - 2
|
||||||
|
)
|
||||||
|
|
||||||
|
for task in task_data:
|
||||||
updated_kwargs = list()
|
updated_kwargs = list()
|
||||||
for arg_name, arg_data in task["kwargs"].items():
|
for arg_name, arg_data in task["kwargs"].items():
|
||||||
# Skip the "run_on" argument
|
# Skip the "run_on" argument
|
||||||
@ -656,15 +674,30 @@ def cli_cluster_task_format_pretty(CLI_CONFIG, task_data):
|
|||||||
if _task_arg_name_length > task_arg_name_length:
|
if _task_arg_name_length > task_arg_name_length:
|
||||||
task_arg_name_length = _task_arg_name_length
|
task_arg_name_length = _task_arg_name_length
|
||||||
|
|
||||||
if len(str(arg_data)) > 17:
|
if isinstance(arg_data, list):
|
||||||
arg_data = arg_data[:17] + "..."
|
for subarg_data in arg_data:
|
||||||
|
if len(subarg_data) > max_task_data_length:
|
||||||
|
subarg_data = (
|
||||||
|
str(subarg_data[: max_task_data_length - 4]) + " ..."
|
||||||
|
)
|
||||||
|
|
||||||
# task_arg_data column
|
# task_arg_data column
|
||||||
_task_arg_data_length = len(str(arg_data)) + 1
|
_task_arg_data_length = len(str(subarg_data)) + 1
|
||||||
if _task_arg_data_length > task_arg_data_length:
|
if _task_arg_data_length > task_arg_data_length:
|
||||||
task_arg_data_length = _task_arg_data_length
|
task_arg_data_length = _task_arg_data_length
|
||||||
|
|
||||||
|
updated_kwargs.append({"name": arg_name, "data": subarg_data})
|
||||||
|
else:
|
||||||
|
if len(str(arg_data)) > 24:
|
||||||
|
arg_data = str(arg_data[:24]) + " ..."
|
||||||
|
|
||||||
|
# task_arg_data column
|
||||||
|
_task_arg_data_length = len(str(arg_data)) + 1
|
||||||
|
if _task_arg_data_length > task_arg_data_length:
|
||||||
|
task_arg_data_length = _task_arg_data_length
|
||||||
|
|
||||||
|
updated_kwargs.append({"name": arg_name, "data": arg_data})
|
||||||
|
|
||||||
updated_kwargs.append({"name": arg_name, "data": arg_data})
|
|
||||||
task["kwargs"] = updated_kwargs
|
task["kwargs"] = updated_kwargs
|
||||||
tasks.append(task)
|
tasks.append(task)
|
||||||
|
|
||||||
|
@ -115,6 +115,8 @@ def wait_for_celery_task(CLI_CONFIG, task_detail, start_late=False):
|
|||||||
)
|
)
|
||||||
while True:
|
while True:
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
|
if isinstance(task_status, tuple):
|
||||||
|
continue
|
||||||
if task_status.get("state") != "RUNNING":
|
if task_status.get("state") != "RUNNING":
|
||||||
break
|
break
|
||||||
if task_status.get("current") > last_task:
|
if task_status.get("current") > last_task:
|
||||||
|
@ -89,6 +89,7 @@ def vm_define(
|
|||||||
node_selector,
|
node_selector,
|
||||||
node_autostart,
|
node_autostart,
|
||||||
migration_method,
|
migration_method,
|
||||||
|
migration_max_downtime,
|
||||||
user_tags,
|
user_tags,
|
||||||
protected_tags,
|
protected_tags,
|
||||||
):
|
):
|
||||||
@ -96,7 +97,7 @@ def vm_define(
|
|||||||
Define a new VM on the cluster
|
Define a new VM on the cluster
|
||||||
|
|
||||||
API endpoint: POST /vm
|
API endpoint: POST /vm
|
||||||
API arguments: xml={xml}, node={node}, limit={node_limit}, selector={node_selector}, autostart={node_autostart}, migration_method={migration_method}, user_tags={user_tags}, protected_tags={protected_tags}
|
API arguments: xml={xml}, node={node}, limit={node_limit}, selector={node_selector}, autostart={node_autostart}, migration_method={migration_method}, migration_max_downtime={migration_max_downtime}, user_tags={user_tags}, protected_tags={protected_tags}
|
||||||
API schema: {"message":"{data}"}
|
API schema: {"message":"{data}"}
|
||||||
"""
|
"""
|
||||||
params = {
|
params = {
|
||||||
@ -105,6 +106,7 @@ def vm_define(
|
|||||||
"selector": node_selector,
|
"selector": node_selector,
|
||||||
"autostart": node_autostart,
|
"autostart": node_autostart,
|
||||||
"migration_method": migration_method,
|
"migration_method": migration_method,
|
||||||
|
"migration_max_downtime": migration_max_downtime,
|
||||||
"user_tags": user_tags,
|
"user_tags": user_tags,
|
||||||
"protected_tags": protected_tags,
|
"protected_tags": protected_tags,
|
||||||
}
|
}
|
||||||
@ -1630,6 +1632,7 @@ def format_info(config, domain_information, long_output):
|
|||||||
"migrate": ansiprint.blue(),
|
"migrate": ansiprint.blue(),
|
||||||
"unmigrate": ansiprint.blue(),
|
"unmigrate": ansiprint.blue(),
|
||||||
"provision": ansiprint.blue(),
|
"provision": ansiprint.blue(),
|
||||||
|
"restore": ansiprint.blue(),
|
||||||
}
|
}
|
||||||
ainformation.append(
|
ainformation.append(
|
||||||
"{}State:{} {}{}{}".format(
|
"{}State:{} {}{}{}".format(
|
||||||
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pvc",
|
name="pvc",
|
||||||
version="0.9.90",
|
version="0.9.91",
|
||||||
packages=["pvc.cli", "pvc.lib"],
|
packages=["pvc.cli", "pvc.lib"],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"Click",
|
"Click",
|
||||||
|
@ -1201,7 +1201,7 @@ def get_resource_metrics(zkhandler):
|
|||||||
try:
|
try:
|
||||||
user_time = vm["vcpu_stats"]["user_time"] / 1000000
|
user_time = vm["vcpu_stats"]["user_time"] / 1000000
|
||||||
except Exception:
|
except Exception:
|
||||||
cpu_time = 0
|
user_time = 0
|
||||||
output_lines.append(
|
output_lines.append(
|
||||||
f"pvc_vm_vcpus_user_time{{vm=\"{vm['name']}\"}} {user_time}"
|
f"pvc_vm_vcpus_user_time{{vm=\"{vm['name']}\"}} {user_time}"
|
||||||
)
|
)
|
||||||
|
10
debian/changelog
vendored
10
debian/changelog
vendored
@ -1,3 +1,13 @@
|
|||||||
|
pvc (0.9.91-0) unstable; urgency=high
|
||||||
|
|
||||||
|
* [Client CLI] Fixes a bug and improves output during cluster task events.
|
||||||
|
* [Client CLI] Improves the output of the task list display.
|
||||||
|
* [Provisioner] Fixes some missing cloud-init modules in the default debootstrap script.
|
||||||
|
* [Client CLI] Fixes a bug with a missing argument to the vm_define helper function.
|
||||||
|
* [All] Fixes inconsistent package find + rm commands to avoid errors in dpkg.
|
||||||
|
|
||||||
|
-- Joshua M. Boniface <joshua@boniface.me> Tue, 23 Jan 2024 10:02:19 -0500
|
||||||
|
|
||||||
pvc (0.9.90-0) unstable; urgency=high
|
pvc (0.9.90-0) unstable; urgency=high
|
||||||
|
|
||||||
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
* [Client CLI/API Daemon] Adds additional backup metainfo and an emailed report option to autobackups.
|
||||||
|
5
debian/pvc-client-cli.postinst
vendored
5
debian/pvc-client-cli.postinst
vendored
@ -2,7 +2,12 @@
|
|||||||
|
|
||||||
# Generate the bash completion configuration
|
# Generate the bash completion configuration
|
||||||
if [ -d /etc/bash_completion.d ]; then
|
if [ -d /etc/bash_completion.d ]; then
|
||||||
|
echo "Installing BASH completion configuration"
|
||||||
_PVC_COMPLETE=source_bash pvc > /etc/bash_completion.d/pvc
|
_PVC_COMPLETE=source_bash pvc > /etc/bash_completion.d/pvc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Remove any cached CPython directories or files
|
||||||
|
echo "Cleaning up CPython caches"
|
||||||
|
find /usr/lib/python3/dist-packages/pvc -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
4
debian/pvc-daemon-api.preinst
vendored
4
debian/pvc-daemon-api.preinst
vendored
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up existing CPython files"
|
echo "Cleaning up CPython caches"
|
||||||
find /usr/share/pvc/pvcapid -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
find /usr/share/pvc/pvcapid -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
||||||
|
5
debian/pvc-daemon-common.preinst
vendored
Normal file
5
debian/pvc-daemon-common.preinst
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Remove any cached CPython directories or files
|
||||||
|
echo "Cleaning up CPython caches"
|
||||||
|
find /usr/share/pvc/daemon_lib -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
6
debian/pvc-daemon-health.preinst
vendored
6
debian/pvc-daemon-health.preinst
vendored
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up existing CPython files"
|
echo "Cleaning up CPython caches"
|
||||||
find /usr/share/pvc/pvchealthd -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
find /usr/share/pvc/pvchealthd -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
||||||
find /usr/share/pvc/plugins -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
find /usr/share/pvc/plugins -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
||||||
|
4
debian/pvc-daemon-node.preinst
vendored
4
debian/pvc-daemon-node.preinst
vendored
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up existing CPython files"
|
echo "Cleaning up CPython caches"
|
||||||
find /usr/share/pvc/pvcnoded -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
find /usr/share/pvc/pvcnoded -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
||||||
|
4
debian/pvc-daemon-worker.preinst
vendored
4
debian/pvc-daemon-worker.preinst
vendored
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Remove any cached CPython directories or files
|
# Remove any cached CPython directories or files
|
||||||
echo "Cleaning up existing CPython files"
|
echo "Cleaning up CPython caches"
|
||||||
find /usr/share/pvc/pvcworkerd -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true
|
find /usr/share/pvc/pvcworkerd -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true
|
||||||
|
2
debian/rules
vendored
2
debian/rules
vendored
@ -13,7 +13,7 @@ override_dh_python3:
|
|||||||
rm -r $(CURDIR)/client-cli/.pybuild $(CURDIR)/client-cli/pvc.egg-info
|
rm -r $(CURDIR)/client-cli/.pybuild $(CURDIR)/client-cli/pvc.egg-info
|
||||||
|
|
||||||
override_dh_auto_clean:
|
override_dh_auto_clean:
|
||||||
find . -name "__pycache__" -o -name ".pybuild" -exec rm -r {} \; || true
|
find . -name "__pycache__" -o -name ".pybuild" -exec rm -fr {} + || true
|
||||||
|
|
||||||
# If you need to rebuild the Sphinx documentation
|
# If you need to rebuild the Sphinx documentation
|
||||||
# Add spinxdoc to the dh --with line
|
# Add spinxdoc to the dh --with line
|
||||||
|
@ -33,7 +33,7 @@ import os
|
|||||||
import signal
|
import signal
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.90"
|
version = "0.9.91"
|
||||||
|
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
|
@ -49,7 +49,7 @@ import re
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.90"
|
version = "0.9.91"
|
||||||
|
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
|
@ -44,7 +44,7 @@ from daemon_lib.vmbuilder import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.90"
|
version = "0.9.91"
|
||||||
|
|
||||||
|
|
||||||
config = cfg.get_configuration()
|
config = cfg.get_configuration()
|
||||||
|
Reference in New Issue
Block a user