Nova VMwareapi Fails Image Download
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Unassigned |
Bug Description
Description
===========
When trying to start an instance with a local root disk, the VM fails with InvalidArgument.
Steps to reproduce
==================
A chronological list of steps which will bring off the
issue you noticed:
* Setup Devstack
* Create Server with boot from volume:
source devstack/openrc admin demo
openstack server create --flavor 1 --boot-from-volume 10 --image-property vmware_
* Create Server with root disk
openstack server create --flavor 1 --image-property vmware_
Expected result
===============
Both instances come up.
Actual result
=============
The first one comes up.
The second one fails with the error
> Instance failed to spawn: oslo_vmware.
Further inspection yield, that the file is empty.
The connection has been closed by the nova-compute prematurely on glance side
> Unhandled error: OSError: write error
as well on the vsphere side.
Environment
===========
1. Exact version of OpenStack you are running.
Tested it with nova master (i.e. 35af4b345d997b6
2. Which hypervisor did you use? What's the version of that?
vmwareapi (VSphere 7.0.3 & ESXi 7.0.3)
2. Which storage type did you use?
vmdk on NFS 4.0
3. Which networking type did you use?
networking-nsx-t (https:/
Logs & Configs
==============
Logs for running on master:
http://
Additional Information
========
As the argument is an IterableWithLength (https:/
we can print debug log message in the ImageReadHandle (https:/
When logging the read bytes and the and the file size, the length of the iterator matches the file-size stored in glance, while the `StopIteration` is raised right on the first call here:
https:/
Interestingly, the same code is used in cinder (the working case), and there the iterator is not raising a `StopIteration` before reaching the end of the file.
So, possibly that is a red herring.
The main difference is how Cinder and Nova handle the upload side.
Nova uses a PUT on an individual ESXi host, while Cinder uses a POST operation to the VSphere API.
this is the relevent backtrace
[ 781.229500] env[61868]: Faults: ['InvalidArgument'] manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] Traceback (most recent call last): manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ compute/ manager. py", line 2885, in _build_resources manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] yield resources manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ compute/ manager. py", line 2632, in _build_ and_run_ instance manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] self.driver. spawn(context, instance, image_meta, manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ virt/vmwareapi/ driver. py", line 539, in spawn manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] self._vmops. spawn(context, instance, image_meta, injected_files, manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ virt/vmwareapi/ vmops.py" , line 786, in spawn manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] self._fetch_ image_if_ missing( context, vi) manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ virt/vmwareapi/ vmops.py" , line 639, in _fetch_ image_if_ missing manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] image_cache(vi, tmp_image_ds_loc) manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ virt/vmwareapi/ vmops.py" , line 537, in _cache_sparse_image manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] vm_util. copy_virtual_ disk( manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ virt/vmwareapi/ vm_util. py", line 1423, in copy_virtual_disk manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] session. _wait_for_ task(vmdk_ copy_task) manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ nova/nova/ virt/vmwareapi/ session. py", line 157, in _wait_for_task manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] return self.wait_ for_task( task_ref) manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] File "/opt/stack/ data/venv/ lib/python3. 10/site- packages/ oslo_vmware/ api.py" , line 398, in wait_for_task manager [instance: b9c8dd4c- 8a19-4ffb- 8e57-b273c000f1 21] ...
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229500] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.
[ 781.229904] env[61868]: ERROR nova.compute.