unable to delete VM due to XML error

Description

When trying to delete a VM I get an XML error, looks like there is a leading space in front of the mac address. As a result, I am unable to delete the VM. Error message output below.

libvertError

XML error: unable to parse mac address ' 00:a0:98:60:6a:fd'

Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 137, in call_method
result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self,
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1191, in _call
return await methodobj(*prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/service.py", line 471, in delete
rv = await self.middleware._call(
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1191, in _call
return await methodobj(*prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 973, in nf
return await f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 1472, in do_delete
await self.middleware.call('vm.undefine_vm', vm)
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1233, in call
return await self._call(
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1202, in _call
return await self.run_in_executor(prepared_call.executor, methodobj, *prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1106, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
File "/usr/local/lib/python3.8/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 1489, in undefine_vm
VMSupervisor(vm, self.libvirt_connection, self.middleware).undefine_domain()
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 99, in _init_
self.update_domain()
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 118, in update_domain
self.__define_domain()
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/vm.py", line 133, in __define_domain
if not self.connection.defineXML(vm_xml):
File "/usr/local/lib/python3.8/site-packages/libvirt.py", line 4048, in defineXML
if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirt.libvirtError: XML error: unable to parse mac address ' 00:a0:98:60:6a:fd'

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Bug Clerk 
November 23, 2020 at 5:51 PM

Bug Clerk 
November 23, 2020 at 1:24 PM

Former user 
November 20, 2020 at 8:55 PM
(edited)

I should note that after submitting this I was able to working around the error by going into the VM's devices and editing the NIC device's MAC address to remove the leading space, which allowed me to delete the VM.

For completeness, unfortunately I run into another error with save debug, and have attached the output errors. Perhaps I should open another bug for this, but it looks similar to https://ixsystems.atlassian.net/browse/NAS-105679#icft=NAS-105679 (https://jira.ixsystems.com/browse/NAS-105679). Looks like it fails at 90%

Here is the output of that command

root@freenas[~]# midclt call datastore.query vm.device.query | jq .
'vm_device_query'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 137, in call_method
result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self,
File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1191, in _call
return await methodobj(*prepared_call.args)
File "/usr/local/lib/python3.8/site-packages/middlewared/schema.py", line 973, in nf
return await f(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/datastore/read.py", line 78, in query
table = self._get_table(name)
File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/datastore/schema.py", line 8, in _get_table
return Model.metadata.tables[name.replace('.', '_').lower()]
KeyError: 'vm_device_query'

Waqar 
November 20, 2020 at 9:06 AM

can you please share a debug of the system ( System -> Advanced ) and the output of the following command ?

midclt call datastore.query vm.device.query | jq .
Complete

Details

Assignee

Reporter

Labels

Impact

Components

Affects versions

Priority

More fields

Katalon Platform

Created November 20, 2020 at 4:21 AM
Updated July 1, 2022 at 2:53 PM
Resolved November 23, 2020 at 5:51 PM