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

LibVirt machinery should create the KVM domain #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sempervictus
Copy link

Currently, LibVirt machinery can determine the snapshot and revert
the VM state to it, but it jumps straight to waiting for a state
change without actually issuing a create call to the domain being
used.

Add a single line to call self.vms[label].create() after resolving
the snapshot state and prior to entering the wait state.

@spender-sandbox
Copy link
Owner

What was the user-visible impact of not having the call in there?

-Brad

@sempervictus
Copy link
Author

sempervictus commented Nov 27, 2016 via email

@spender-sandbox
Copy link
Owner

Is it libvirt version-specific? I've definitely used KVM extensively with cuckoo without any problems, and know of many others with the same experience. So I'd like to understand more about why we would need this change.

-Brad

@doomedraven
Copy link
Contributor

My friends and I use kvm for long time with no errors/mods required also

@sempervictus sempervictus force-pushed the feature-modified-libvirt_start_create_domain branch from bbd5020 to 697c7e4 Compare November 28, 2016 07:53
Currently, LibVirt machinery can determine the snapshot and revert
the VM state to it, but it jumps straight to waiting for a state
change without actually issuing a create call to the domain being
used. This is likely due to it expecting a live-state snapshot to
be instantiated which automatically starts the instance.

Add a conditional call self.vms[label].create() after resolving VM
snapshot state and prior to entering the wait state. If the VM
power state is still off, try to create the KVM domain with basic
error handling. This should not case race conditions as preceeding
snapshot operations are serialized and complete prior to returning.
@sempervictus sempervictus force-pushed the feature-modified-libvirt_start_create_domain branch from 697c7e4 to b2e26d6 Compare November 28, 2016 08:02
@sempervictus
Copy link
Author

I imagine most people probably take live-state snapshots and relying on libvirt to start the instance for them when instantiating one. I've been mostly using offline snaps since they dont register a relative boot time of prior to snapshot creation and just look like a freshly started host from the heuristic pespective.

Along this train of thought, i've updated the PR to check VM power state after snapshot instantiation, and only attempt to create the domain if its still off under the premise that live snapshots would have turned it on already. Internal testing in live and offline snapshot use cases seems fine - hasn't blown up yet.

@KillerInstinct
Copy link
Contributor

How does cuckoo work if you don't take the snapshot with a running VM?

@sempervictus
Copy link
Author

@KillerInstinct - boot-time automation via cloud-init, Chef, etc. Simulates a freshly started machine opening a browser and downloading "bad stuff."
Sorry for the 2y lag on response there, fail on my part.

@doomedraven
Copy link
Contributor

Repo is dead

@sempervictus
Copy link
Author

Yeah, I know, was digging around for something else and ran across this thread again. Thanks for the heads up though.

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

Successfully merging this pull request may close these issues.

4 participants