[GH-ISSUE #219] Feature request: image template re-organisation #147

Closed
opened 2026-02-27 15:57:30 +03:00 by kerem · 17 comments
Owner

Originally created by @lord-kyron on GitHub (Jan 18, 2019).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/219

@catborise - I think this, can be nice addition, but I would like your opinion:
I think that if you mark an instance as Template, it should appear under a new tab - Templates. It will be easier to differentiate. This tab can only appear, if there are some templates.
Also - in addition - all instances, marked as templates (or even the whole template tab) to be visible for all user, who can "clone templates". This way, when a new user with only this permission is created, he will be able to see the templates out of the box and choose one to clone and use, without the admin to specifically give him rights (the admin can always remove some user from instance owners).
Maybe this can be achieve with a user group, called "all", which will include wall users by default and this group can be assigned by default to the template instances (otherwise in the "user" column in Instances page there will be too many usernames displayed I think)

What do you think and will you be able to do it?
Sorry for so much feature requests, but I have several ideas for better experience when using this tool, but I don't have the developer skills to make all those changes. :)

Originally created by @lord-kyron on GitHub (Jan 18, 2019). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/219 @catborise - I think this, can be nice addition, but I would like your opinion: I think that if you mark an instance as Template, it should appear under a new tab - Templates. It will be easier to differentiate. This tab can only appear, if there are some templates. Also - in addition - all instances, marked as templates (or even the whole template tab) to be visible for all user, who can "clone templates". This way, when a new user with only this permission is created, he will be able to see the templates out of the box and choose one to clone and use, without the admin to specifically give him rights (the admin can always remove some user from instance owners). Maybe this can be achieve with a user group, called "all", which will include wall users by default and this group can be assigned by default to the template instances (otherwise in the "user" column in Instances page there will be too many usernames displayed I think) What do you think and will you be able to do it? Sorry for so much feature requests, but I have several ideas for better experience when using this tool, but I don't have the developer skills to make all those changes. :)
kerem closed this issue 2026-02-27 15:57:30 +03:00
Author
Owner

@catborise commented on GitHub (Jan 19, 2019):

I am a user of webvirtcloud. I have a way of use it and i do not know every aspect of usage. It makes sense . Propose can implement but i should try templates to understand comprehensively.
After network editing i could work on that

<!-- gh-comment-id:455771737 --> @catborise commented on GitHub (Jan 19, 2019): I am a user of webvirtcloud. I have a way of use it and i do not know every aspect of usage. It makes sense . Propose can implement but i should try templates to understand comprehensively. After network editing i could work on that
Author
Owner

@lord-kyron commented on GitHub (Jan 19, 2019):

Ok, sounds great! I will help with whatever I can as I need tgis functionality! Templates are just simple instances. For example you create an instance, install it with some OS, install some software you want to have by default, then shut it down and mark it as template. This way when you need several inastances - just clone from teplate and start the instance. It will make a cloning of the instace + cloning of the drive. The template itself can only be cloned, not started until marked as template. If you want to make changes - unmark it and then you can start it. Get the logic now?

<!-- gh-comment-id:455774114 --> @lord-kyron commented on GitHub (Jan 19, 2019): Ok, sounds great! I will help with whatever I can as I need tgis functionality! Templates are just simple instances. For example you create an instance, install it with some OS, install some software you want to have by default, then shut it down and mark it as template. This way when you need several inastances - just clone from teplate and start the instance. It will make a cloning of the instace + cloning of the drive. The template itself can only be cloned, not started until marked as template. If you want to make changes - unmark it and then you can start it. Get the logic now?
Author
Owner

@catborise commented on GitHub (Jan 22, 2019):

there is a template section/module in app. it is a directory which contains base/common templates for pages.
to implement that we will have to change existing "templates" directory name. i do not know, i should modify it or not. what could it be

<!-- gh-comment-id:456413553 --> @catborise commented on GitHub (Jan 22, 2019): there is a template section/module in app. it is a directory which contains base/common templates for pages. to implement that we will have to change existing "templates" directory name. i do not know, i should modify it or not. what could it be
Author
Owner

@lord-kyron commented on GitHub (Jan 23, 2019):

I am not sure either, but you can try :) I can test it if when you make some changes.

<!-- gh-comment-id:456722695 --> @lord-kyron commented on GitHub (Jan 23, 2019): I am not sure either, but you can try :) I can test it if when you make some changes.
Author
Owner

