> On Aug. 5, 2013, 6:17 p.m., edison su wrote: > > engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java, line 77 > > <https://reviews.apache.org/r/13237/diff/1/?file=334435#file334435line77> > > > > why not just use "select s.scope from storage_pool s, volumes v where > > s.id = v.pool_id"? > > Rajesh Battala wrote: > if we use the above query then we get list of scope values. > mysql> select s.scope from storage_pool s, volumes v where s.id = > v.pool_id; > +---------+ > | scope | > +---------+ > | CLUSTER | > | CLUSTER | > | CLUSTER | > | CLUSTER | > | ZONE | > +---------+ > 5 rows in set (0.00 sec) > > So I had written the above query like SELECT_POOLSCOPE = "SELECT s.scope > from storage_pool s, volumes v where s.id =(select pool_id from volumes where > id =?)"; > to fetch the scope of the storage pool where the volume is existing. > > edison su wrote: > If this is the case, you can use "select s.scope from storage_pool s, > volumes v where s.id = v.pool_id and v.id = your-volume-id"?
edison, the query "select s.scope from storage_pool s, volumes v where s.id = v.pool_id and v.id = your-volume-id" will also get me the scope without any issue. the query you had mentioned is proper one. I will incorporate the change and rebase with 4.2 and submit the patch. - Rajesh ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/13237/#review24653 ----------------------------------------------------------- On Aug. 2, 2013, 10:07 a.m., Rajesh Battala wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/13237/ > ----------------------------------------------------------- > > (Updated Aug. 2, 2013, 10:07 a.m.) > > > Review request for cloudstack, Devdeep Singh, edison su, and Ram Ganesh. > > > Bugs: 3781 > > > Repository: cloudstack-git > > > Description > ------- > > Issue: > ====== > for Volume operations we are finding the hypervisor type. Volume can be in > ZONE/Cluster scope storage pool. > when volume is in ZONE scope, there is issue with they way we fetch the > hypervisor type. It was written to handle Cluster scope only. > > fixed: > ====== > Fixed with sql queries to fetch the Hypervisor type. > 1. Fetch the hypervisor type for volume from storage pool table if the voluem > is in ZONE scope storage pool. > 2. Fetch the hypervisor type for volume from cluster table if the voluem is > in CLUSTER scope storage pool. > > > Diffs > ----- > > engine/schema/src/com/cloud/storage/dao/VolumeDao.java 7b58e7d > engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java e6595b2 > > Diff: https://reviews.apache.org/r/13237/diff/ > > > Testing > ------- > > Setup: > KVM and Xenserver with Adv Zone. > Added pool Zone scope on KVM and Cluster Scope on Xenserver > 1. created instances on KVM and xenserver. > 2. Create two volumes attached to instances on KVM and Xenserver. > 3. vol1 is in Zone scope and vol2 is in cluster scope. > 4. Successfully performed resize opertions on vol1 and vol2. > 5. Succssfully attached/detaches volumes > > > Thanks, > > Rajesh Battala > >