You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libvirt: can't create workers with non-default storage path #308
On the other end, the /var/lib/... path is the actuator default for baseVolumePath, but I'm not clear on whether baseVolumePath plays into our chain.
From your logged:
I0921 18:24:47.612648 1 logs.go:41] [DEBUG] Create a libvirt volume with name worker-b9f4v for pool default from the base volume /var/lib/libvirt/images/coreos_base
we see that by the time we got here, we had default as the poolName (correct) and /var/lib/libvirt/images/coreos_base as the baseVolumeID (questionable). Then we lookup the pool. And then we die trying to find the volume in that pool. We should be looking up the volume by coreos_base; e.g. with virsh:
So can we connect the dots between our config and the busted baseVolumeID? The actuator is getting the value from machine-provider config. Who writes that config? Maybe the machine-API operator using this template? A short-term patch is probably updating that template to use just coreos_base. A long-term fix is probably updating something (that same template?) to use a value pulled (possibly indirectly) from the cluster config the installer is pushing.
Then, my worker node image and its ignition file are placed in the storage path.
# ls /home/VMpool
ntest0-base ntest0-master-0 ntest0-master.ign ntest0-worker-0-4vlw2 ntest0-worker-0-4vlw2.ignition
But the worker node failed to start with this error: W0113 17:45:53.363756 1 controller.go:183] unable to create machine ntest0-worker-0-4vlw2: ntest0/ntest0-worker-0-4vlw2: error creating libvirt machine: error creating domain Failed to setDisks: Can't retrieve volume /var/lib/libvirt/images/ntest0-worker-0-4vlw2
Obviously, it expects to see the worker node image ntest0-worker-0-4vlw2 in /var/lib/libvirt/images instead of my storage path /home/VMpool... But I cannot find the place /var/lib/libvirt/images is hardcoded or expected as a default path in the installer. Do you have any idea how I can workaround this issue?
Activity
wking commentedon Sep 23, 2018
I hit this too, and am trying to track down where the
/var/lib/libvirt/imagesis coming from. On my host:In the installer, we have settings for the pool and volume, which we currently hard-code to
defaultandcoreos_base. We set the volume, so hard-coding that shouldn't be a problem. We don't setpoolwhen we create the volume, so we get the Terraform provider'sdefaultdefault. So far, so good. We push those values into the cluster since #205 for the machine-config-operator to pick up (openshift/machine-config-operator#47). OurImagePoolandImageVolumesettings are recent (#271), but the MCO doesn't seem to be looking at either the oldQCOWImagePathor the newImage*properties (at least as of openshift/machine-config-operator@d948fb8baa63a).Then the chain of custody gets fuzzy for me.
On the other end, the
/var/lib/...path is the actuator default forbaseVolumePath, but I'm not clear on whetherbaseVolumePathplays into our chain.From your logged:
we see that by the time we got here, we had
defaultas thepoolName(correct) and/var/lib/libvirt/images/coreos_baseas thebaseVolumeID(questionable). Then we lookup the pool. And then we die trying to find the volume in that pool. We should be looking up the volume bycoreos_base; e.g. withvirsh:The issue is probably the fact that that lookup also works when you happen to use the correct full path:
So can we connect the dots between our config and the busted
baseVolumeID? The actuator is getting the value from machine-provider config. Who writes that config? Maybe the machine-API operator using this template? A short-term patch is probably updating that template to use justcoreos_base. A long-term fix is probably updating something (that same template?) to use a value pulled (possibly indirectly) from the cluster config the installer is pushing.wking commentedon Sep 23, 2018
Possible fix in openshift/machine-api-operator#70.
nhosoi commentedon Jan 14, 2019
I ran into the similar issue with v0.9.1.
For an experiment, I replaced the following hardcoded path "/var/lib/libvirt/images" with my storage path (/home/VMpool).
https://github.com/openshift/installer/blob/master/pkg/asset/machines/libvirt/machines.go#L74
Then, my worker node image and its ignition file are placed in the storage path.
But the worker node failed to start with this error:
W0113 17:45:53.363756 1 controller.go:183] unable to create machine ntest0-worker-0-4vlw2: ntest0/ntest0-worker-0-4vlw2: error creating libvirt machine: error creating domain Failed to setDisks: Can't retrieve volume /var/lib/libvirt/images/ntest0-worker-0-4vlw2Obviously, it expects to see the worker node image ntest0-worker-0-4vlw2 in /var/lib/libvirt/images instead of my storage path /home/VMpool... But I cannot find the place /var/lib/libvirt/images is hardcoded or expected as a default path in the installer. Do you have any idea how I can workaround this issue?
Thanks!
wking commentedon Jan 14, 2019
openshift/cluster-api-provider-libvirt#45 (the successor to openshift/machine-api-operator#70 linked above).
nhosoi commentedon Jan 14, 2019
Thank you, @wking.
I hope openshift/cluster-api-provider-libvirt#45 is going to be merged and cluster-api-provider-libvirt will be rebuilt soon...
steven-ellis commentedon Apr 15, 2019
This is still an outstanding issue. I'm using #1371 to bootstrap on libvirt and just hit this storage issue,
markmc commentedon Apr 15, 2019
Looks like this is the issue: https://github.com/openshift/installer/blob/master/pkg/asset/machines/libvirt/machines.go#L71
i.e. when the installer generating the provider spec for machines, it guesses what the volume ID generated by libvirt for the base image will be
The base image is created here https://github.com/openshift/installer/blob/master/data/data/libvirt/main.tf#L5
and the volume id is referenced as
${module.volume.coreos_base_volume_id}Probably the easiest solution is to allow configuring the volume in the provider spec with a name rather than volume id
i.e. right now we require:
but there's no reason to require the volume key if we just have the pool and the volume name. This should be sufficient:
Of course, the actuator needs a patch to do
virStorageVolLookupByName()in this case rather than thevirStorageVolLookupByKey()it does nowzeenix commentedon Apr 15, 2019
Correct. This was done in openshift/cluster-api-provider-libvirt#45 which I've finally rebased and reworked a bit. I'm going to test it today and create a new PR.
steven-ellis commentedon May 21, 2019
Looks like the fix is now in openshift/cluster-api-provider-libvirt#144
I'm re-testing on my local environment off master.
zeenix commentedon May 21, 2019
@steven-ellis the libvirt actuator bit, yes but the Installer part is still not merged due to CI being flaky: #1628