@ssbaksa commented on GitHub (Jan 25, 2019):

I have a problem with Ubuntu 18.04 server installed as a "template". When I clone that server, machine-id remain the same so to have working DHCP client I must manually recreate machine-id. I had used server, not live server ISO image as install media for this "template".

<!-- gh-comment-id:457497995 --> @ssbaksa commented on GitHub (Jan 25, 2019): I have a problem with Ubuntu 18.04 server installed as a "template". When I clone that server, machine-id remain the same so to have working DHCP client I must manually recreate machine-id. I had used server, not live server ISO image as install media for this "template".
Author
Owner

@catborise commented on GitHub (Jan 25, 2019):

@ssbaksa this related with operating system. same thing happens on windows. you should find a solution on operating system before making it a template.

<!-- gh-comment-id:457499995 --> @catborise commented on GitHub (Jan 25, 2019): @ssbaksa this related with operating system. same thing happens on windows. you should find a solution on operating system before making it a template.
Author
Owner

@ssbaksa commented on GitHub (Jan 25, 2019):

@catborise 'SIGH' I have thought so so but still hoped for nicer solution.

<!-- gh-comment-id:457509615 --> @ssbaksa commented on GitHub (Jan 25, 2019): @catborise 'SIGH' I have thought so so but still hoped for nicer solution.
Author
Owner

@catborise commented on GitHub (Jan 25, 2019):

@ssbaksa i think there is a solution to that. but requires some digging. i will research implementation possibility.

<!-- gh-comment-id:457533300 --> @catborise commented on GitHub (Jan 25, 2019): @ssbaksa i think there is a solution to that. but requires some digging. i will research implementation possibility.
Author
Owner

@lord-kyron commented on GitHub (Jan 25, 2019):

@ssbaksa @catborise

I have a problem with Ubuntu 18.04 server installed as a "template". When I clone that server, machine-id remain the same so to have working DHCP client I must manually recreate machine-id. I had used server, not live server ISO image as install media for this "template".

For operating system images which are created once and used on multiple machines, for
example for containers or in the cloud, /etc/machine-id should be an empty file in the
generic file system image. An ID will be generated during boot and saved to this file if
possible. Having an empty file in place is useful because it allows a temporary file to be
bind-mounted over the real file, in case the image is used read-only.

systemd-firstboot(1) may be used to to initialize /etc/machine-id on mounted (but not
booted) system images.

   When a machine is booted with systemd(1) the ID of the machine will be established. If
   systemd.machine_id= or --machine-id= options (see first section) are specified, this value
   will be used. Otherwise, the value in /etc/machine-id will be used. If this file is empty
   or missing, systemd will attempt to use the D-Bus machine ID from
   /var/lib/dbus/machine-id, the value of the kernel command line option container_uuid, the
   KVM DMI product_uuid (on KVM systems), and finally a randomly generated UUID.

   After the machine ID is established, systemd(1) will attempt to save it to
   /etc/machine-id. If this fails, it will attempt to bind-mount a temporary file over
   /etc/machine-id. It is an error if the file system is read-only and does not contain a
   (possibly empty) /etc/machine-id file.

Refference: http://manpages.ubuntu.com/manpages/bionic/man5/machine-id.5.html

<!-- gh-comment-id:457600526 --> @lord-kyron commented on GitHub (Jan 25, 2019): @ssbaksa @catborise > I have a problem with Ubuntu 18.04 server installed as a "template". When I clone that server, machine-id remain the same so to have working DHCP client I must manually recreate machine-id. I had used server, not live server ISO image as install media for this "template". For operating system images which are created once and used on multiple machines, for example for containers or in the cloud, /etc/machine-id should be an empty file in the generic file system image. An ID will be generated during boot and saved to this file if possible. Having an empty file in place is useful because it allows a temporary file to be bind-mounted over the real file, in case the image is used read-only. systemd-firstboot(1) may be used to to initialize /etc/machine-id on mounted (but not booted) system images. When a machine is booted with systemd(1) the ID of the machine will be established. If systemd.machine_id= or --machine-id= options (see first section) are specified, this value will be used. Otherwise, the value in /etc/machine-id will be used. If this file is empty or missing, systemd will attempt to use the D-Bus machine ID from /var/lib/dbus/machine-id, the value of the kernel command line option container_uuid, the KVM DMI product_uuid (on KVM systems), and finally a randomly generated UUID. After the machine ID is established, systemd(1) will attempt to save it to /etc/machine-id. If this fails, it will attempt to bind-mount a temporary file over /etc/machine-id. It is an error if the file system is read-only and does not contain a (possibly empty) /etc/machine-id file. Refference: http://manpages.ubuntu.com/manpages/bionic/man5/machine-id.5.html
Author
Owner

