def create_data_volume(self, name = None, ps_uuid = None):
        '''
        @return: zstack_test_volume() object 
        '''
        import zstackwoodpecker.zstack_test.zstack_test_volume as \
                zstack_volume_header

        if self.state == sp_header.DELETED:
            test_util.test_fail(
'Should not be called, as snapshot volume:%s has been deleted. Snapshot can not\
be created to a new data volume' % self.target_volume.get_volume().uuid)

        if not name:
            name = 'data volume created by sp: %s' % self.snapshot.uuid

        snapshot_uuid = self.get_snapshot().uuid
        volume_inv = vol_ops.create_volume_from_snapshot(snapshot_uuid, \
                name, ps_uuid)
        super(ZstackTestSnapshot, self).create_data_volume()

        volume_obj = zstack_volume_header.ZstackTestVolume()
        volume_obj.set_volume(volume_inv)
        volume_obj.set_state(volume_header.DETACHED)
        #ROOT Volume won't create checking point. So skip.
        if self.get_volume_type() != volume_header.ROOT_VOLUME:
            volume_obj.set_original_checking_points(self.get_checking_points())
        return volume_obj
예제 #2
0
    def create_data_volume(self, name=None, ps_uuid=None):
        '''
        @return: zstack_test_volume() object 
        '''
        import zstackwoodpecker.zstack_test.zstack_test_volume as \
                zstack_volume_header

        if self.state == sp_header.DELETED:
            test_util.test_fail(
                'Should not be called, as snapshot volume:%s has been deleted. Snapshot can not\
be created to a new data volume' % self.target_volume.get_volume().uuid)

        if not name:
            name = 'data volume created by sp: %s' % self.snapshot.uuid

        snapshot_uuid = self.get_snapshot().uuid
        volume_inv = vol_ops.create_volume_from_snapshot(snapshot_uuid, \
                name, ps_uuid)
        super(ZstackTestSnapshot, self).create_data_volume()

        volume_obj = zstack_volume_header.ZstackTestVolume()
        volume_obj.set_volume(volume_inv)
        volume_obj.set_state(volume_header.DETACHED)
        #ROOT Volume won't create checking point. So skip.
        if self.get_volume_type() != volume_header.ROOT_VOLUME:
            volume_obj.set_original_checking_points(self.get_checking_points())
        return volume_obj
예제 #3
0
    def create_data_volume(self, name=None, ps_uuid=None):

        snapshot_uuid = self.snapshot.uuid
        if not name:
            name = 'data volume created by sp: %s' % snapshot_uuid

        volume_inv = vol_ops.create_volume_from_snapshot(snapshot_uuid, name, ps_uuid)

        volume_test_obj = zstack_volume_header.ZstackTestVolume()
        volume_test_obj.set_volume(volume_inv)
        volume_test_obj.set_state(volume_header.DETACHED)

        # add checking file
        if self.get_volume_type() != volume_header.ROOT_VOLUME:
            volume_test_obj.set_original_checking_points(self.get_checking_points())

        return volume_test_obj