← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1730756] Re: Creating a VM with a non-ASCII name fails with an Unicode error in libvirt guest create()

 

Reviewed:  https://review.openstack.org/522161
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=784c0ecdc37e7a2ac5e9b5ad9de4f5d88190a7dc
Submitter: Zuul
Branch:    master

commit 784c0ecdc37e7a2ac5e9b5ad9de4f5d88190a7dc
Author: JiangPF <jiangpf1992@xxxxxxxxxxx>
Date:   Wed Jan 31 18:36:33 2018 +0800

    Encode libvirt domain XML in UTF-8
    
    Creating a VM with a non-ASCII name results in an error. Resolve
    this by encoding the libvirt domain XML in utf-8.
    
    Co-Authored-By: Yikun Jiang <yikunkero@xxxxxxxxx>
    
    Closes-Bug: #1730756
    Change-Id: I7afce618deca3baaa96605a6b48c1c2ef4a5f2a5


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1730756

Title:
  Creating a VM with a non-ASCII name fails with an Unicode error in
  libvirt guest create()

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Creating a VM with a non-ASCII name in nova with the libvirt driver
  fails with an UnicodeEncodeError error.

  Instance failed to spawn: UnicodeEncodeError: 'ascii' codec can't encode character u'\u266b' in position 294: ord
  Traceback (most recent call last):
    File "/opt/stack/nova/nova/compute/manager.py", line 2208, in _build_resources
      yield resources
    File "/opt/stack/nova/nova/compute/manager.py", line 2001, in _build_and_run_instance
      block_device_info=block_device_info)
    File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2821, in spawn
      destroy_disks_on_failure=True)
    File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5289, in _create_domain_and_network
      destroy_disks_on_failure)
    File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
      self.force_reraise()
    File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
      six.reraise(self.type_, self.value, self.tb)
    File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5259, in _create_domain_and_network
      post_xml_callback=post_xml_callback)
    File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 5170, in _create_domain
      guest = libvirt_guest.Guest.create(xml, self._host)
    File "/opt/stack/nova/nova/virt/libvirt/guest.py", line 129, in create
      encodeutils.safe_decode(xml))
    File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
      self.force_reraise()
    File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
      six.reraise(self.type_, self.value, self.tb)
    File "/opt/stack/nova/nova/virt/libvirt/guest.py", line 125, in create
      guest = host.write_instance_config(xml)
    File "/opt/stack/nova/nova/virt/libvirt/host.py", line 826, in write_instance_config
      domain = self.get_connection().defineXML(xml)
    File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 186, in doit
      result = proxy_call(self._autowrap, f, *args, **kwargs)
    File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 144, in proxy_call
      rv = execute(f, *args, **kwargs)
    File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 125, in execute
      six.reraise(c, e, tb)
    File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 83, in tworker
      rv = meth(*args, **kwargs)
    File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3817, in defineXML
      ret = libvirtmod.virDomainDefineXML(self._o, xml)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\u266b' in position 294: ordinal not in range(128)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1730756/+subscriptions


References