@ssbaksa commented on GitHub (Jan 30, 2019):

@catborise @Bandic007 I have solution for above mentioned problem but I am not sure should we discus it here or maybe this is a theme for another ticket. I have used guestfsd (actually guestfs alone) from command line to check and change state of machine-id for cloned image/server.

<!-- gh-comment-id:458820566 --> @ssbaksa commented on GitHub (Jan 30, 2019): @catborise @Bandic007 I have solution for above mentioned problem but I am not sure should we discus it here or maybe this is a theme for another ticket. I have used guestfsd (actually guestfs alone) from command line to check and change state of machine-id for cloned image/server.
Author
Owner

@catborise commented on GitHub (Jan 30, 2019):

@ssbaksa i think there is a solution to that. but requires some digging. i will research implementation possibility.

i said before that, my intention is that also using guestfsd. May be you know this tool : "virt-sysprep"
this tool can make specified operations, it prepares image...

"make an installation -> execute virt-sysprep -> convert image to template -> clone it" = solution
but if you clone an instance which is not a template!!! (this is a whole different case... )

virt-sysprep --list-operations
abrt-data * Remove the crash data generated by ABRT
backup-files * Remove editor backup files from the guest
bash-history * Remove the bash history in the guest
blkid-tab * Remove blkid tab in the guest
ca-certificates Remove CA certificates in the guest
crash-data * Remove the crash data generated by kexec-tools
cron-spool * Remove user at-jobs and cron-jobs
customize * Customize the guest
dhcp-client-state * Remove DHCP client leases
dhcp-server-state * Remove DHCP server leases
dovecot-data * Remove Dovecot (mail server) data
firewall-rules Remove the firewall rules
flag-reconfiguration Flag the system for reconfiguration
fs-uuids Change filesystem UUIDs
kerberos-data Remove Kerberos data in the guest
logfiles * Remove many log files from the guest
lvm-uuids * Change LVM2 PV and VG UUIDs
machine-id * Remove the local machine ID
mail-spool * Remove email from the local mail spool directory
net-hostname * Remove HOSTNAME and DHCP_HOSTNAME in network interface configuration
net-hwaddr * Remove HWADDR (hard-coded MAC address) configuration
pacct-log * Remove the process accounting log files
package-manager-cache * Remove package manager cache
pam-data * Remove the PAM data in the guest
passwd-backups * Remove /etc/passwd- and similar backup files
puppet-data-log * Remove the data and log files of puppet
rh-subscription-manager * Remove the RH subscription manager files
rhn-systemid * Remove the RHN system ID
rpm-db * Remove host-specific RPM database files
samba-db-log * Remove the database and log files of Samba
script * Run arbitrary scripts against the guest
smolt-uuid * Remove the Smolt hardware UUID
ssh-hostkeys * Remove the SSH host keys in the guest
ssh-userdir * Remove ".ssh" directories in the guest
sssd-db-log * Remove the database and log files of sssd
tmp-files * Remove temporary files
udev-persistent-net * Remove udev persistent net rules
user-account Remove the user accounts in the guest
utmp * Remove the utmp file
yum-uuid * Remove the yum UUID

