Repository: kubernetes/minikube
Pull request #8901 (2020-08-02 03:11:37)

Use mebibytes instead of megabytes
It's a minor nitpick but I believe that the hard drive and memory assigned while using KVM and platforms using raw disks was meant to be MiB based on [this](https://github.com/kubernetes/minikube/blob/294a5c3e7b363a999bdb5f73ef6e1b2b8b275193/pkg/util/utils.go#L35-L48). This patch simply calculates disk size in MiB and assigns the correct unit in the domain configruation for libvirt.

k8s-ci-robot: Welcome @bluestealth! <br><br>It looks like this is your first PR to <a href='https://github.com/kubernetes/minikube'>kubernetes/minikube</a> 🎉. Please refer to our [pull request process documentation](https://git.k8s.io/community/contributors/guide/pull-requests.md) to help your PR have a smooth ride to approval. <br><br>You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. [Here is the bot commands documentation](https://go.k8s.io/bot-commands). <br><br>You can also check if kubernetes/minikube has [its own contribution guidelines](https://github.com/kubernetes/minikube/tree/master/CONTRIBUTING.md). <br><br>You may want to refer to our [testing guide](https://git.k8s.io/community/contributors/devel/sig-testing/testing.md) if you run into trouble with your tests not passing. <br><br>If you are having difficulty getting your pull request seen, please follow the [recommended escalation practices](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#why-is-my-pull-request-not-getting-reviewed). Also, for tips and tricks in the contribution process you may want to read the [Kubernetes contributor cheat sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md). We want to make sure your contribution gets all the attention it needs! <br><br>Thank you, and welcome to Kubernetes. :smiley:
k8s-ci-robot: Hi @bluestealth. Thanks for your PR.

I'm waiting for a [kubernetes](https://github.com/orgs/kubernetes/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://git.k8s.io/community/community-membership.md#member) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubernetes%2Fminikube).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

minikube-bot: Can one of the admins verify this patch?
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes/minikube/pull/8901#" title="Author self-approved">bluestealth</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **afbjorklund**
You can assign the PR to them by writing `/assign @afbjorklund` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes%2Fminikube).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes/minikube/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["afbjorklund"]} -->
TravisBuddy: ## Travis tests have failed

Hey @bluestealth,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.


### 1st Build

<a href="https:&#x2F;&#x2F;travis-ci.org&#x2F;kubernetes&#x2F;minikube&#x2F;jobs&#x2F;714136929">View build log</a>


<details>
  <summary>
    <strong>
     make test
    </strong>
  </summary>

