+### reinstall
+- reinstalls kubevip
diff --git a/lib/kopsrox_config.py b/lib/kopsrox_config.py
index 51fa88c..65af842 100755
--- a/lib/kopsrox_config.py
+++ b/lib/kopsrox_config.py
@@ -317,7 +317,7 @@ def vm_info(vmid,node=node):
except:
# no image found
- kmsg(kname, 'no template detected - please run "kopsrox image create"', 'err')
+ kmsg(kname, f'{cluster_name} image not found - please run "kopsrox image create"', 'err')
exit(0)
# get image info
diff --git a/lib/kopsrox_ini.py b/lib/kopsrox_ini.py
index c709d57..587df38 100755
--- a/lib/kopsrox_ini.py
+++ b/lib/kopsrox_ini.py
@@ -45,8 +45,8 @@ def init_kopsrox_ini():
config.add_section('kopsrox')
# upstream image
- config.set('kopsrox', '; the upstream cloud image used to create the kopsrox template')
- config.set('kopsrox', 'cloud_image_url', 'https://cloud-images.ubuntu.com/minimal/daily/mantic/current/mantic-minimal-cloudimg-amd64.img')
+ config.set('kopsrox', '; the upstream cloud image used to create the kopsrox image')
+ config.set('kopsrox', 'cloud_image_url', '//cloud-images.ubuntu.com/minimal/daily/oracular/current/oracular-minimal-cloudimg-amd64.img')
# disk size for kopsrox vms
config.set('kopsrox', '; size of kopsrox vm disk in Gib ')
diff --git a/lib/verb_image.py b/lib/verb_image.py
index d2878cd..29636ba 100755
--- a/lib/verb_image.py
+++ b/lib/verb_image.py
@@ -21,23 +21,23 @@
# create image
if cmd == 'create':
- kmsg(f'{kname}create', f'name:{cluster_name}-i1', 'sys')
# get image name from url
cloud_image = cloud_image_url.split('/')[-1]
- kmsg(f'{kname}download', f'{cloud_image_url}')
+ kmsg(f'{kname}create', f'{cloud_image}-{k3s_version} {storage}/{cluster_name}-i0/{cluster_id}', 'sys')
# check if image already exists
if os.path.isfile(cloud_image):
- kmsg(kname, f'{cloud_image} already exists', 'err')
+ kmsg(f'{kname}check', f'Error! {cloud_image} already exists - please delete', 'err')
exit(0)
# check img can be downloaded
try:
+ kmsg(f'{kname}wget', f'{cloud_image_url}')
wget.download(cloud_image_url)
print()
except:
- kmsg(kname, f'unable to download {cloud_image_url}', 'err')
+ kmsg(f'{kname}check', f'unable to download {cloud_image_url}', 'err')
exit(0)
# script to install disable selinux on Rocky
@@ -59,10 +59,10 @@
cp /dev/null /etc/sysconfig/qemu-ga
fi'''
# shouldn't really need root but run into permissions problems
- patch_cmd = f'sudo virt-customize --smp 2 -m 2048 -a {cloud_image} --install qemu-guest-agent --run-command "{virtc_script}"'
+ virtc_cmd = f'sudo virt-customize --smp 2 -m 2048 -a {cloud_image} --install qemu-guest-agent --run-command "{virtc_script}"'
- kmsg('image_virt-customize', 'configuring image')
- patch_out = local_os_process(patch_cmd)
+ kmsg(f'{kname}virt-customize', 'configuring image')
+ local_os_process(virtc_cmd)
# destroy template if it exists
try:
@@ -88,26 +88,25 @@
agent = ('enabled=true'),
hotplug = 0,
ciupgrade = 0,
- description = f'{cluster_name} template\n{cloud_image}\n{k3s_version}',
+ description = f'{cluster_name} image\nbased on: {cloud_image}\nk3s version: {k3s_version}',
ciuser = cloudinituser,
cipassword = cloudinitpass,
sshkeys = cloudinitsshkey,
- tdf = '1',
))
# shell to import disk
# import-from requires the full path os.getcwd required here
import_cmd = f'''
-sudo qm set {cluster_id} --scsi0 {storage}:0,import-from={os.getcwd()}/{cloud_image},iothread=true,aio=native,discard=on,ssd=1
+sudo qm set {cluster_id} --scsi0 {storage}:0,import-from={os.getcwd()}/{cloud_image},iothread=true,aio=native
mv {cloud_image} {cloud_image}.patched'''
# run shell command to import
- kmsg(f'image_qm-import', f'{cloud_image} > {storage}/{cluster_id}')
local_os_process(import_cmd)
# convert to template via create base disk also vm config
task_status(prox.nodes(node).qemu(cluster_id).template.post())
task_status(prox.nodes(node).qemu(cluster_id).config.post(template = 1))
+ kmsg(f'{kname}qm-import', f'done')
# image info
if cmd == 'info':
@@ -115,5 +114,5 @@
# destroy image
if cmd == 'destroy':
- kmsg(kname, f'{kopsrox_img()}/{cloud_image_desc}', 'warn')
+ kmsg(f'{kname}destroy', f'{kopsrox_img()}/{cloud_image_desc}', 'warn')
prox_destroy(cluster_id)