<!-- gh-comment-id:458912609 --> @catborise commented on GitHub (Jan 30, 2019): > @ssbaksa i think there is a solution to that. but requires some digging. i will research implementation possibility. i said before that, my intention is that also using guestfsd. May be you know this tool : "virt-sysprep" this tool can make specified operations, it prepares image... "make an installation -> execute virt-sysprep -> convert image to template -> clone it" = solution but if you clone an instance which is not a template!!! (this is a whole different case... ) **virt-sysprep --list-operations** abrt-data * Remove the crash data generated by ABRT backup-files * Remove editor backup files from the guest bash-history * Remove the bash history in the guest blkid-tab * Remove blkid tab in the guest ca-certificates Remove CA certificates in the guest crash-data * Remove the crash data generated by kexec-tools cron-spool * Remove user at-jobs and cron-jobs customize * Customize the guest dhcp-client-state * Remove DHCP client leases dhcp-server-state * Remove DHCP server leases dovecot-data * Remove Dovecot (mail server) data firewall-rules Remove the firewall rules flag-reconfiguration Flag the system for reconfiguration fs-uuids Change filesystem UUIDs kerberos-data Remove Kerberos data in the guest logfiles * Remove many log files from the guest lvm-uuids * Change LVM2 PV and VG UUIDs machine-id * Remove the local machine ID mail-spool * Remove email from the local mail spool directory net-hostname * Remove HOSTNAME and DHCP_HOSTNAME in network interface configuration net-hwaddr * Remove HWADDR (hard-coded MAC address) configuration pacct-log * Remove the process accounting log files package-manager-cache * Remove package manager cache pam-data * Remove the PAM data in the guest passwd-backups * Remove /etc/passwd- and similar backup files puppet-data-log * Remove the data and log files of puppet rh-subscription-manager * Remove the RH subscription manager files rhn-systemid * Remove the RHN system ID rpm-db * Remove host-specific RPM database files samba-db-log * Remove the database and log files of Samba script * Run arbitrary scripts against the guest smolt-uuid * Remove the Smolt hardware UUID ssh-hostkeys * Remove the SSH host keys in the guest ssh-userdir * Remove ".ssh" directories in the guest sssd-db-log * Remove the database and log files of sssd tmp-files * Remove temporary files udev-persistent-net * Remove udev persistent net rules user-account Remove the user accounts in the guest utmp * Remove the utmp file yum-uuid * Remove the yum UUID
Author
Owner

@ssbaksa commented on GitHub (Jan 31, 2019):

@catborise

I am aware of this toll and it is powerful one. I don't need so much firepower and zapping machine-id for me is just enough for now.

<!-- gh-comment-id:459322281 --> @ssbaksa commented on GitHub (Jan 31, 2019): @catborise I am aware of this toll and it is powerful one. I don't need so much firepower and zapping machine-id for me is just enough for now.
Author
Owner

@lord-kyron commented on GitHub (Feb 2, 2019):

@catborise - are going to try and do some changes on the templates, ot should close it as "obsolete" :)

<!-- gh-comment-id:459936540 --> @lord-kyron commented on GitHub (Feb 2, 2019): @catborise - are going to try and do some changes on the templates, ot should close it as "obsolete" :)
Author
Owner

@catborise commented on GitHub (Feb 4, 2019):

it requires too much code change and causes some abnormalities. however it can be done, but i should look forward to "v2".
may be it much easy on v2. version 2 totally has different technologies. i have to learn them..

<!-- gh-comment-id:460138567 --> @catborise commented on GitHub (Feb 4, 2019): it requires too much code change and causes some abnormalities. however it can be done, but i should look forward to "v2". may be it much easy on v2. version 2 totally has different technologies. i have to learn them..
Author
Owner

@lord-kyron commented on GitHub (Feb 5, 2019):

Ok great! Thank you!

<!-- gh-comment-id:460533041 --> @lord-kyron commented on GitHub (Feb 5, 2019): Ok great! Thank you!
Author
Owner

@lord-kyron commented on GitHub (Feb 6, 2019):

it requires too much code change and causes some abnormalities. however it can be done, but i should look forward to "v2".
may be it much easy on v2. version 2 totally has different technologies. i have to learn them..

Have you tried V2 already? Is it working already or it is still in heavy development?

<!-- gh-comment-id:460977553 --> @lord-kyron commented on GitHub (Feb 6, 2019): > it requires too much code change and causes some abnormalities. however it can be done, but i should look forward to "v2". > may be it much easy on v2. version 2 totally has different technologies. i have to learn them.. Have you tried V2 already? Is it working already or it is still in heavy development?
Author
Owner

@catborise commented on GitHub (Feb 7, 2019):

no i havent tried it yet. some structures is ready but i have no idea. i am getting familiar with new framework...
django 2.1, python3, reactjs, material.css, django-rest-framework are using on v2. too much change :)

<!-- gh-comment-id:461324925 --> @catborise commented on GitHub (Feb 7, 2019): no i havent tried it yet. some structures is ready but i have no idea. i am getting familiar with new framework... django 2.1, python3, reactjs, material.css, django-rest-framework are using on v2. too much change :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#147
No description provided.