```
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.14.6.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.3/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.14.6.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.3/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
MINIKUBE_LDFLAGS="-X k8s.io/minikube/pkg/version.version=v1.12.1 -X k8s.io/minikube/pkg/version.isoVersion=v1.12.0 -X k8s.io/minikube/pkg/version.isoPath=minikube/iso -X k8s.io/minikube/pkg/version.gitCommitID="ea9c73ea2ac8f32694057bf11a3018386c3b2f53"" ./test.sh
= schema_check ==========================================================
go: downloading github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f
go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f
ok
= go test ===============================================================
go: downloading github.com/machine-drivers/machine v0.7.1-0.20200323212942-41eb826190d8
go: downloading k8s.io/api v0.17.3
go: downloading gopkg.in/yaml.v2 v2.3.0
go: downloading github.com/juju/mutex v0.0.0-20180619145857-d21b13acf4bf
go: downloading k8s.io/kubernetes v1.17.3
go: downloading golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
go: downloading k8s.io/apimachinery v0.17.3
go: downloading github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d
go: downloading k8s.io/client-go v0.17.3
go: downloading github.com/pkg/browser v0.0.0-20160118053552-9302be274faa
go: downloading github.com/pkg/profile v0.0.0-20161223203901-3a8809bd8a80
go: downloading github.com/shirou/gopsutil v2.18.12+incompatible
go: downloading github.com/spf13/viper v1.7.0
go: downloading golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
go: downloading github.com/pelletier/go-toml v1.8.0
go: downloading github.com/blang/semver v3.5.0+incompatible
go: downloading github.com/spf13/cobra v1.0.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
go: downloading github.com/pkg/errors v0.9.1
go: downloading k8s.io/klog v1.0.0
go: downloading github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
go: downloading github.com/hooklift/iso9660 v0.0.0-20170318115843-1cf07e5970d8
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading k8s.io/kubectl v0.17.3
go: downloading gopkg.in/ini.v1 v1.56.0
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/sayboras/dockerclient v1.0.0
go: downloading github.com/cloudevents/sdk-go/v2 v2.1.0
go: downloading github.com/google/slowjam v0.0.0-20200530021616-df27e642fe7b
go: downloading github.com/docker/go-units v0.4.0
go: downloading github.com/afbjorklund/go-containerregistry v0.0.0-20200602203322-347d93793dc9
go: downloading github.com/spf13/afero v1.2.2
go: downloading github.com/c4milo/gotoolkit v0.0.0-20170318115440-bcc06269efa9
go: downloading sigs.k8s.io/sig-storage-lib-external-provisioner v4.0.0+incompatible
go: downloading golang.org/x/text v0.3.2
go: downloading github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
go: downloading golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2
go: downloading github.com/opencontainers/go-digest v1.0.0-rc1
go: downloading sigs.k8s.io/sig-storage-lib-external-provisioner/v5 v5.0.0
go: downloading github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
go: downloading github.com/machine-drivers/docker-machine-driver-vmware v0.1.1
go: downloading github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c
go: downloading github.com/libvirt/libvirt-go v3.4.0+incompatible
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/olekukonko/tablewriter v0.0.4
go: downloading go.uber.org/zap v1.10.0
go: downloading github.com/prometheus/client_golang v1.4.1
go: downloading github.com/otiai10/copy v1.0.2
go: downloading golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1
go: downloading github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading golang.org/x/sys v0.0.0-20200523222454-059865788121
go: downloading go.opencensus.io v0.22.3
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/magiconair/properties v1.8.1
go: downloading cloud.google.com/go v0.57.0
go: downloading github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: downloading github.com/golang/protobuf v1.4.2
go: downloading github.com/googleapis/gnostic v0.3.0
go: downloading go.uber.org/atomic v1.4.0
go: downloading github.com/cenkalti/backoff v2.2.1+incompatible
go: downloading github.com/google/uuid v1.1.1
go: downloading github.com/google/gofuzz v1.0.0
go: downloading github.com/mattn/go-runewidth v0.0.7
go: downloading github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6
go: downloading github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b
go: downloading github.com/gogo/protobuf v1.3.1
go: downloading github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd
go: downloading github.com/prometheus/common v0.9.1
go: downloading github.com/mitchellh/mapstructure v1.3.1
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6
go: downloading github.com/cespare/xxhash v1.1.0
go: downloading github.com/prometheus/procfs v0.0.8
go: downloading cloud.google.com/go/storage v1.8.0
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading go.uber.org/multierr v1.1.0
go: downloading github.com/docker/cli v0.0.0-20200303162255-7d407207c304
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/miekg/dns v1.1.27
go: downloading google.golang.org/grpc v1.29.1
go: downloading github.com/docker/distribution v2.7.1+incompatible
go: downloading github.com/afbjorklund/go-getter v1.4.1-0.20190910175809-eb9f6c26742c
go: downloading google.golang.org/api v0.25.0
go: downloading google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece
go: downloading github.com/aws/aws-sdk-go v1.31.6
go: downloading k8s.io/utils v0.0.0-20200229041039-0a110f9eb7ab
go: downloading github.com/mitchellh/go-wordwrap v1.0.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading google.golang.org/protobuf v1.24.0
go: downloading github.com/hashicorp/go-cleanhttp v0.5.1
go: downloading github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d
go: downloading github.com/hashicorp/golang-lru v0.5.3
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading sigs.k8s.io/yaml v1.1.0
go: downloading github.com/json-iterator/go v1.1.9
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/ulikunitz/xz v0.5.7
go: downloading github.com/googleapis/gax-go v2.0.2+incompatible
go: downloading github.com/googleapis/gax-go/v2 v2.0.5
go: downloading github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57
go: downloading github.com/cheggaaa/pb v1.0.27
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading github.com/docker/docker-credential-helpers v0.6.3
go: downloading github.com/hashicorp/go-version v1.2.0
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
go: downloading github.com/hashicorp/go-safetemp v1.0.0
go: downloading github.com/mitchellh/go-testing-interface v1.0.0
go: downloading github.com/google/go-cmp v0.4.1
go: downloading github.com/imdario/mergo v0.3.9
go: downloading github.com/cheggaaa/pb/v3 v3.0.1
go: downloading k8s.io/component-base v0.17.3
go: downloading github.com/opencontainers/image-spec v1.0.1
go: downloading k8s.io/cluster-bootstrap v0.17.3
go: downloading github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac
go: downloading k8s.io/kube-proxy v0.17.3
go: downloading github.com/jmespath/go-jmespath v0.3.0
go: downloading k8s.io/kubelet v0.17.3
go: downloading github.com/fatih/color v1.9.0
go: downloading github.com/mattn/go-colorable v0.1.6
go: downloading github.com/VividCortex/ewma v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/evanphx/json-patch v4.5.0+incompatible
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
ok  	k8s.io/minikube/cmd/minikube/cmd	4.323s	coverage: 18.7% of statements
ok  	k8s.io/minikube/cmd/minikube/cmd/config	0.046s	coverage: 21.5% of statements
ok  	k8s.io/minikube/pkg/addons	0.083s	coverage: 53.3% of statements
--- FAIL: Test_createDiskImage (0.00s)
    common_test.go:48: Disk size is 107374182, want 100000000
FAIL
coverage: 25.5% of statements
FAIL	k8s.io/minikube/pkg/drivers	0.007s
ok  	k8s.io/minikube/pkg/drivers/hyperkit	0.005s	coverage: 77.3% of statements
ok  	k8s.io/minikube/pkg/drivers/kic/oci	0.012s	coverage: 0.0% of statements
ok  	k8s.io/minikube/pkg/drivers/kvm	0.034s	coverage: 2.3% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper	0.994s	coverage: 55.7% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper/bsutil	0.125s	coverage: 62.4% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper/bsutil/ktmpl	0.005s	coverage: 100.0% of statements
ok  	k8s.io/minikube/pkg/minikube/bootstrapper/images	0.012s	coverage: 84.2% of statements
ok  	k8s.io/minikube/pkg/minikube/cluster	0.051s	coverage: 15.3% of statements
ok  	k8s.io/minikube/pkg/minikube/command	0.051s	coverage: 4.3% of statements
ok  	k8s.io/minikube/pkg/minikube/config	0.221s	coverage: 70.0% of statements
ok  	k8s.io/minikube/pkg/minikube/cruntime	0.053s	coverage: 36.6% of statements
ok  	k8s.io/minikube/pkg/minikube/docker	0.027s	coverage: 20.8% of statements
ok  	k8s.io/minikube/pkg/minikube/driver	0.020s	coverage: 34.9% of statements
ok  	k8s.io/minikube/pkg/minikube/extract	0.011s	coverage: 58.8% of statements
ok  	k8s.io/minikube/pkg/minikube/image	0.025s	coverage: 3.0% of statements
ok  	k8s.io/minikube/pkg/minikube/kubeconfig	0.042s	coverage: 77.0% of statements
ok  	k8s.io/minikube/pkg/minikube/localpath	0.021s	coverage: 49.3% of statements
ok  	k8s.io/minikube/pkg/minikube/logs	0.034s	coverage: 1.3% of statements
ok  	k8s.io/minikube/pkg/minikube/machine	1.434s	coverage: 37.8% of statements
ok  	k8s.io/minikube/pkg/minikube/notify	0.016s	coverage: 92.9% of statements
ok  	k8s.io/minikube/pkg/minikube/out	0.056s	coverage: 58.7% of statements
ok  	k8s.io/minikube/pkg/minikube/out/register	0.007s	coverage: 54.5% of statements
ok  	k8s.io/minikube/pkg/minikube/perf	4.205s	coverage: 33.8% of statements
ok  	k8s.io/minikube/pkg/minikube/problem	0.013s	coverage: 92.7% of statements
ok  	k8s.io/minikube/pkg/minikube/proxy	0.010s	coverage: 77.0% of statements
ok  	k8s.io/minikube/pkg/minikube/registry	0.009s	coverage: 75.5% of statements
ok  	k8s.io/minikube/pkg/minikube/service	0.074s	coverage: 84.2% of statements
ok  	k8s.io/minikube/pkg/minikube/shell	0.009s	coverage: 97.1% of statements
ok  	k8s.io/minikube/pkg/minikube/storageclass	0.026s	coverage: 100.0% of statements
ok  	k8s.io/minikube/pkg/minikube/sysinit	0.027s	coverage: 6.5% of statements
ok  	k8s.io/minikube/pkg/minikube/translate	0.005s	coverage: 10.5% of statements
ok  	k8s.io/minikube/pkg/minikube/tunnel	1.663s	coverage: 64.2% of statements
ok  	k8s.io/minikube/pkg/util	1.027s	coverage: 77.9% of statements
ok  	k8s.io/minikube/pkg/util/lock	0.005s	coverage: 18.2% of statements
ok  	k8s.io/minikube/pkg/util/retry	0.012s	coverage: 0.0% of statements
FAIL
Makefile:274: recipe for target 'test' failed
make: *** [test] Error 32
```

