Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(326)

Issue 31870043: Allow the local provider to use kvm.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by thumper
Modified:
10 years, 5 months ago
Reviewers:
mp+196465, wallyworld
Visibility:
Public.

Description

Allow the local provider to use kvm. Add a 'container' config value for the local provider. The allows a local provider to use kvm instead of lxc if the host machine is kvm capable. TODO: prereqs needs to check for other needed packages. https://code.launchpad.net/~thumper/juju-core/kvm-local-provider/+merge/196465 Requires: https://code.launchpad.net/~thumper/juju-core/container-factory/+merge/196073 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Allow the local provider to use kvm. #

Total comments: 13

Patch Set 3 : Allow the local provider to use kvm. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -48 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M container/kvm/initialisation.go View 1 2 2 chunks +46 lines, -0 lines 0 comments Download
M container/kvm/libvirt.go View 1 2 chunks +4 lines, -11 lines 0 comments Download
M provider/local/config.go View 1 2 5 chunks +8 lines, -1 line 0 comments Download
M provider/local/environ.go View 1 2 chunks +6 lines, -2 lines 0 comments Download
M provider/local/environprovider.go View 1 2 4 chunks +16 lines, -1 line 0 comments Download
M provider/local/prereqs.go View 1 2 4 chunks +13 lines, -13 lines 0 comments Download
M provider/local/prereqs_test.go View 4 chunks +8 lines, -7 lines 0 comments Download
M utils/apt.go View 1 2 2 chunks +17 lines, -0 lines 0 comments Download
M utils/apt_test.go View 1 2 8 chunks +49 lines, -13 lines 0 comments Download
A utils/command.go View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
A utils/command_test.go View 1 2 1 chunk +52 lines, -0 lines 0 comments Download

Messages

Total messages: 4
thumper
Please take a look.
10 years, 5 months ago (2013-11-25 04:35:22 UTC) #1
thumper
Please take a look.
10 years, 5 months ago (2013-12-02 04:22:52 UTC) #2
wallyworld
LGTM with primarily the consolidation of the code to check kvm container dependencies with the ...
10 years, 5 months ago (2013-12-02 07:10:57 UTC) #3
thumper
10 years, 5 months ago (2013-12-02 21:29:24 UTC) #4
Please take a look.

https://codereview.appspot.com/31870043/diff/20001/provider/local/config.go
File provider/local/config.go (right):

https://codereview.appspot.com/31870043/diff/20001/provider/local/config.go#n...
provider/local/config.go:23: // to explicitly get from the config unknown
params.
On 2013/12/02 07:10:58, wallyworld wrote:
> My brain found it hard to parse the 2nd line above

tweaked slightly

https://codereview.appspot.com/31870043/diff/20001/provider/local/environprov...
File provider/local/environprovider.go (right):

https://codereview.appspot.com/31870043/diff/20001/provider/local/environprov...
provider/local/environprovider.go:49: containerType, ok :=
cfg.UnknownAttrs()[containerConfigKey].(string)
On 2013/12/02 07:10:58, wallyworld wrote:
> Part of me really doesn't like this UnknownAttrs() business and would love to
> see a proper cfg.ContainerType() API available. Not sure if we should
introduce
> a ContainerConfig interface and cast to that?

Refactored for better reading and understanding and taking the very small
overhead of creating the local config twice.

https://codereview.appspot.com/31870043/diff/20001/provider/local/environprov...
provider/local/environprovider.go:148: if localConfig.container() != "lxc" &&
localConfig.container() != "kvm" {
On 2013/12/02 07:10:58, wallyworld wrote:
> Can we use the ContainerType consts here instead of "lxc", "kvm"

Yes.

https://codereview.appspot.com/31870043/diff/20001/provider/local/prereqs.go
File provider/local/prereqs.go (right):

https://codereview.appspot.com/31870043/diff/20001/provider/local/prereqs.go#...
provider/local/prereqs.go:50: const kvmNeedsUbuntu = `Sorry, but KVM support
with the local provider is only supported
On 2013/12/02 07:10:58, wallyworld wrote:
> s/but//

Done.

https://codereview.appspot.com/31870043/diff/20001/provider/local/prereqs.go#...
provider/local/prereqs.go:154: packagesNeeded := []string{"libvirt-bin",
"uvtool-libvirt", "kvm"}
On 2013/12/02 07:10:58, wallyworld wrote:
> There's also code in the container.kvm package to deal with installing the
> required packages - see initialisation.go
> 
> I'd prefer this verifyKvm() function to be moved there so it's all done in one
> place.

Done.

https://codereview.appspot.com/31870043/diff/20001/utils/apt.go
File utils/apt.go (right):

https://codereview.appspot.com/31870043/diff/20001/utils/apt.go#newcode87
utils/apt.go:87: func RunCommand(command string, args ...string) (output string,
err error) {
On 2013/12/02 07:10:58, wallyworld wrote:
> I'd like to see this in a file called command.go since it's not really
anything
> to do with apt per se. And tests in command_test.go

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b