Deploy instances failed on Hyper-V with Chinese locale

Bug #1229671 reported by HelenLiu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Alessandro Pilotti
Havana
Fix Released
High
Gary Kotton

Bug Description

I am deploying instances on my Hyper-V host but I met the below error. I remember in the past, vmops.py calls vhdutils.py but now it calls vhdutilsv2.py. Not sure if that is the correct place that caused this issue. Please help to check.

2013-09-24 18:46:47.079 2304 WARNING nova.network.neutronv2.api [-] [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] No network configured!
2013-09-24 18:46:47.734 2304 INFO nova.virt.hyperv.vmops [req-474eb715-9048-475f-9734-7b5fdc005a64 b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] Spawning new instance
2013-09-24 18:46:49.996 2304 ERROR nova.compute.manager [req-474eb715-9048-475f-9734-7b5fdc005a64 b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] Instance failed to spawn
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] Traceback (most recent call last):
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1431, in _spawn
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] block_device_info)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\driver.py", line 55, in spawn
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] admin_password, network_info, block_device_info)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 90, in wrapper
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] return function(self, *args, **kwds)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 208, in spawn
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] root_vhd_path = self._create_root_vhd(context, instance)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 177, in _create_root_vhd
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] self._pathutils.remove(root_vhd_path)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 161, in _create_root_vhd
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] base_vhd_info = self._vhdutils.get_vhd_info(base_vhd_path)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vhdutilsv2.py", line 124, in get_vhd_info
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] et = ElementTree.fromstring(vhd_info_xml)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1301, in XML
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] parser.feed(text)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1641, in feed
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] self._parser.Parse(data, 0)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] UnicodeEncodeError: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)
2013-09-24 18:46:49.996 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f]
2013-09-24 18:46:50.168 2304 AUDIT nova.compute.manager [req-474eb715-9048-475f-9734-7b5fdc005a64 b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] Terminating instance
2013-09-24 18:46:51.244 2304 INFO nova.virt.hyperv.vmops [req-474eb715-9048-475f-9734-7b5fdc005a64 b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] Got request to destroy instance: instance-00000001
2013-09-24 18:46:51.463 2304 ERROR nova.compute.manager [req-474eb715-9048-475f-9734-7b5fdc005a64 b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] Error: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] Traceback (most recent call last):
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1046, in _build_instance
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] set_access_ip=set_access_ip)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1445, in _spawn
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] LOG.exception(_('Instance failed to spawn'), instance=instance)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1431, in _spawn
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] block_device_info)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\driver.py", line 55, in spawn
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] admin_password, network_info, block_device_info)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 90, in wrapper
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] return function(self, *args, **kwds)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 208, in spawn
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] root_vhd_path = self._create_root_vhd(context, instance)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 177, in _create_root_vhd
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] self._pathutils.remove(root_vhd_path)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 161, in _create_root_vhd
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] base_vhd_info = self._vhdutils.get_vhd_info(base_vhd_path)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vhdutilsv2.py", line 124, in get_vhd_info
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] et = ElementTree.fromstring(vhd_info_xml)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1301, in XML
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] parser.feed(text)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1641, in feed
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] self._parser.Parse(data, 0)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f] UnicodeEncodeError: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)
2013-09-24 18:46:51.463 2304 TRACE nova.compute.manager [instance: 973ff9d0-fb57-4ca6-a3ba-7b08783bcb9f]
2013-09-24 18:47:19.918 2304 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
2013-09-24 18:47:22.243 2304 AUDIT nova.compute.resource_tracker [-] Free ram (MB): 134644
2013-09-24 18:47:22.243 2304 AUDIT nova.compute.resource_tracker [-] Free disk (GB): 277
2013-09-24 18:47:22.243 2304 AUDIT nova.compute.resource_tracker [-] Free VCPUS: 24
2013-09-24 18:47:22.321 2304 INFO nova.compute.resource_tracker [-] Compute_service record updated for radonHyperHost2:radonHyperHost2
2013-09-24 18:48:22.444 2304 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
2013-09-24 18:48:24.736 2304 AUDIT nova.compute.resource_tracker [-] Free ram (MB): 134644
2013-09-24 18:48:24.736 2304 AUDIT nova.compute.resource_tracker [-] Free disk (GB): 277
2013-09-24 18:48:24.736 2304 AUDIT nova.compute.resource_tracker [-] Free VCPUS: 24
2013-09-24 18:48:24.815 2304 INFO nova.compute.resource_tracker [-] Compute_service record updated for radonHyperHost2:radonHyperHost2
2013-09-24 18:49:15.016 2304 AUDIT nova.compute.manager [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Starting instance...
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Attempting claim: memory 512 MB, disk 1 GB, VCPUs 1
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Total Memory: 135156 MB, used: 512.00 MB
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Memory limit: 202734.00 MB, free: 202222.00 MB
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Total Disk: 277 GB, used: 0.00 GB
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Disk limit not specified, defaulting to unlimited
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Total CPU: 24 VCPUs, used: 0.00 VCPUs
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] CPU limit not specified, defaulting to unlimited
2013-09-24 18:49:15.516 2304 AUDIT nova.compute.claims [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Claim successful
2013-09-24 18:49:16.015 2304 WARNING nova.network.neutronv2.api [-] [instance: d5009261-d55a-47ea-bd59-971460905cb3] No network configured!
2013-09-24 18:49:16.483 2304 INFO nova.virt.hyperv.vmops [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Spawning new instance
2013-09-24 18:49:16.608 2304 ERROR nova.compute.manager [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Instance failed to spawn
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] Traceback (most recent call last):
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1431, in _spawn
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] block_device_info)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\driver.py", line 55, in spawn
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] admin_password, network_info, block_device_info)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 90, in wrapper
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] return function(self, *args, **kwds)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 208, in spawn
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] root_vhd_path = self._create_root_vhd(context, instance)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 177, in _create_root_vhd
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] self._pathutils.remove(root_vhd_path)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 161, in _create_root_vhd
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] base_vhd_info = self._vhdutils.get_vhd_info(base_vhd_path)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vhdutilsv2.py", line 124, in get_vhd_info
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] et = ElementTree.fromstring(vhd_info_xml)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1301, in XML
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] parser.feed(text)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1641, in feed
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] self._parser.Parse(data, 0)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] UnicodeEncodeError: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)
2013-09-24 18:49:16.608 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3]
2013-09-24 18:49:17.122 2304 AUDIT nova.compute.manager [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Terminating instance
2013-09-24 18:49:18.042 2304 INFO nova.virt.hyperv.vmops [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] Got request to destroy instance: instance-00000002
2013-09-24 18:49:18.276 2304 ERROR nova.compute.manager [req-ef98f776-c545-4b80-9397-84ba9e2166cb b13861ca49f641d7a818e6b8335f2351 29db386367fa4c4e9ffb3c369a46ee90] [instance: d5009261-d55a-47ea-bd59-971460905cb3] Error: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] Traceback (most recent call last):
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1046, in _build_instance
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] set_access_ip=set_access_ip)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1445, in _spawn
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] LOG.exception(_('Instance failed to spawn'), instance=instance)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 1431, in _spawn
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] block_device_info)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\driver.py", line 55, in spawn
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] admin_password, network_info, block_device_info)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 90, in wrapper
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] return function(self, *args, **kwds)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 208, in spawn
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] root_vhd_path = self._create_root_vhd(context, instance)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 177, in _create_root_vhd
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] self._pathutils.remove(root_vhd_path)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vmops.py", line 161, in _create_root_vhd
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] base_vhd_info = self._vhdutils.get_vhd_info(base_vhd_path)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\vhdutilsv2.py", line 124, in get_vhd_info
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] et = ElementTree.fromstring(vhd_info_xml)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1301, in XML
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] parser.feed(text)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\xml\etree\ElementTree.py", line 1641, in feed
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] self._parser.Parse(data, 0)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3] UnicodeEncodeError: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)
2013-09-24 18:49:18.276 2304 TRACE nova.compute.manager [instance: d5009261-d55a-47ea-bd59-971460905cb3]
2013-09-24 18:49:24.923 2304 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
2013-09-24 18:49:27.246 2304 AUDIT nova.compute.resource_tracker [-] Free ram (MB): 134132
2013-09-24 18:49:27.246 2304 AUDIT nova.compute.resource_tracker [-] Free disk (GB): 276
2013-09-24 18:49:27.246 2304 AUDIT nova.compute.resource_tracker [-] Free VCPUS: 23
2013-09-24 18:49:27.355 2304 INFO nova.compute.resource_tracker [-] Compute_service record updated for radonHyperHost2:radonHyperHost2
2013-09-24 18:49:52.815 2304 AUDIT nova.compute.resource_tracker [-] Auditing locally available compute resources
2013-09-24 18:49:55.140 2304 AUDIT nova.compute.resource_tracker [-] Free ram (MB): 134132
2013-09-24 18:49:55.140 2304 AUDIT nova.compute.resource_tracker [-] Free disk (GB): 276
2013-09-24 18:49:55.140 2304 AUDIT nova.compute.resource_tracker [-] Free VCPUS: 23
2013-09-24 18:49:55.217 2304 INFO nova.compute.resource_tracker [-] Compute_service record updated for radonHyperHost2:radonHyperHost2

