kinvolk/kube-spawn

stat /var/lib/machines.raw: no such file or directory

Closed this issue · 4 comments

❯  sudo GOPATH=$GOPATH CNI_PATH=$GOPATH/bin ./kube-spawn up --image=coreos --nodes=3 --debug

/go/src/github.com/kinvolk/kube-spawn/cmd/kube-spawn/setup.go:119: Checking base image
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/node.go:546: making iptables FORWARD chain defaults to ACCEPT...
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/kubernetes.go:68: /var/lib/kube-spawn/k8s/kubelet already downloaded, skipping...
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/kubernetes.go:68: /var/lib/kube-spawn/k8s/kubeadm already downloaded, skipping...
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/kubernetes.go:68: /var/lib/kube-spawn/k8s/kubectl already downloaded, skipping...
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/kubernetes.go:68: /var/lib/kube-spawn/k8s/kubelet.service already downloaded, skipping...
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/kubernetes.go:68: /var/lib/kube-spawn/k8s/10-kubeadm.conf already downloaded, skipping...
/go/src/github.com/kinvolk/kube-spawn/pkg/bootstrap/kubernetes.go:94: /var/lib/kube-spawn/extras/socat already downloaded, skipping...
/go/src/github.com/kinvolk/kube-spawn/cmd/kube-spawn/setup.go:165: cannot get pool size: stat /var/lib/machines.raw: no such file or directory

note that /var/lib/machines/coreos.raw does exist, but for some reason something is going wrong in Go and the string constructed is /var/lib/machines.raw

Thanks for the bug report.

However, the code was meant to be actually checking for /var/lib/machines.raw, which is automatically created by systemd-machined. (See also https://www.freedesktop.org/software/systemd/man/machinectl.html) In most cases the pool image file machines.raw exists, but does not in some other cases. So what we should do is to make kube-spawn resize the storage pool, only if the machines.raw actually exists. I will do that.

Note that we are right now heavily working on a new version v0.2 of kube-spawn, #161, so after it got merged, the up command won't be there. Instead you would need to run create && start commands. So I'm going to create a PR for fixing the storage pool issue, after the v0.2 PR got merged.

Aha. Do note that machines.raw only exists on non-btrfs setups. My machine runs btrfs so /var/lib/machines is just another sub-volume.

Edit: If I read your commit message, that's exactly what you're implying as well. nevermind.

Thanks for the fix.

@arianvp Exactly.
/var/lib/machines.raw is created only when the host filesystem is non-btrfs. I have different setups for both btrfs and non-btrfs by myself. In case of the btrfs setup, machines.raw is not created, so there's no need to care much about it. However, in fact, the number of non-btrfs users is much greater than that of btrfs users. So we should care about both cases.