cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Tutkowski <mike.tutkow...@solidfire.com>
Subject Re: createAsync Question
Date Wed, 17 Apr 2013 22:54:55 GMT
As I think more about createAsync, I believe I would need to accomplish two
tasks here:

1) Create my volume on the SAN.

2) Add a row to the volumes table describing this new SAN volume.

So, I think CreateCommand, though, is used when you want to actually create
a volume on an SR, right?  If that's the case, I wouldn't want to do that
in createAsync because at that point I don't know what cluster my volume
will be on, right?  I would just want to update the DB table volumes with
my SAN volume info.


On Wed, Apr 17, 2013 at 12:52 PM, Mike Tutkowski <
mike.tutkowski@solidfire.com> wrote:

> Meant to send this out to the entire list, so others could hear what
> Edison has to say, as well.
>
>
> ---------- Forwarded message ----------
> From: Mike Tutkowski <mike.tutkowski@solidfire.com>
> Date: Wed, Apr 17, 2013 at 12:42 PM
> Subject: Re: createAsync Question
> To: Edison Su <Edison.su@citrix.com>
>
>
> Ah, I remember our discussion about that more now.
>
> Here is what my createAsync currently looks like (after I read your
> e-mail):
>
>     @Override
>
>     public void createAsync(DataObject data,
> AsyncCompletionCallback<CreateCmdResult> callback) {
>
>         String iqn = null;
>
>         String errMsg = null;
>
>          if (data.getType() == DataObjectType.VOLUME) {
>
>             try {
>
>                 // just create a SolidFire volume and return IQN
>
>                 iqn = createSolidFireVolume((VolumeInfo)data);
>
>             } catch (StorageUnavailableException e) {
>
>                 s_logger.debug("Failed to create volume
> (StorageUnavailableException)", e);
>
>                 errMsg = e.toString();
>
>            } catch (Exception e) {
>
>                s_logger.debug("Failed to create volume (Exception)", e);
>
>                errMsg = e.toString();
>
>            }
>
>         }
>
>         else {
>
>             errMsg = "Invalid DataObjectType (" + data.getType() + ")
> passed to createAsync";
>
>         }
>
>          // path = iqn
>
>         // size is pulled from DataObject instance, if errMsg is null
>
>         CreateCmdResult result = new CreateCmdResult(iqn, errMsg != null? null : data.getSize());
>
>          if (errMsg != null) {
>
>             result.setResult(errMsg);
>
>         }
>
>
>         callback.complete(result);
>
>     }
>
>
> Do I have to update any DB table at this point now that my volume has been
> created on the SAN?
>
>
> Thanks!!
>
>
> On Wed, Apr 17, 2013 at 12:09 AM, Edison Su <Edison.su@citrix.com> wrote:
>
>>  Creatasync doesn't need to create a storage pool on the hypervisor
>> host, as you don't know which hypervisor host want to access the volume yet.
>> The volume will be accessed by hypervisor host in attachvolumecmd, you
>> can add your code in citrixresource: execute(attachvolumecmd), to create a
>> sr from an iscsi lun, and also create a vdi from the sr, then vbd, the
>> attach it to vm.
>>
>> Sent from my Windows Phone
>>  ------------------------------
>> From: Mike Tutkowski <mike.tutkowski@solidfire.com>
>> Sent: 4/16/2013 1:59 PM
>>
>> To: Edison Su <Edison.su@citrix.com>; cloudstack-dev@incubator.apache.org
>> Subject: createAsync Question
>>
>>  Hi Edison,
>>
>>  I have another question regarding our discussion yesterday.
>>
>>  I'm trying to implement the createAsync method.
>>
>>  This is my impression for how I should start doing so:
>>
>>  Create a volume on our SAN.  I believe I can get the specs for this
>> volume from the Disk Offering like this:
>>
>>  DiskOfferingVO offering = diskOfferingDao
>> .findById(volume.getDiskOfferingId());
>>
>>  The next part is a bit hazy.  As we discussed yesterday, let's just
>> deal with XenServer for the moment.  :)
>>
>>  I'm thinking after I create my volume on the SAN, I should create an
>> instance of CreateStoragePoolCommand and send it to the hypervisor this way:
>>
>>  Answer answer = storageMgr.sendToPool(pool, null, cmd);
>>
>>  The type of the storage pool I would place in the
>> CreateStoragePoolCommand instance is StoragePoolType.IscsiLUN.
>>
>>  This would create a storage repository for me on the hypervisor.
>>
>>  I would then need to create an instance of CreateCommand and send it to
>> the hypervisor the same way to create a volume on the storage repository I
>> just created:
>>
>>  Answer answer = storageMgr.sendToPool(pool, null, cmd);
>>
>>  This volume on the storage repository would consume the entire SR.
>>
>>  Am I making decent sense here?
>>
>>  Thanks!
>>
>>  --
>> *Mike Tutkowski*
>> *Senior CloudStack Developer, SolidFire Inc.*
>> e: mike.tutkowski@solidfire.com
>> o: 303.746.7302
>> Advancing the way the world uses the cloud<http://solidfire.com/solution/overview/?video=play>
>> *™*
>>
>
>
>
> --
> *Mike Tutkowski*
>  *Senior CloudStack Developer, SolidFire Inc.*
> e: mike.tutkowski@solidfire.com
> o: 303.746.7302
> Advancing the way the world uses the cloud<http://solidfire.com/solution/overview/?video=play>
> *™*
>
>
>
> --
> *Mike Tutkowski*
> *Senior CloudStack Developer, SolidFire Inc.*
> e: mike.tutkowski@solidfire.com
> o: 303.746.7302
> Advancing the way the world uses the cloud<http://solidfire.com/solution/overview/?video=play>
> *™*
>



-- 
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkowski@solidfire.com
o: 303.746.7302
Advancing the way the world uses the
cloud<http://solidfire.com/solution/overview/?video=play>
*™*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message