Skip to content

Rework domain manager to use virtblocks#2

Open
rmohr wants to merge 9 commits intovirtblocks:masterfrom
rmohr:virtblocks
Open

Rework domain manager to use virtblocks#2
rmohr wants to merge 9 commits intovirtblocks:masterfrom
rmohr:virtblocks

Conversation

@rmohr
Copy link

@rmohr rmohr commented Sep 24, 2019

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NONE

@rmohr
Copy link
Author

rmohr commented Sep 24, 2019

@andreabolognani FYI. Started the refactoring.

@rmohr
Copy link
Author

rmohr commented Sep 24, 2019

@jnsnow FYI

@@ -0,0 +1,45 @@
package virtwrap
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnsnow @jnsnow this file contains most of the things of what we will need one or the other form virtblocks, functionality-wise. What is missing here is "monitoring" the process and sending events. Still extracting this part.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been keeping up with the conversation, though I've just skimmed the code.

Monitoring is not something that we're likely to get around to during the experiment, so let's just have a dummy monitoring function that does nothing for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I will do something simple, like just checking if the qemu pid is still there. If not send fail. Otherwise send running.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds simple enough to implement, thumbs up to the idea.

Signed-off-by: Roman Mohr <rmohr@redhat.com>
Instaed of listening to libvirt events, check "something" every second
and report if the state changed.

Signed-off-by: Roman Mohr <rmohr@redhat.com>
}
}()

go func() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of listening to libvirt events, this right now simply polls every second "something" and checks if something interesting happened.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next I will update the tests. Then a full shell for virtblocks is ready which does not depend on anything from libvirt.

Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
}

type VirtBlockDomainImpl struct {
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this (and VirtBlockDomain above) should be s/VirtBlock/VirtBlocks/g.

@andreabolognani
Copy link

For the libvirt integration I've created a separate virtblocks branch in the clone, which IMHO makes it easier to make changes that are specific to our experiment while still pulling updates from upstream on a regular basis. Feel free to do things differently here if you think it makes more sense, but it would be nice to be consistent.

Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
Starting a domain and connecting via serial console works
Signed-off-by: Roman Mohr <rmohr@redhat.com>
@rmohr
Copy link
Author

rmohr commented Sep 30, 2019

@andreabolognani I can do that. No problem.

The PR now successfully uses virtblocks. It is possible to start VMIs, connect via serial console (kubectl.sh console myvm) and shut the VMI down. All managed as usual.

Note that the current architecture here is still more complex than actually needed. In the current fashion it can co-exist with the libvirt implementation.

} else if err != nil {
return fmt.Errorf("could not determine if process is already running: %v", err)
}
cmdStr = append(cmdStr, "-uuid", "272b47a8-b72b-4cd7-9109-79005816cc31")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just add UUID support to Virt Blocks instead of working around the missing feature in KubeVirt? Should be trivial to do so.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely. Just didn't get to it.

@andreabolognani
Copy link

@rmohr FYI yesterday I updated https://github.com/virtblocks/libvirt/tree/virtblocks to take advantage of VM models; ideally you'd to the same here for KubeVirt, but if you don't have time right now that's okay too :)

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.

2 participants