[ovirt-users] Re: Fail to attach/create disk from template when running via Ansible

2019-10-10 Thread Vrgotic, Marko
Hi Ondra, 

That is true,

But why does it work from Portal? Image ID is not differ when run when ansible 
against same template?

I will check anyway.



On 10/10/2019, 09:47, "Ondra Machacek"  wrote:

The error message is:

Image does not exist in domain: 
u'image=d680a46a-7188-45f6-b6a7-f830c0b4, 
domain=935de3ac-a735-4fc8-9161-26bfd751ffc7'

Can you please check if the image with id 
'd680a46a-7188-45f6-b6a7-f830c0b4' exists on storage domain with id 
'935de3ac-a735-4fc8-9161-26bfd751ffc7'?

On 08/10/2019 13:05, Vrgotic, Marko wrote:
> Dear oVirt,
> 
> Just recently, I have upgraded oVirt staging environment from 4.3.4 to 
> 4.3.6 release.
> 
> Since then I noticed the issue when creating VMs from template, using 
> Ansible. When creating VM from template using UI, all works well.
> 
> Tests were executed with same user, with SuperUser priviledges.
> 
> pip freeze
> 
> *ansible==2.7.13*
> 
> asn1crypto==1.0.0
> 
> bcrypt==3.1.7
> 
> cffi==1.12.3
> 
> cryptography==2.7
> 
> dnspython==1.16.0
> 
> ipaddress==1.0.22
> 
> Jinja2==2.10.1
> 
> lxml==4.4.1
> 
> MarkupSafe==1.1.1
> 
> netaddr==0.7.19
> 
> *ovirt-engine-sdk-python==4.3.3*
> 
> paramiko==2.6.0
> 
> pycparser==2.19
> 
> pycurl==7.43.0.3
> 
> PyNaCl==1.3.0
> 
> PyYAML==5.1.2
> 
> six==1.12.0
> 
> *Logs from engine: *
> 
> 2019-10-08 09:57:42,294Z INFO  [org.ovirt.engine.core.bll.AddVmCommand] 
> (default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] Lock Acquired 
> to object 'EngineLock:{exclusiveLocks='[centos-testvm-024=VM_NAME]', 
> sharedLocks='[9ac6f4ad-58d0-4a7e-b424-91f2d76abcac=TEMPLATE, 
> a7e42574-be60-4c94-94a5-cc4b30fdb16f=DISK]'}'
> 
> 2019-10-08 09:57:42,299Z INFO  
> [org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand] 
> (EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] FINISH, 
> HSMClearTaskVDSCommand, return: , log id: be932a0
> 
> 2019-10-08 09:57:42,299Z INFO  
> [org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand] 
> (EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] FINISH, 
> SPMClearTaskVDSCommand, return: , log id: 3e25883
> 
> 2019-10-08 09:57:42,303Z INFO  
> [org.ovirt.engine.core.bll.tasks.SPMAsyncTask] 
> (EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] 
> BaseAsyncTask::removeTaskFromDB: Removed task 
> '7e1d68a2-bb49-4456-b228-db851fe6603c' from DataBase
> 
> 2019-10-08 09:57:42,303Z INFO  
> [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] 
> (EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] 
> CommandAsyncTask::HandleEndActionResult [within thread]: Removing 
> CommandMultiAsyncTasks object for entity 
> '4f8a6897-66e8-453b-b706-246cb8505b3e'
> 
> 2019-10-08 09:57:42,375Z INFO  [org.ovirt.engine.core.bll.AddVmCommand] 
> (default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] Running 
> command: AddVmCommand internal: false. Entities affected :  ID: 
> 2e428504-c339-11e9-87ef-00163e3ec101 Type: ClusterAction group CREATE_VM 
> with role type USER,  ID: 9ac6f4ad-58d0-4a7e-b424-91f2d76abcac Type: 
> VmTemplateAction group CREATE_VM with role type USER,  ID: 
> 935de3ac-a735-4fc8-9161-26bfd751ffc7 Type: StorageAction group 
> CREATE_DISK with role type USER
> 
> 2019-10-08 09:57:42,488Z INFO  
> [org.ovirt.engine.core.bll.AddRngDeviceCommand] (default task-23) 
> [332c57d4] Running command: AddRngDeviceCommand internal: true. Entities 
> affected :  ID: d5719cf0-2a64-4a28-bbf2-edc1bb05b777 Type: VMAction 
> group EDIT_VM_PROPERTIES with role type USER
> 
> 2019-10-08 09:57:42,498Z INFO  
> [org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (default 
> task-23) [332c57d4] START, SetVmStatusVDSCommand( 
> 
SetVmStatusVDSCommandParameters:{vmId='d5719cf0-2a64-4a28-bbf2-edc1bb05b777', 
> status='ImageLocked', exitStatus='Normal'}), log id: 2fe004e2
> 
> 2019-10-08 09:57:42,507Z INFO  
> [org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (default 
> task-23) [332c57d4] FINISH, SetVmStatusVDSCommand, return: , log id: 
> 2fe004e2
> 
> 2019-10-08 09:57:42,528Z INFO  
> [org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand] 
> (default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] Running 
> command: CreateSnapshotFromTemplateCommand internal: true. Entities 
> affected :  ID: 935de3ac-a735-4fc8-9161-26bfd751ffc7 Type: Storage
> 
> 2019-10-08 09:57:42,554Z INFO  
> [org.ovirt.engine.core.vdsbroker.irsbroker.CreateVolumeVDSCommand] 
> (default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] START, 
> CreateVolumeVDSCommand( 
> 

[ovirt-users] Re: Fail to attach/create disk from template when running via Ansible

2019-10-10 Thread Ondra Machacek

The error message is:

Image does not exist in domain: 
u'image=d680a46a-7188-45f6-b6a7-f830c0b4, 
domain=935de3ac-a735-4fc8-9161-26bfd751ffc7'


Can you please check if the image with id 
'd680a46a-7188-45f6-b6a7-f830c0b4' exists on storage domain with id 
'935de3ac-a735-4fc8-9161-26bfd751ffc7'?


On 08/10/2019 13:05, Vrgotic, Marko wrote:

Dear oVirt,

Just recently, I have upgraded oVirt staging environment from 4.3.4 to 
4.3.6 release.


Since then I noticed the issue when creating VMs from template, using 
Ansible. When creating VM from template using UI, all works well.


Tests were executed with same user, with SuperUser priviledges.

pip freeze

*ansible==2.7.13*

asn1crypto==1.0.0

bcrypt==3.1.7

cffi==1.12.3

cryptography==2.7

dnspython==1.16.0

ipaddress==1.0.22

Jinja2==2.10.1

lxml==4.4.1

MarkupSafe==1.1.1

netaddr==0.7.19

*ovirt-engine-sdk-python==4.3.3*

paramiko==2.6.0

pycparser==2.19

pycurl==7.43.0.3

PyNaCl==1.3.0

PyYAML==5.1.2

six==1.12.0

*Logs from engine: *

2019-10-08 09:57:42,294Z INFO  [org.ovirt.engine.core.bll.AddVmCommand] 
(default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] Lock Acquired 
to object 'EngineLock:{exclusiveLocks='[centos-testvm-024=VM_NAME]', 
sharedLocks='[9ac6f4ad-58d0-4a7e-b424-91f2d76abcac=TEMPLATE, 
a7e42574-be60-4c94-94a5-cc4b30fdb16f=DISK]'}'


2019-10-08 09:57:42,299Z INFO  
[org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand] 
(EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] FINISH, 
HSMClearTaskVDSCommand, return: , log id: be932a0


2019-10-08 09:57:42,299Z INFO  
[org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand] 
(EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] FINISH, 
SPMClearTaskVDSCommand, return: , log id: 3e25883


2019-10-08 09:57:42,303Z INFO  
[org.ovirt.engine.core.bll.tasks.SPMAsyncTask] 
(EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] 
BaseAsyncTask::removeTaskFromDB: Removed task 
'7e1d68a2-bb49-4456-b228-db851fe6603c' from DataBase


2019-10-08 09:57:42,303Z INFO  
[org.ovirt.engine.core.bll.tasks.CommandAsyncTask] 
(EE-ManagedThreadFactory-engine-Thread-43687) [390b4c75] 
CommandAsyncTask::HandleEndActionResult [within thread]: Removing 
CommandMultiAsyncTasks object for entity 
'4f8a6897-66e8-453b-b706-246cb8505b3e'


2019-10-08 09:57:42,375Z INFO  [org.ovirt.engine.core.bll.AddVmCommand] 
(default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] Running 
command: AddVmCommand internal: false. Entities affected :  ID: 
2e428504-c339-11e9-87ef-00163e3ec101 Type: ClusterAction group CREATE_VM 
with role type USER,  ID: 9ac6f4ad-58d0-4a7e-b424-91f2d76abcac Type: 
VmTemplateAction group CREATE_VM with role type USER,  ID: 
935de3ac-a735-4fc8-9161-26bfd751ffc7 Type: StorageAction group 
CREATE_DISK with role type USER


2019-10-08 09:57:42,488Z INFO  
[org.ovirt.engine.core.bll.AddRngDeviceCommand] (default task-23) 
[332c57d4] Running command: AddRngDeviceCommand internal: true. Entities 
affected :  ID: d5719cf0-2a64-4a28-bbf2-edc1bb05b777 Type: VMAction 
group EDIT_VM_PROPERTIES with role type USER


2019-10-08 09:57:42,498Z INFO  
[org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (default 
task-23) [332c57d4] START, SetVmStatusVDSCommand( 
SetVmStatusVDSCommandParameters:{vmId='d5719cf0-2a64-4a28-bbf2-edc1bb05b777', 
status='ImageLocked', exitStatus='Normal'}), log id: 2fe004e2


2019-10-08 09:57:42,507Z INFO  
[org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (default 
task-23) [332c57d4] FINISH, SetVmStatusVDSCommand, return: , log id: 
2fe004e2


2019-10-08 09:57:42,528Z INFO  
[org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand] 
(default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] Running 
command: CreateSnapshotFromTemplateCommand internal: true. Entities 
affected :  ID: 935de3ac-a735-4fc8-9161-26bfd751ffc7 Type: Storage


2019-10-08 09:57:42,554Z INFO  
[org.ovirt.engine.core.vdsbroker.irsbroker.CreateVolumeVDSCommand] 
(default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] START, 
CreateVolumeVDSCommand( 
CreateVolumeVDSCommandParameters:{storagePoolId='2e3b3484-c339-11e9-8d02-00163e3ec101', 
ignoreFailoverLimit='false', 
storageDomainId='935de3ac-a735-4fc8-9161-26bfd751ffc7', 
imageGroupId='d680a46a-7188-45f6-b6a7-f830c0b4', 
imageSizeInBytes='8589934592', volumeFormat='COW', 
newImageId='9a96018c-ce7d-4c77-a91a-30fc16c7b2ba', imageType='Sparse', 
newImageDescription='', imageInitialSizeInBytes='0', 
imageId='f9e0c4d9-81dd-4e44-8a71-33e55d4399c6', 
sourceImageGroupId='a7e42574-be60-4c94-94a5-cc4b30fdb16f'}), log id: 
37b29c7d


2019-10-08 09:57:42,639Z INFO  
[org.ovirt.engine.core.vdsbroker.irsbroker.CreateVolumeVDSCommand] 
(default task-23) [067ec489-ae6c-4871-8ab6-8296016ca1ce] FINISH, 
CreateVolumeVDSCommand, return: 9a96018c-ce7d-4c77-a91a-30fc16c7b2ba, 
log id: 37b29c7d


2019-10-08 09:57:42,645Z INFO  
[org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (default task-23) 
[067ec489-ae6c-4871-8ab6-8296016ca