Re: [ovirt-users] creation of lun disks

2016-05-13 Thread Fabrice Bacchella

> Le 13 mai 2016 à 20:04, Juan Hernández  a écrit :
> 
> On 05/13/2016 04:21 PM, Fabrice Bacchella wrote:
>> I'm trying to generated a lun disk, using the python SDK.
>> 
>> My code can be found
>> at https://github.com/fbacchella/ovirtcmd/blob/master/ovlib/disks/__init__.py
>> 
>> If a try to see the content of a existing disk and test with :
>> print disk.get_type()
>> print disk.get_storage_type()
>> 
>> I'm getting :
>> None
>> lun
>> 
>> Now I try to create another LUN disk with
>> kwargs['storage_type'] = 'lun'
>> kwargs['type_'] = 'system'
>> 
>> I'm getting:
>> 
>>> POST /api/disks HTTP/1.1
>>> 
>>>system
>>>virtio-scsi
>>>
>>>
>>>
>>>lun
>>> 
>> ...
>> < 
>> < Incomplete parameters
>> < Storage [type] required for invoke0
>> < 
>> 
>> changing to 
>>kwargs['type_'] = None 
>> change nothing, I'm still getting the same error message.
>> 
>>> POST /api/disks HTTP/1.1
>>> 
>>>virtio-scsi
>>>
>>>
>>>
>>>lun
>>> 
>> ...
>> < 
>> < Incomplete parameters
>> < Storage [type] required for invoke0
>> < 
>> 
>> 
>> What did I do wrong ? There is nothing about that in the logs
>> 
> 
> When creating a LUN disk you need to specify the type (fcp or iscsi)
> inside the "lun_storage" element, so you need to send an XML document
> like this:
> 
>  
>virtio
>
>  fcp
>  
>
>  
> 
> To do that with the Python SDK you need the following code:
> 
>  params.Disk(
>interface='virtio',
>lun_storage=params.Storage(
>  type_='fcp',
>  logical_unit=[
>params.LogicalUnit(
>  id='0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-2',
>),
>  ],
>),
>  )
> 

Ok thanks, but now I'm checking the rsdl (I should have done that earlier) and 
see :


disk.lun_storage.type


disk.lun_storage.logical_unit


logical_unit.id


logical_unit.address


logical_unit.port


logical_unit.target




Given the output for a existing SAN disk, I see :


SHP_MSA_2040_SAS_00c0ff26285a209135570100
HP
MSA 2040 SAS
33
1099511627776
0
dd98b206-08e4-48c0-9795-d10bc7581a95


There is no address, port or target, that are needed only for iscsi. I tried 
without and everything was fine. So I think they are not required.


___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] creation of lun disks

2016-05-13 Thread Juan Hernández
On 05/13/2016 04:21 PM, Fabrice Bacchella wrote:
> I'm trying to generated a lun disk, using the python SDK.
> 
> My code can be found
> at https://github.com/fbacchella/ovirtcmd/blob/master/ovlib/disks/__init__.py
> 
> If a try to see the content of a existing disk and test with :
> print disk.get_type()
> print disk.get_storage_type()
> 
> I'm getting :
> None
> lun
> 
> Now I try to create another LUN disk with
> kwargs['storage_type'] = 'lun'
> kwargs['type_'] = 'system'
> 
> I'm getting:
> 
>> POST /api/disks HTTP/1.1
>> 
>> system
>> virtio-scsi
>> 
>> 
>> 
>> lun
>> 
> ...
> < 
> < Incomplete parameters
> < Storage [type] required for invoke0
> < 
> 
> changing to 
> kwargs['type_'] = None 
> change nothing, I'm still getting the same error message.
> 
>> POST /api/disks HTTP/1.1
>> 
>> virtio-scsi
>> 
>> 
>> 
>> lun
>> 
> ...
> < 
> < Incomplete parameters
> < Storage [type] required for invoke0
> < 
> 
> 
>  What did I do wrong ? There is nothing about that in the logs
> 

When creating a LUN disk you need to specify the type (fcp or iscsi)
inside the "lun_storage" element, so you need to send an XML document
like this:

  
virtio

  fcp
  

  

To do that with the Python SDK you need the following code:

  params.Disk(
interface='virtio',
lun_storage=params.Storage(
  type_='fcp',
  logical_unit=[
params.LogicalUnit(
  id='0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-2',
),
  ],
),
  )

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] creation of lun disks

2016-05-13 Thread Fabrice Bacchella
I'm trying to generated a lun disk, using the python SDK.

My code can be found at 
https://github.com/fbacchella/ovirtcmd/blob/master/ovlib/disks/__init__.py

If a try to see the content of a existing disk and test with :
print disk.get_type()
print disk.get_storage_type()

I'm getting :
None
lun

Now I try to create another LUN disk with
kwargs['storage_type'] = 'lun'
kwargs['type_'] = 'system'

I'm getting:

> POST /api/disks HTTP/1.1
> 
> system
> virtio-scsi
> 
> 
> 
> lun
> 
...
< 
< Incomplete parameters
< Storage [type] required for invoke0
< 

changing to 
kwargs['type_'] = None 
change nothing, I'm still getting the same error message.

> POST /api/disks HTTP/1.1
> 
> virtio-scsi
> 
> 
> 
> lun
> 
...
< 
< Incomplete parameters
< Storage [type] required for invoke0
< 


 What did I do wrong ? There is nothing about that in the logs




___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users