</details>


###### TravisBuddy Request Identifier: c2cb35d0-d46e-11ea-9b7b-6b7bbdba586d

TravisBuddy: ## Travis tests have failed

Hey @bluestealth,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.


### 1st Build

<a href="https:&#x2F;&#x2F;travis-ci.org&#x2F;kubernetes&#x2F;minikube&#x2F;jobs&#x2F;714146090">View build log</a>


<details>
  <summary>
    <strong>
     make test
    </strong>
  </summary>

```
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.14.6.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.3/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.14.6.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.3/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
MINIKUBE_LDFLAGS="-X k8s.io/minikube/pkg/version.version=v1.12.1 -X k8s.io/minikube/pkg/version.isoVersion=v1.12.0 -X k8s.io/minikube/pkg/version.isoPath=minikube/iso -X k8s.io/minikube/pkg/version.gitCommitID="060d63fa80aa33d763e10dd1824a38526b7a00f7"" ./test.sh
= make lint =============================================================
golangci/golangci-lint info checking GitHub for tag 'v1.29.0'
golangci/golangci-lint info found version: 1.29.0 for v1.29.0/linux/amd64
golangci/golangci-lint info installed out/linters/golangci-lint
pkg/drivers/common.go:20: File is not `goimports`-ed (goimports)
	"github.com/docker/go-units"
Makefile:390: recipe for target 'lint-ci' failed
make[1]: *** [lint-ci] Error 1
= go mod ================================================================
ok
= boilerplate ===========================================================
ok
Makefile:274: recipe for target 'test' failed
make: *** [test] Error 4
```

