tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Consider supporting `Guest.resume()` - re-starting the instance

Open pvalena opened this issue 5 years ago • 3 comments

Would it make sense to have resume() in API, to re-start some instance? For long running VMs / restarts f,e,? IOW opposite of stop() method.

_Originally posted by @pvalena in https://github.com/render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjgzMTkxMDM3OnYy/pull_request_review_threads/discussion

pvalena avatar Jul 20 '20 12:07 pvalena

Hi.

Just some notes:

This feature must by supported by backend. In minute plugin, there is no minute api to support this and instances are just throw away (by .stop() call) in openstack.

There is no way how to pause and unpause/resume machine in minute plugin now. Not sure about other backends. Maybe virtual, running on your own machine, can support this because you just deplete your own resources.

Do I understand this issue correctly?

RHEmployee avatar Feb 08 '23 10:02 RHEmployee

Yes, I believe this is the case. Why not support it, if the backend supports it? VMs, containers....

pvalena avatar Mar 14 '23 18:03 pvalena

Please note that I want to pause the work, reboot my machine and then continue, or just conserve my resources, while debugging 4 (sub)plans, i.e. not running 4 VMs overnight etc.....

pvalena avatar Mar 14 '23 18:03 pvalena

What would the scenario look like?

tmt run --id complex-job --until execute
tmt run --id complex-job execute --again
...
tmt run --id complex-job suspend

# go sleep as it's getting too late

tmt run --id complex-job resume
tmt run --id complex-job execute
tmt run --id complex-job execute --again
...

Something like this? @pvalena, do you still find this worth implementing?

psss avatar Oct 01 '25 15:10 psss

What would the scenario look like?

tmt run --id complex-job --until execute
tmt run --id complex-job execute --again
...
tmt run --id complex-job suspend

Yes, suspend!

go sleep as it's getting too late

Or on a bus or bike, conserve battery, network is offline etc...

tmt run --id complex-job resume tmt run --id complex-job execute

Do I need to restart the execution manually? If (let's say) VM is suspended, it should just plainly continue [if not failed]?

tmt run --id complex-job execute --again ...


Something like this? [@pvalena](https://github.com/pvalena), do you still find this worth implementing?

Sounds like a good usecase, although I have none for it now. Currently I prefer to run everything in CI (or in a VM on a host anyway), so it's not an issue for me anymore.


EDIT: thinking about it more, if I simply have a way to cancel (stop) test suite in the middle of processing, and then restarting ~~everything~~ the execute step on demand (f.e. after my host machine reboots), then it's basically resolved (even without the suspend scenario).

pvalena avatar Oct 01 '25 16:10 pvalena

Ok, let's keep it in the backlog as a nice-to-have idea.

psss avatar Oct 08 '25 14:10 psss