Tags: hyper-v
GuoHui Liu (guohliu)
tags: added: hyper-v
Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

Interesting, we had no issues so far but we're definitely going to investigate it.

Are you deploying a VHD or VHDX image? Dynamic or Fixed?
Can you provide the output of Get-VHD for the image?

What happens if you use the force_hyperv_utils_v1?
https://github.com/openstack/nova/blob/master/nova/virt/hyperv/utilsfactory.py#L34

As a correlated note: we are going to deploy a fix for VHDX similar to the VHD one you committed. It's a bit more complicated due to the VHDX format, so we preferred not to block your commit which was needed for backporting as well.

Revision history for this message
HelenLiu (isisliu) wrote :

hi, this is Xiao Pei. I tried using fixed or dynamic VHD format images, both have this issue.
If I changed force_hyperv_utils_v1=true in nova.conf and restart nova-compute service, then it can deploy instances successfully.

Revision history for this message
HelenLiu (isisliu) wrote :

more added: GET-VHD info
PS C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\instances\_base> get-vhd .\f50bc876-355b-4584-9ef8-0a61d98d
c143.vhd

ComputerName : RADONHYPERHOST2
Path : C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V
                          Agent\instances\_base\f50bc876-355b-4584-9ef8-0a61d98dc143.vhd
VhdFormat : VHD
VhdType : Dynamic
FileSize : 24576
Size : 8589934592
MinimumSize :
LogicalSectorSize : 512
PhysicalSectorSize : 512
BlockSize : 2097152
ParentPath :
FragmentationPercentage : 0
Alignment : 1
Attached : False
DiskNumber :
IsDeleted : False
Number :

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