</details>


###### TravisBuddy Request Identifier: db432210-d47a-11ea-9b7b-6b7bbdba586d

afbjorklund: > It's a minor nitpick but I believe that the hard drive and memory assigned while using KVM and platforms using raw disks was meant to be MiB based on [this](https://github.com/kubernetes/minikube/blob/294a5c3e7b363a999bdb5f73ef6e1b2b8b275193/pkg/util/utils.go#L35-L48). This patch simply calculates disk size in MiB and assigns the correct unit in the domain configruation for libvirt.

This PR does a whole lot  more than just change the output from MB to MiB, though.

Including changing the memory allocation from 2000 and disk allocation from 20000

It would be easier to review, if you opened a issue first describing what you want to "fix"

I think the libvirt unit mismatch was something we inherited from upstream (kvm) actually:

https://github.com/dhiltgen/docker-machine-kvm/issues/54
medyagh: @bluestealth  please pull master on this
k8s-ci-robot: @bluestealth: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>

Patch:
diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go
index 26f0d8cf0..fbd863110 100644
--- a/cmd/minikube/cmd/start.go
+++ b/cmd/minikube/cmd/start.go
@@ -793,7 +793,7 @@ func memoryLimits(drvName string) (int, int, error) {
 		if err != nil {
 			return -1, -1, err
 		}
-		containerLimit = int(s.TotalMemory / 1024 / 1024)
+		containerLimit = util.ConvertBytesToMB(s.TotalMemory)
 	}
 
 	return sysLimit, containerLimit, nil
diff --git a/pkg/drivers/common.go b/pkg/drivers/common.go
index 2fde2efde..8c5c98bc7 100644
--- a/pkg/drivers/common.go
+++ b/pkg/drivers/common.go
@@ -29,6 +29,7 @@ import (
 	"github.com/docker/machine/libmachine/ssh"
 	"github.com/golang/glog"
 	"github.com/pkg/errors"
+	"k8s.io/minikube/pkg/util"
 )
 
 // This file is for common code shared among internal machine drivers
