xcp-ng / xenadmin

XCP-ng Center, the Windows management console for XCP-ng and XenServer. /!\ EOL-Notice /!\ Community-maintained only /!\
https://xcp-ng.org
Other
429 stars 74 forks source link

Enhancement: Suspend to RAM (cli: vm pause) #121

Closed lurendrejer closed 5 years ago

lurendrejer commented 5 years ago

Xen has the ability to Pause a VM (Suspend to RAM). Which is instant. The XCP-Center gui only has the Suspend to disk feature - which takes a long time.

Could a Pause/Unpause button be added to the gui? Maybe even the ability to pause an entire hosts vm's

More info: https://discussions.citrix.com/topic/329558-what-the-difference-between-cli-vm-suspend-and-vm-pause/

Picture of paused VM's: image

lurendrejer commented 5 years ago

With this functionality i could pause all my hundreds of vm's within seconds, when the students leave.. Suspending to disk involves writing their three terrabytes of ram to disks.... :-/

olivierlambert commented 5 years ago

What's the use case? Free resources while people are AFK on their VMs?

lurendrejer commented 5 years ago

Save power and money from 15:15 to 08:00.

I'm already doing so via script, but a busy few would like to work late - and having a gui button would enable them to. :)

lurendrejer commented 5 years ago

Pfsense uses 10% of a single core when idling. When running 100-200 doing nothing at all, during the weekend, it gets kinda stupid in cooling, power, etc.

lurendrejer commented 5 years ago

With nested gns3 it gets even worse....

borzel commented 5 years ago

I did some tests with xe vm-pause and xe vm-unpause .. there is some value in having these commands on the gui.

If someone feels free to implement this stuff, I'm the last who won't merge it ;-)

lurendrejer commented 5 years ago

We have quite a few developers with very limited experience (currently under education in software development). I'll see if I can do something.

olivierlambert commented 5 years ago

@lurendrejer tomorrow or Friday we'll release the feature in Xen Orchestra stable. This will support bulk pause/unpause too (in the home view, you'll be able to filter on VMs, select them and do the pause/unpause at once).

lurendrejer commented 5 years ago

Aah neato. I started our project on xoa, self service was perfect except for some glaring issues mostly regarding filtering resources. It uses uuids on creation of resource pools instead of names on usage of the pools. Having the ability to enter "local storage*" is one of the features we are looking to develop in-house. Shared storage is way out of our reach right now, and using uuids instead of names/filters makes every addition of hardware a chore. :)

An example: I have 200vlans, that all my users should be able to connect to their vms. Having the ability to just enter vlan into the resource pool - sure beats entering 200 exact names. And the gui goes bonkers when handling large amounts of objects anyhow. :)

I know the education sector is a special usecase. And I understand completely why xoa does what it does.

olivierlambert commented 5 years ago

You can't rely on name_label to build anything ;) (because a label is not fixed by definition). But feel free to explain your use case (not a technical solution, but your real use case/the thing you want to achieve in the end) on XO bug tracker. Then we could think on how to do so.

lurendrejer commented 5 years ago

I understand - security and stability is key. Except for us.... :)

We need things to be dynamic.

lurendrejer commented 5 years ago

Dynamic resources in self service - that is what we need, actually.

olivierlambert commented 5 years ago

Please open (or update if the issue exists) a ticket in XO repo

lurendrejer commented 5 years ago

I will, if it comes up again. No need to pressure your team for no good reason. We are looking into development on xoa in-house. I'm hoping that we can contribute at a later time.

XCP-center and scripting/automation became the solution for us, for now.

Thank you for a great product though!

olivierlambert commented 5 years ago

FWI, pause/unpause (individually or in bulk) is here in XO since last Thursday :) (see this blog post)

lurendrejer commented 5 years ago

I've been testing it from the minute it released, great work 👍

cocoon commented 5 years ago

I am still thinking about the two possibilities:

But I tried directly in the UI and it seems possible ... now I need to add unpause ...

001-test 002-test

003-test

lurendrejer commented 5 years ago

You are awesome!

cocoon commented 5 years ago

Way back is working, too. Messages are a placeholder, just to see where that messages appears.

004-test 005-test 006-test

lurendrejer commented 5 years ago

Personally i think that a confirmation dialog for an instant action is a bit overkill. But if it follows some guideline of the GUI - fine by me :)

Pause could have a dialog, unpause - is a bit much to have the user confirm.

lurendrejer commented 5 years ago

Nice unpause-icon btw. And again, great work :)

borzel commented 5 years ago

@cocoon cool!

cocoon commented 5 years ago

if someone wants to test, here a test build:

File: Release.7z Download-URL: https://file.io/ltfoHK Size: ~5MB MD5: 96b50c5adf6ee3214cabb850a40bf294 SHA-1: 715cd7ff4f48559822bc589276d107815f7df3db

It is only working from the context menu, for single and multiple selected VMs. And I disabled confirmation dialogs.

lurendrejer commented 5 years ago

I get a 404-file not found :)

cocoon commented 5 years ago

oops strange, give me some minutes ...

cocoon commented 5 years ago

https://file.io/YvKQnM

... I forgot about this: "after it is downloaded, the file is completely deleted"

So another one here: http://nullupload.com/download-b545d86df0

lurendrejer commented 5 years ago

Hi, i've been quite busy - I'll be testing it tomorrow morning. And, thank you !!

lurendrejer commented 5 years ago

Everything seems to be working as planned! Tested with single and multiple servers.

Thank you!

lurendrejer commented 5 years ago

I don't know about the pause and suspend labels - it isn't intuitive to new users. Shouldn't they be called hibernate and suspend? Maybe suspend to RAM and suspend to disk?

lurendrejer commented 5 years ago

Maybe 'Suspend' should be called Save state. And Pause should be called Suspend/Resume.

That would be instantly recognisable for new users.

cocoon commented 5 years ago

I think renaming an command would not be good, because it should match the api / cli command naming. If somebody is searching for documentation about it, it is much easier if it matches.

But there could be a short info/tooltip or so telling like "(to RAM)" and "(to Disk)".

lurendrejer commented 5 years ago

You a completely right :) But, Force shutdown is called "Hard poweroff" in the API, as far as i know. So, some form of usability-enhanced naming is already in effect.

lurendrejer commented 5 years ago

vmware and hyper-v more or less agreed on suspend/resume and save state in their gui's.

borzel commented 5 years ago

@cocoon I do some testing and add the "fixme" texts to MESSAGES

borzel commented 5 years ago

It's availabe in our pre-release: https://github.com/xcp-ng/xenadmin/releases/tag/v7.6.3-Preview1

@cocoon I also added two new images for the pause state, so the VM icon has not the same pause symbol like in the suspend state

Suspended grafik

Paused grafik