Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
a49510ecc8 | |||
6d7730ab52 | |||
8135426973 | |||
20d436a745 | |||
28f6819726 | |||
35c07f0384 | |||
6127387be4 | |||
343d66875b |
@ -1,5 +1,10 @@
|
|||||||
## PVC Changelog
|
## PVC Changelog
|
||||||
|
|
||||||
|
###### [v0.9.60](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.60)
|
||||||
|
|
||||||
|
* [Provisioner] Cleans up several remaining bugs in the example scripts; they should all be valid now
|
||||||
|
* [Provisioner] Adjust default libvirt schema to disable RBD caching for a 2x+ performance boost
|
||||||
|
|
||||||
###### [v0.9.59](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.59)
|
###### [v0.9.59](https://github.com/parallelvirtualcluster/pvc/releases/tag/v0.9.59)
|
||||||
|
|
||||||
* [API] Flips the mem(prov) and mem(free) selectors making mem(free) the default for "mem" and "memprov" explicit
|
* [API] Flips the mem(prov) and mem(free) selectors making mem(free) the default for "mem" and "memprov" explicit
|
||||||
|
@ -398,7 +398,7 @@ class VMBuilderScript(VMBuilder):
|
|||||||
if volume.get("source_volume") is not None:
|
if volume.get("source_volume") is not None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if volume.get("filesystem") is None:
|
if volume.get("filesystem") is None or volume.get("filesystem") == "swap":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mapped_dst_volume = f"/dev/rbd/{dst_volume}"
|
mapped_dst_volume = f"/dev/rbd/{dst_volume}"
|
||||||
@ -473,7 +473,7 @@ class VMBuilderScript(VMBuilder):
|
|||||||
]
|
]
|
||||||
|
|
||||||
# We need to know our root disk for later GRUB-ing
|
# We need to know our root disk for later GRUB-ing
|
||||||
root_disk = None
|
root_volume = None
|
||||||
for volume in volumes:
|
for volume in volumes:
|
||||||
if volume["mountpoint"] == "/":
|
if volume["mountpoint"] == "/":
|
||||||
root_volume = volume
|
root_volume = volume
|
||||||
@ -725,6 +725,7 @@ GRUB_DISABLE_LINUX_UUID=false
|
|||||||
if (
|
if (
|
||||||
volume.get("source_volume") is None
|
volume.get("source_volume") is None
|
||||||
and volume.get("filesystem") is not None
|
and volume.get("filesystem") is not None
|
||||||
|
and volume.get("filesystem") != "swap"
|
||||||
):
|
):
|
||||||
# Unmount filesystem
|
# Unmount filesystem
|
||||||
retcode, stdout, stderr = pvc_common.run_os_command(
|
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# This script provides an example of a PVC provisioner script. It will create a
|
# This script provides an example of a PVC provisioner script. It will create a
|
||||||
# standard VM config and install a RHEL-like OS using rinse.
|
# standard VM config and install a RHEL 8+ or similar OS using rinse.
|
||||||
|
|
||||||
# This script can thus be used as an example or reference implementation of a
|
# This script can thus be used as an example or reference implementation of a
|
||||||
# PVC provisioner script and expanded upon as required.
|
# PVC provisioner script and expanded upon as required.
|
||||||
@ -398,7 +398,7 @@ class VMBuilderScript(VMBuilder):
|
|||||||
if volume.get("source_volume") is not None:
|
if volume.get("source_volume") is not None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if volume.get("filesystem") is None:
|
if volume.get("filesystem") is None or volume.get("filesystem") == "swap":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mapped_dst_volume = f"/dev/rbd/{dst_volume}"
|
mapped_dst_volume = f"/dev/rbd/{dst_volume}"
|
||||||
@ -487,7 +487,7 @@ class VMBuilderScript(VMBuilder):
|
|||||||
post_packages = ["cloud-init"]
|
post_packages = ["cloud-init"]
|
||||||
|
|
||||||
# We need to know our root disk for later GRUB-ing
|
# We need to know our root disk for later GRUB-ing
|
||||||
root_disk = None
|
root_volume = None
|
||||||
for volume in volumes:
|
for volume in volumes:
|
||||||
if volume["mountpoint"] == "/":
|
if volume["mountpoint"] == "/":
|
||||||
root_volume = volume
|
root_volume = volume
|
||||||
@ -571,21 +571,6 @@ class VMBuilderScript(VMBuilder):
|
|||||||
with open(hostname_file, "w") as fh:
|
with open(hostname_file, "w") as fh:
|
||||||
fh.write("{}".format(vm_name))
|
fh.write("{}".format(vm_name))
|
||||||
|
|
||||||
# Fix the cloud-init.target since it's broken by default
|
|
||||||
cloudinit_target_file = "{}/etc/systemd/system/cloud-init.target".format(
|
|
||||||
temporary_directory
|
|
||||||
)
|
|
||||||
with open(cloudinit_target_file, "w") as fh:
|
|
||||||
# We lose our indent on these raw blocks to preserve the apperance of the files
|
|
||||||
# inside the VM itself
|
|
||||||
data = """[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
[Unit]
|
|
||||||
Description=Cloud-init target
|
|
||||||
After=multi-user.target
|
|
||||||
"""
|
|
||||||
fh.write(data)
|
|
||||||
|
|
||||||
# Due to device ordering within the Libvirt XML configuration, the first Ethernet interface
|
# Due to device ordering within the Libvirt XML configuration, the first Ethernet interface
|
||||||
# will always be on PCI bus ID 2, hence the name "ens2".
|
# will always be on PCI bus ID 2, hence the name "ens2".
|
||||||
# Write a DHCP stanza for ens2
|
# Write a DHCP stanza for ens2
|
||||||
@ -682,11 +667,6 @@ GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=
|
|||||||
# Set the timezone to UTC
|
# Set the timezone to UTC
|
||||||
os.system("ln -sf ../usr/share/zoneinfo/UTC /etc/localtime")
|
os.system("ln -sf ../usr/share/zoneinfo/UTC /etc/localtime")
|
||||||
|
|
||||||
# Unmount the bound devfs and sysfs
|
|
||||||
os.system("umount {}/dev".format(temporary_directory))
|
|
||||||
os.system("umount {}/sys".format(temporary_directory))
|
|
||||||
os.system("umount {}/proc".format(temporary_directory))
|
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""
|
"""
|
||||||
cleanup(): Perform any cleanup required due to prepare()/install()
|
cleanup(): Perform any cleanup required due to prepare()/install()
|
||||||
@ -700,6 +680,7 @@ GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Run any imports first
|
# Run any imports first
|
||||||
|
import os
|
||||||
from pvcapid.vmbuilder import open_zk
|
from pvcapid.vmbuilder import open_zk
|
||||||
from pvcapid.Daemon import config
|
from pvcapid.Daemon import config
|
||||||
import daemon_lib.common as pvc_common
|
import daemon_lib.common as pvc_common
|
||||||
@ -708,6 +689,11 @@ GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=
|
|||||||
# Set the tempdir we used in the prepare() and install() steps
|
# Set the tempdir we used in the prepare() and install() steps
|
||||||
temp_dir = "/tmp/target"
|
temp_dir = "/tmp/target"
|
||||||
|
|
||||||
|
# Unmount the bound devfs and sysfs
|
||||||
|
os.system(f"umount {temp_dir}/dev")
|
||||||
|
os.system(f"umount {temp_dir}/sys")
|
||||||
|
os.system(f"umount {temp_dir}/proc")
|
||||||
|
|
||||||
# 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"])):
|
||||||
dst_volume_name = f"{self.vm_name}_{volume['disk_id']}"
|
dst_volume_name = f"{self.vm_name}_{volume['disk_id']}"
|
||||||
@ -718,6 +704,7 @@ GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=
|
|||||||
if (
|
if (
|
||||||
volume.get("source_volume") is None
|
volume.get("source_volume") is None
|
||||||
and volume.get("filesystem") is not None
|
and volume.get("filesystem") is not None
|
||||||
|
and volume.get("filesystem") != "swap"
|
||||||
):
|
):
|
||||||
# Unmount filesystem
|
# Unmount filesystem
|
||||||
retcode, stdout, stderr = pvc_common.run_os_command(
|
retcode, stdout, stderr = pvc_common.run_os_command(
|
||||||
@ -728,14 +715,14 @@ GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=
|
|||||||
f"Failed to unmount '{mapped_dst_volume}' on '{mount_path}': {stderr}"
|
f"Failed to unmount '{mapped_dst_volume}' on '{mount_path}': {stderr}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Unmap volume
|
# Unmap volume
|
||||||
with open_zk(config) as zkhandler:
|
with open_zk(config) as zkhandler:
|
||||||
success, message = pvc_ceph.unmap_volume(
|
success, message = pvc_ceph.unmap_volume(
|
||||||
zkhandler,
|
zkhandler,
|
||||||
volume["pool"],
|
volume["pool"],
|
||||||
dst_volume_name,
|
dst_volume_name,
|
||||||
)
|
)
|
||||||
if not success:
|
if not success:
|
||||||
raise ProvisioningError(
|
raise ProvisioningError(
|
||||||
f"Failed to unmap '{mapped_dst_volume}': {stderr}"
|
f"Failed to unmap '{mapped_dst_volume}': {stderr}"
|
||||||
)
|
)
|
||||||
|
@ -27,7 +27,7 @@ from ssl import SSLContext, TLSVersion
|
|||||||
from distutils.util import strtobool as dustrtobool
|
from distutils.util import strtobool as dustrtobool
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.59"
|
version = "0.9.60"
|
||||||
|
|
||||||
# API version
|
# API version
|
||||||
API_VERSION = 1.0
|
API_VERSION = 1.0
|
||||||
|
@ -100,7 +100,7 @@ devices_scsi_controller = """ <controller type='scsi' index='0' model='virtio
|
|||||||
# * vm_name
|
# * vm_name
|
||||||
# * disk_id
|
# * disk_id
|
||||||
devices_disk_header = """ <disk type='network' device='disk'>
|
devices_disk_header = """ <disk type='network' device='disk'>
|
||||||
<driver name='qemu' discard='unmap'/>
|
<driver name='qemu' discard='unmap' cache='none'/>
|
||||||
<target dev='{disk_id}' bus='scsi'/>
|
<target dev='{disk_id}' bus='scsi'/>
|
||||||
<auth username='libvirt'>
|
<auth username='libvirt'>
|
||||||
<secret type='ceph' uuid='{ceph_storage_secret}'/>
|
<secret type='ceph' uuid='{ceph_storage_secret}'/>
|
||||||
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pvc",
|
name="pvc",
|
||||||
version="0.9.59",
|
version="0.9.60",
|
||||||
packages=["pvc", "pvc.cli_lib"],
|
packages=["pvc", "pvc.cli_lib"],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"Click",
|
"Click",
|
||||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
|||||||
|
pvc (0.9.60-0) unstable; urgency=high
|
||||||
|
|
||||||
|
* [Provisioner] Cleans up several remaining bugs in the example scripts; they should all be valid now
|
||||||
|
* [Provisioner] Adjust default libvirt schema to disable RBD caching for a 2x+ performance boost
|
||||||
|
|
||||||
|
-- Joshua M. Boniface <joshua@boniface.me> Tue, 06 Dec 2022 15:42:55 -0500
|
||||||
|
|
||||||
pvc (0.9.59-0) unstable; urgency=high
|
pvc (0.9.59-0) unstable; urgency=high
|
||||||
|
|
||||||
* [API] Flips the mem(prov) and mem(free) selectors making mem(free) the default for "mem" and "memprov" explicit
|
* [API] Flips the mem(prov) and mem(free) selectors making mem(free) the default for "mem" and "memprov" explicit
|
||||||
|
@ -48,7 +48,7 @@ import re
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = "0.9.59"
|
version = "0.9.60"
|
||||||
|
|
||||||
|
|
||||||
##########################################################
|
##########################################################
|
||||||
|
Reference in New Issue
Block a user