Ok, let's narrow this down.

Can you please start a Python interpreter on the compute node, run the following code and paste the output here (or in a paste bin if it's too big)?

Note: please change the vhd_path variable as appropriate.

vhd_path="C:\\Program Files (x86)\\IBM\\SmartCloud Entry\\Hyper-V Agent\\instances\\_base\\f50bc876-355b-4584-9ef8-0a61d98dc143.vhd"

from nova.virt.hyperv import vhdutilsv2
u = vhdutilsv2.VHDUtilsV2()
u.get_vhd_info(vhd_path)

Thanks

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

As an addendum, here's what I get by running it on a test dynamic disk:

{'PhysicalSectorSize': 512L, 'LogicalSectorSize': 512L, 'Format': 2, 'BlockSize': 2097152L, 'ParentPath': None, 'Path':'c:\\temp\\test.vhd', 'Type': 3, 'MaxInternalSize': 10485760L}

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

The issue has been narrowed down to a localization issue. ElementTree is not able to parse the Unicode XML produced by WMI.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48267

Changed in nova:
assignee: nobody → Alessandro Pilotti (alexpilotti)
status: New → In Progress
Revision history for this message
HelenLiu (isisliu) wrote : Re: Deploy instances failed on Hyper-V

Apply the patch in my environment and it works! Thank you very much for your quick response Alessandro.

tags: added: havana-rc-potential
summary: - Deploy instances failed on Hyper-V
+ Deploy instances failed on Hyper-V with Chinese locale
Changed in nova:
importance: Undecided → High
Thierry Carrez (ttx)
tags: added: havana-backprot-potential
removed: havana-rc-potential
tags: added: havana-backport-potential
removed: havana-backprot-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :

Helen Liu / GuoHui Liu - would it be possible to test the patch but with this line:

return vhd_info_xml.encode('utf8', 'replace')

Replaced with this?

return vhd_info_xml.encode('utf8', 'xmlcharrefreplace')

Does it still fix the bug?

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

Matt,

I set up a Hyper-V VM with Chinese locale (zh-CN) and reproduced the issue.

Here's the python code I used for the testing. Any VHD will do.

http://paste.openstack.org/show/47498/

The interesting thing is that:

with open("c:\\dump.xml", "wb") as f:
    f.write(x)

Fails with:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 174-181: ordinal not in range(128)

type(x) is "unicode", so it really looks like a CPython bug to me, but this requires IMO investigations which go way beyond this bug fix.

I checked also the output of both

x.encode('utf8', 'repalce')

And

x.encode('utf8', 'xmlcharrefreplace')

both work and produce the same string.

Revision history for this message
Xiaopei Liu (liuxpei) wrote :

yes, also verified on my machine with chinese local,

 return vhd_info_xml.encode('utf8', 'replace') or return vhd_info_xml.encode('utf8', 'xmlcharrefreplace') both can resolve the issue.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/48267
Committed: http://github.com/openstack/nova/commit/c8c7c01d68b34b76ebe6c4b39f93915480c1ccea
Submitter: Jenkins
Branch: master

commit c8c7c01d68b34b76ebe6c4b39f93915480c1ccea
Author: Alessandro Pilotti <email address hidden>
Date: Wed Sep 25 17:28:53 2013 +0300

    Fixes unicode issue in the Hyper-V driver

    The XML string returned by the WMI API calls requires unicode
    conversion before further processing, e.g. with ElementTree.

    This affects the vhdutilsv2._get_vhd_info_xml method due to
    the textual description. The issue came to light using the
    host with Chinese locale, while not present on a en_US host.

    Fixes bug: #1229671

    Change-Id: I09435a205abfc8ae9470c53c5446cbb28dee0115

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/53603

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/53603
Committed: http://github.com/openstack/nova/commit/88cfe5a0ae682794f8ce25b787084115925023f2
Submitter: Jenkins
Branch: stable/havana

commit 88cfe5a0ae682794f8ce25b787084115925023f2
Author: Alessandro Pilotti <email address hidden>
Date: Wed Sep 25 17:28:53 2013 +0300

    Fixes unicode issue in the Hyper-V driver

    The XML string returned by the WMI API calls requires unicode
    conversion before further processing, e.g. with ElementTree.

    This affects the vhdutilsv2._get_vhd_info_xml method due to
    the textual description. The issue came to light using the
    host with Chinese locale, while not present on a en_US host.

    Fixes bug: #1229671

    Change-Id: I09435a205abfc8ae9470c53c5446cbb28dee0115
    (cherry picked from commit c8c7c01d68b34b76ebe6c4b39f93915480c1ccea)

tags: added: in-stable-havana
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Alan Pevec (apevec)
tags: removed: havana-backport-potential in-stable-havana
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.