mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-04-25 23:45:56 +03:00
[GH-ISSUE #225] Feature Proposal: Labels and Tags for Instances #150
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/webvirtcloud#150
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kstieger on GitHub (Mar 6, 2019).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/225
Hi,
we are moving from ESXi to KVM servers in our company. One useful feature in vSphere Client was, you could group machines in folders (resource groups).
Unfortunately wervirtcloud and/or libvirt doesn't support this out of the box.
So I decided to implement (or better hack) it for our needs. The idea was to use the section of the xml definition of a Domain to store a project label and tags.
Looks like this:
How it looks in the instances view and the instance settings you can see in the attached screenshots.
My code changes are very hacky (at least the django frontend stuff) and currently the grouping is only available as admin user.
But, if you like it, I would share my changes. But it needs further work to get a clean implementation. And I would need help with the django part.
@catborise commented on GitHub (Mar 7, 2019):
hi,
it is a nice feature, tagging and grouping. It is nice to have. i think it can be done with webvirtcloud but modifying libvirt xml.. ımmh i dont know.
There are two views for intances list. first one is host group view. The other ungrouped instance list view.
May be we can add the other view which is directory/project/resources view.
one question: why dont you use description field for tag info? for search? for grouping? what is the benefit ?
@kstieger commented on GitHub (Mar 7, 2019):
Hi,
thanks for reply.
Yes, first I was also thinking about to 'abuse' description field for this additional meta data.
But description is also used for free text information (in our case) and parsing this would be very hard.
And yes, description is also not present in the Instances view, so I think searching would also not available out of the box.
To store the information directly in the machines configuration has the advantage, that the information is also available for other systems than webvirtcloud (also kind of mandatory in my usecase).
In the libvirt XML Domain definition there is already a section for store this kind of data: https://libvirt.org/formatdomain.html#elementsMetadata
AFAIK OpenStack is also using this for additional data.
Yes, you are right with the topic of the different views. I did a really dirty hack and rewrote the the grouped View. Thats why I didn't make pull request, this has to be fixed. Maybe it is possible to do this with Javascript/jQuery to rewrite the table on demand when triggering a switch like 'Group by Label' or so ... (But I don't have any skills in this technics. ;) )
If interrested I could create a patch for you in the next days. So you could try it, and review my changes.
Regards,
Kurt
@catborise commented on GitHub (Mar 7, 2019):
i especially using this application for instance names. As you know openstack/cloudstack/opennebula gives name like instance-xyz. I do not want that. I want to give names like i write. Because i do not want to lock myself to management node. i want to manage them easily without many layers.
As i see, you are using libvirt/webvirtcloud like openstack/cloudstack/opennebula/proxmox style. Why do not use them?(this question is only for my curiosity)
We can use metadata tags for instances. it could be useful. But main consideration of this app is that giving web ui to libvirt. it is not a management app like openstack controller or vcenter server.
Beside that if you upload your code to github i can check it.
And there is a version 2 it could give much more flexibility(with api, react, django-restframework ), but it is not ready yet.
(i am a contributor, owner is retspen :) big changes are his decision)
@kstieger commented on GitHub (Mar 7, 2019):
Hi,
yes this is the same reason why we are using webvirtcloud and not one of the cloud controllers. Webvirtcloud acts as a simple and quick interface to manage and view the the running domains.
As I said, it's working fine here and I just wanted to know if this changes would be useful for other webvirtcloud users. In this case I would contribute my code for discussion about.
I will create a patch or PR and then you decide if it is useful for the product.
@lord-kyron commented on GitHub (Mar 7, 2019):
Hi all,
I am really FOR the labels / tags functionality. It will also help me a lot to manage my VM instances.
SO I am supporting this with two hands :)
Another great functionality will be the VNC reverse proxying to be option to choose (or enabled by default).
@kstieger - please, upload your code and contribute it. It will help a lot 👍
@kstieger commented on GitHub (Mar 12, 2019):
Hi,
@Bandic007 , @catborise:
I commited my changes to the forked repo:
https://github.com/kstieger/webvirtcloud/tree/labelsAndTags
As I mentioned before, the code is far from perfect and at least the 2nd commit for grouping on labels has much space for improvement. But for now this only a proposal. Let me know what you think about this.
Thanks
@lord-kyron commented on GitHub (Mar 12, 2019):
@catborise - can you merge this with your repo and review if you can improve something? I don't get the code so much but I will test it too!
Thanks!
@catborise commented on GitHub (Mar 13, 2019):
@Bandic007 kstieger is using my latest commit. it includes everything, so you can test it. Feedback is important.
my main consideration is merging it as third view option..
@kstieger i have some questions about code for clearity. i will write them to code line...
thanks
@lord-kyron commented on GitHub (Mar 14, 2019):
I've tried it and I am getting the following error when I try to access the Instances page from inside the Compute:
`
`
@kstieger commented on GitHub (Mar 14, 2019):
Uahah, yes I can see it.
Introduced with this commit
github.com/kstieger/webvirtcloud@3137d9882aWill have a look on it soon.
Thanks, for finding.
@lord-kyron commented on GitHub (Mar 14, 2019):
@kstieger - about the addition in the settings.py file about xml - which address should I put there and will it work as expected if I leave it default
@kstieger commented on GitHub (Mar 14, 2019):
Hi @Bandic007 .
In most cases the default should be ok. It just needs to be a uniq identifier for the namespace. It could also be set to 'webvirtcloud.io/metadata'. However, if you have a domain under your control you could use this.
My source for this topic: https://en.wikipedia.org/wiki/XML_namespace
Greetings.
@lord-kyron commented on GitHub (Mar 14, 2019):
@kstieger - great, thanks!
Can you please review the instaces page as I am using it more often trough there than the dashboard.
Thank you!
@kstieger commented on GitHub (Mar 15, 2019):
@Bandic007 : Fixed the issue with the Compute > Instances view temporary.
(see also https://github.com/kstieger/webvirtcloud/issues/1)
This view works now again, but without labels and tags. Will implement this asap.
Meanwhile you can pull my latest commit to get rid of the error message.
@lord-kyron commented on GitHub (Mar 15, 2019):
@kstieger - can you make the separator for the tags to be comma or semicolon (, or ;) - not space? It seems more logical to me.
@kstieger commented on GitHub (Mar 15, 2019):
@Bandic007: I prefer whitespaces, but I consider to make it configureable, https://github.com/kstieger/webvirtcloud/issues/3
@lord-kyron commented on GitHub (Mar 16, 2019):
Thank you! Can such tags functionality be applied for examole for the drives of the vms too? I mean when I go in storage, choose the disks storage and view all drives there, to be able to tag them too or matbe they to get tags from the vms that they are attached to? Or it willl be too much of a change?
@kstieger commented on GitHub (Mar 16, 2019):
@Bandic007 This sounds very interesting. Let keep this in mind. But for now the metadata is stored in the domain (vm instance) context. I don't know if the volume or storage pool xml definition also allows to store metadata. Didn't find it on the first look. Can you create a feature ticket with a usecase example in my fork?
But for now I'll care about to implement the labels and tags in a correct way to the views. When this is done, and the code is mergeable we can think about metadata for other items than domains.
@lord-kyron commented on GitHub (Mar 16, 2019):
Great! You plan to merge with catborise repo or with master one?
@lord-kyron commented on GitHub (Mar 19, 2019):
@kstieger - when do you plan to merge?
@lord-kyron commented on GitHub (Mar 21, 2019):
Hey @kstieger - there are some updates on the @catborise repo - please, pull first before merge as I want to get the latest changes :) I can't wait to see this merge happen as it will help me so much in organisation.
@lord-kyron commented on GitHub (Mar 26, 2019):
@catborise - do you plan to implement labels and tags in your repo too? My main upstream is your repo, so I will be glad if I can pull them from there after your revision of course!
@catborise commented on GitHub (Mar 26, 2019):
I think kurt develops it as third view option. If he completes it as described he could merge it to retspen also i can merge... it could takes time to implement. I can also implement it but it would be redundant effort.
Meanwhile v2 waits for centos 8, retspen said that.
@schidirala-celestial commented on GitHub (Feb 15, 2023):
Hi Team,
in which file do I need to add the below entry, I appreciate it if you can share how-to