@@ -74,7 +75,7 @@ func createRawDiskImage(sshKeyPath, diskPath string, diskSizeMb int) error {
 		return errors.Wrapf(err, "closing file %s", diskPath)
 	}
 
-	if err := os.Truncate(diskPath, int64(diskSizeMb*1000000)); err != nil {
+	if err := os.Truncate(diskPath, util.ConvertMBToBytes(diskSizeMb)); err != nil {
 		return errors.Wrap(err, "truncate")
 	}
 	return nil
diff --git a/pkg/drivers/kvm/domain.go b/pkg/drivers/kvm/domain.go
index 2d8a18d5f..3a69cc0b9 100644
--- a/pkg/drivers/kvm/domain.go
+++ b/pkg/drivers/kvm/domain.go
@@ -31,8 +31,8 @@ import (
 
 const domainTmpl = `
 <domain type='kvm'>
-  <name>{{.MachineName}}</name> 
-  <memory unit='MB'>{{.Memory}}</memory>
+  <name>{{.MachineName}}</name>
+  <memory unit='MiB'>{{.Memory}}</memory>
   <vcpu>{{.CPU}}</vcpu>
   <features>
     <acpi/>
diff --git a/pkg/minikube/machine/info.go b/pkg/minikube/machine/info.go
index 99bf55982..4305a5a14 100644
--- a/pkg/minikube/machine/info.go
+++ b/pkg/minikube/machine/info.go
@@ -29,6 +29,7 @@ import (
 	"k8s.io/minikube/pkg/minikube/out"
 	"k8s.io/minikube/pkg/minikube/out/register"
 	"k8s.io/minikube/pkg/minikube/style"
+	"k8s.io/minikube/pkg/util"
 )
 
 // HostInfo holds information on the user's machine
@@ -38,10 +39,6 @@ type HostInfo struct {
 	DiskSize int64
 }
 
-func megs(bytes uint64) int64 {
-	return int64(bytes / 1024 / 1024)
-}
-
 // CachedHostInfo returns system information such as memory,CPU, DiskSize
 func CachedHostInfo() (*HostInfo, error, error, error) {
 	var cpuErr, memErr, diskErr error
@@ -61,8 +58,8 @@ func CachedHostInfo() (*HostInfo, error, error, error) {
 
 	var info HostInfo
 	info.CPUs = len(i)
-	info.Memory = megs(v.Total)
-	info.DiskSize = megs(d.Total)
+	info.Memory = util.ConvertUnsignedBytesToMB(v.Total)
+	info.DiskSize = util.ConvertUnsignedBytesToMB(d.Total)
 	return &info, cpuErr, memErr, diskErr
 }
 
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 6a5c3bf0f..518c1d796 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -24,7 +24,7 @@ import (
 	"strconv"
 
 	"github.com/blang/semver"
-	"github.com/docker/go-units"
+	units "github.com/docker/go-units"
 	"github.com/pkg/errors"
 )
 
@@ -47,6 +47,18 @@ func CalculateSizeInMB(humanReadableSize string) (int, error) {
 	return int(size / units.MiB), nil
 }
 
+func ConvertMBToBytes(mbSize int) int64 {
+	return int64(mbSize) * units.MiB
+}
+
+func ConvertBytesToMB(byteSize int64) int {
+	return int(ConvertUnsignedBytesToMB(uint64(byteSize)))
+}
+
+func ConvertUnsignedBytesToMB(byteSize uint64) int64 {
+	return int64(byteSize / units.MiB)
+}
+
 // GetBinaryDownloadURL returns a suitable URL for the platform
 func GetBinaryDownloadURL(version, platform string) string {
 	switch platform {


Test patch:
diff --git a/pkg/drivers/common_test.go b/pkg/drivers/common_test.go
index cc250e03d..14cc63108 100644
--- a/pkg/drivers/common_test.go
+++ b/pkg/drivers/common_test.go
@@ -36,7 +36,7 @@ func Test_createDiskImage(t *testing.T) {
 	diskPath := filepath.Join(tmpdir, "disk")
 
 	sizeInMb := 100
-	sizeInBytes := int64(sizeInMb) * 1000000
+	sizeInBytes := int64(104857600)
 	if err := createRawDiskImage(sshPath, diskPath, sizeInMb); err != nil {
 		t.Errorf("createDiskImage() error = %v", err)
 	}