Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: image template re-organisation #219

Closed
lord-kyron opened this issue Jan 18, 2019 · 17 comments
Closed

Feature request: image template re-organisation #219

lord-kyron opened this issue Jan 18, 2019 · 17 comments

Comments

@lord-kyron
Copy link
Contributor

lord-kyron commented Jan 18, 2019

@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. :)

@catborise
Copy link
Collaborator

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

@lord-kyron
Copy link
Contributor Author

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?

@catborise
Copy link
Collaborator

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

@lord-kyron
Copy link
Contributor Author

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

@ssbaksa
Copy link

ssbaksa commented 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".

@catborise
Copy link
Collaborator

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

@ssbaksa
Copy link

ssbaksa commented Jan 25, 2019

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

@catborise
Copy link
Collaborator

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

@lord-kyron
Copy link
Contributor Author

@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

@ssbaksa
Copy link

ssbaksa commented 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.

@catborise
Copy link
Collaborator

catborise commented 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

@ssbaksa
Copy link

ssbaksa commented 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.

@lord-kyron
Copy link
Contributor Author

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

@catborise
Copy link
Collaborator

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..

@lord-kyron
Copy link
Contributor Author

Ok great! Thank you!

@lord-kyron
Copy link
Contributor Author

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?

@catborise
Copy link
Collaborator

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants