Il giorno ven 18 gen 2019 alle ore 13:51 Gianluca Cecchi <
gianluca.cecchi(a)gmail.com> ha scritto:
Hello,
I verified that in 4.3 rc2 I can now export as ova a running VM:
I have a CentOS Atomic 7 VM and when I export as ova, a snapshot is
executed and then the ova file seems directly generated, bypassing the
previous copy on storage domain:
[root@hcinode1 ]# ll /export/
total 1141632
-rw-------. 1 root root 1401305088 Jan 18 11:10 c7atomic1.ova.tmp
[root@hcinode1 ]# ll /export/
total 1356700
-rw-------. 1 root root 1401305088 Jan 18 11:10 c7atomic1.ova
[root@hcinode1 ]#
And at the end the snaphsot has been correctly removed.
events:
Vm c7atomic1 was exported successfully as a Virtual Appliance to path
/export/c7atomic1.ova on Host hcinode1 1/18/19 11:10:23 AM
Starting to export Vm c7atomic1 as a Virtual Appliance 1/18/19 11:08:47 AM
Now if I try for test to import this generated OVA to the same environment
with this script:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload...
I get a duplicate error, see below. Is it a limitation of the python
script or what?
I think the script is missing to generate a different name / uuid for the
ova being imported.
If I go from the gui and I chose "Virtual Appliance (OVA)" as source and
the same host and file path I can successfully import the OVA, provided I
change the name of the VM to be imported.
Thanks,
Gianluca
[root@hcinode1 ~]# ./upload_ova_as_vm.py /export/c7atomic1.ova Default
vmstore
Connecting...
Creating disk...
{'capacityAllocationUnits': 'byte * 2^30', 'capacity':
'10',
'description': 'Auto-generated for Export To OVA',
'pass-discard': 'false',
'format': 'http://www.gnome.org/~markmc/qcow-image-format.html',
'volume-type': 'Sparse', 'boot': 'true',
'disk-alias':
'GlanceDisk-5f429e6', 'disk-interface': 'VirtIO',
'volume-format': 'COW',
'cinder_volume_type': '', 'disk-description': 'CentOS 7
Atomic Host Image
v1802 for x86_64 (5f429e6)', 'parentRef': '', 'fileRef':
'c6b2e076-1519-433e-9b37-2005c9ce6d2e', 'populatedSize':
'1401290752',
'disk_storage_type': 'IMAGE', 'diskId':
'e4f92226-0f56-4822-a622-d1ebff41df9f', 'wipe-after-delete':
'false'}
Traceback (most recent call last):
File "./upload_ova_as_vm.py", line 133, in <module>
name=target_storage_domain_name
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line
6794, in add
return self._internal_add(disk, headers, query, wait)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line
232, in _internal_add
return future.wait() if wait else future
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 55,
in wait
return self._code(response)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line
229, in callback
self._check_fault(response)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line
132, in _check_fault
self._raise_error(response, body)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line
118, in _raise_error
raise error
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is
"[Internal Engine Error]". HTTP response code is 400.
[root@hcinode1 ~]#
On engine:
2019-01-18 11:24:46,561+01 INFO
[org.ovirt.engine.core.bll.tasks.SPMAsyncTask] (default task-26)
[3b08d759-27d3-42f3-9eee-95c135e88a7b] BaseAsyncTask::startPollingTask:
Starting to poll task '81fbeac3-2c58-4f8a-a3da-44bdbe585beb'.
2019-01-18 11:24:46,691+01 ERROR
[org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (default task-26)
[3b08d759-27d3-42f3-9eee-95c135e88a7b] Command
'org.ovirt.engine.core.bll.storage.disk.AddDiskCommand' failed:
CallableStatementCallback; SQL [{call insertpermission(?, ?, ?, ?,
?)}ERROR: duplicate key value violates unique constraint
"idx_combined_ad_role_object"
Detail: Key (ad_element_id, role_id,
object_id)=(9d37881c-1991-11e9-b002-00163e7cb696,
def0000a-0000-0000-0000-def00000000b, e4f92226-0f56-4822-a622-d1ebff41df9f)
already exists.
Where: SQL statement "INSERT INTO permissions (
ad_element_id,
id,
role_id,
object_id,
object_type_id
)
VALUES (
v_ad_element_id,
v_id,
v_role_id,
v_object_id,
v_object_type_id
)"
PL/pgSQL function insertpermission(uuid,uuid,uuid,uuid,integer) line 3 at
SQL statement; nested exception is org.postgresql.util.PSQLException:
ERROR: duplicate key value violates unique constraint
"idx_combined_ad_role_object"
Detail: Key (ad_element_id, role_id,
object_id)=(9d37881c-1991-11e9-b002-00163e7cb696,
def0000a-0000-0000-0000-def00000000b, e4f92226-0f56-4822-a622-d1ebff41df9f)
already exists.
Where: SQL statement "INSERT INTO permissions (
ad_element_id,
id,
role_id,
object_id,
object_type_id
)
VALUES (
v_ad_element_id,
v_id,
v_role_id,
v_object_id,
v_object_type_id
)"
PL/pgSQL function insertpermission(uuid,uuid,uuid,uuid,integer) line 3 at
SQL statement
2019-01-18 11:24:46,691+01 ERROR
[org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (default task-26)
[3b08d759-27d3-42f3-9eee-95c135e88a7b] Exception:
org.springframework.dao.DuplicateKeyException: CallableStatementCallback;
SQL [{call insertpermission(?, ?, ?, ?, ?)}ERROR: duplicate key value
violates unique constraint "idx_combined_ad_role_object"
Detail: Key (ad_element_id, role_id,
object_id)=(9d37881c-1991-11e9-b002-00163e7cb696,
def0000a-0000-0000-0000-def00000000b, e4f92226-0f56-4822-a622-d1ebff41df9f)
already exists.
Where: SQL statement "INSERT INTO permissions (
ad_element_id,
id,
role_id,
object_id,
object_type_id
)
VALUES (
v_ad_element_id,
v_id,
v_role_id,
v_object_id,
v_object_type_id
)"
PL/pgSQL function insertpermission(uuid,uuid,uuid,uuid,integer) line 3 at
SQL statement; nested exception is org.postgresql.util.PSQLException:
ERROR: duplicate key value violates unique constraint
"idx_combined_ad_role_object"
Detail: Key (ad_element_id, role_id,
object_id)=(9d37881c-1991-11e9-b002-00163e7cb696,
def0000a-0000-0000-0000-def00000000b, e4f92226-0f56-4822-a622-d1ebff41df9f)
already exists.
Where: SQL statement "INSERT INTO permissions (
ad_element_id,
id,
role_id,
object_id,
object_type_id
)
VALUES (
v_ad_element_id,
v_id,
v_role_id,
v_object_id,
v_object_type_id
)"
PL/pgSQL function insertpermission(uuid,uuid,uuid,uuid,integer) line 3 at
SQL statement
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:243)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1402)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1065)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1104)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:414)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:374)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:198)
[spring-jdbc.jar:5.0.4.RELEASE]
at
org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:135)
[dal.jar:]
at
org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeImpl(SimpleJdbcCallsHandler.java:130)
[dal.jar:]
at
org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.executeModification(SimpleJdbcCallsHandler.java:76)
[dal.jar:]
at
org.ovirt.engine.core.dao.PermissionDaoImpl.save(PermissionDaoImpl.java:256)
[dal.jar:]
at
org.ovirt.engine.core.dao.PermissionDaoImpl.save(PermissionDaoImpl.java:22)
[dal.jar:]
at
org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission(MultiLevelAdministrationHandler.java:67)
[bll.jar:]
at
org.ovirt.engine.core.bll.storage.disk.AddDiskCommand.addDiskPermissions(AddDiskCommand.java:628)
[bll.jar:]
at
org.ovirt.engine.core.bll.storage.disk.AddDiskCommand.createDiskBasedOnImage(AddDiskCommand.java:558)
[bll.jar:]
at
org.ovirt.engine.core.bll.storage.disk.AddDiskCommand.executeVmCommand(AddDiskCommand.java:429)
[bll.jar:]
at
org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:158)
[bll.jar:]
at
org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1147)
[bll.jar:]
at
org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1305)
[bll.jar:]
at
org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1954)
[bll.jar:]
at
org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:164)
[utils.jar:]
at
org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:103)
[utils.jar:]
at
org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1365)
[bll.jar:]
at
org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:413)
[bll.jar:]
at
org.ovirt.engine.core.bll.executor.DefaultBackendActionExecutor.execute(DefaultBackendActionExecutor.java:13)
[bll.jar:]
at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:450)
[bll.jar:]
at
org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:432) [bll.jar:]
at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:387)
[bll.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.8.0_191]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[rt.jar:1.8.0_191]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498)
[rt.jar:1.8.0_191]
at
org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
at
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
at
org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:92)
[wildfly-weld-ejb-14.0.1.Final.jar:14.0.1.Final]
at
org.jboss.weld.interceptor.proxy.WeldInvocationContextImpl.interceptorChainCompleted(WeldInvocationContextImpl.java:107)
[weld-core-impl-3.0.5.Final.jar:3.0.5.Final]
. . .
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_191]
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value
violates unique constraint "idx_combined_a
d_role_object"
Detail: Key (ad_element_id, role_id,
object_id)=(9d37881c-1991-11e9-b002-00163e7cb696, def0000a-0000-0000-0000-de
f00000000b, e4f92226-0f56-4822-a622-d1ebff41df9f) already exists.
_______________________________________________
Users mailing list -- users(a)ovirt.org
To unsubscribe send an email to users-leave(a)ovirt.org
Privacy Statement:
https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives:
https://lists.ovirt.org/archives/list/users@ovirt.org/message/7D4OP6KG2K7...
--
SANDRO BONAZZOLA
MANAGER, SOFTWARE ENGINEERING, EMEA R&D RHV
Red Hat EMEA <