cloudstack/server/src/com/cloud/storage/VolumeManager.java
Sateesh Chodapuneedi f24e81fe0d CLOUDSTACK-659 Support for storage migration in Cloudstack deployment over VMware Added VmwareStorageMotionStrategy to deal with storage motion tasks. Added target host parameter to MigrateWithStorageCommand.
Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware

Added VmwareStorageMotionStrategy to application context.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

Unit tests for vmware storage motion. These test the VmwareStorageMotionStrategy.

CLOUDSTACK-659

Fixing migrate volume.

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

Added vm type to prepareNetworkFromNicInfo in MigrateWithStorageCommand implementation.

CLOUDSTACK-2701 - Enable storage migration for VMware resources

Fixing attach volume and delete volume cases for volumes that are moved off original path in datastore when created.
If volume is not found in root directory or datastore, do search in sub folders.

CLOUDSTACK-2701 - Enable storage migration for VMware resources

Sending command MigrateWithStorageCommand to source host instead of target host for the case of migration of VM within cluster.

CLOUDSTACK-2701 - Enable storage migration for VMware resources

Searching for virtual disk during device tear down.

Adding dependency of 'cloud-engine-storage' to vmware hypervisor plugin.

Add hypervisor capability storage_motion_supported for VMware 5.0 and 5.1

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware
Added VmwareStorageMotionStrategy to deal with storage motion tasks.
Added target host parameter to MigrateWithStorageCommand.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware

Added VmwareStorageMotionStrategy to application context.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

Unit tests for vmware storage motion. These test the VmwareStorageMotionStrategy.

CLOUDSTACK-659

Fixing migrate volume.

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

Added vm type to prepareNetworkFromNicInfo in MigrateWithStorageCommand implementation.

Adding dependency of 'cloud-engine-storage' to vmware hypervisor plugin.

Add hypervisor capability storage_motion_supported for VMware 5.0 and 5.1

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware
Added VmwareStorageMotionStrategy to deal with storage motion tasks.
Added target host parameter to MigrateWithStorageCommand.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware

Added VmwareStorageMotionStrategy to application context.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

Unit tests for vmware storage motion. These test the VmwareStorageMotionStrategy.

CLOUDSTACK-659

Fixing migrate volume.

Adding dependency of 'cloud-engine-storage' to vmware hypervisor plugin.

Add hypervisor capability storage_motion_supported for VMware 5.0 and 5.1

Adding dependency of 'cloud-engine-storage' to vmware hypervisor plugin.

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware
Added VmwareStorageMotionStrategy to deal with storage motion tasks.
Added target host parameter to MigrateWithStorageCommand.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware Added
Resource changes to perform VM live migration along with virtual disks across the clusters in a zone.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

CLOUDSTACK-659
Support for storage migration in Cloudstack deployment over VMware

Added VmwareStorageMotionStrategy to application context.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Support for volume live migration across datastores

CLOUDSTACK-659

Fixing migrate volume.

Unit tests for vmware storage motion. These test the VmwareStorageMotionStrategy.

CLOUDSTACK-2701 - Enable storage migration for VMware resources

Sending command MigrateWithStorageCommand to source host instead of target host for the case of migration of VM within cluster.

CLOUDSTACK-2701 - Enable storage migration for VMware resources

Moved 2 methods that are not specific to VMware but Volume are moved to VolumeManager from VmwareManager.
Moved datastore volume path constructing code to separate method.
Added check for source and target host, if they are from different DCs/vCenter instances.

Updated error message & removed stale comment

CLOUDSTACK-2701 - Enable storage migration for VMware resources

Injecting component VolumeManager into VmwareResource.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
2013-05-31 21:19:28 +05:30

113 lines
4.3 KiB
Java

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.cloud.storage;
import java.util.Map;
import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.MigrateVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.ResizeVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.UploadVolumeCmd;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.deploy.DeployDestination;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientStorageCapacityException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.StorageUnavailableException;
import com.cloud.host.Host;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Volume.Type;
import com.cloud.user.Account;
import com.cloud.vm.DiskProfile;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
public interface VolumeManager extends VolumeApiService {
VolumeInfo moveVolume(VolumeInfo volume, long destPoolDcId, Long destPoolPodId,
Long destPoolClusterId, HypervisorType dataDiskHyperType)
throws ConcurrentOperationException;
VolumeVO uploadVolume(UploadVolumeCmd cmd)
throws ResourceAllocationException;
VolumeVO allocateDuplicateVolume(VolumeVO oldVol, Long templateId);
boolean volumeOnSharedStoragePool(VolumeVO volume);
boolean volumeInactive(Volume volume);
String getVmNameOnVolume(Volume volume);
VolumeVO allocVolume(CreateVolumeCmd cmd)
throws ResourceAllocationException;
VolumeVO createVolume(CreateVolumeCmd cmd);
VolumeVO resizeVolume(ResizeVolumeCmd cmd)
throws ResourceAllocationException;
boolean deleteVolume(long volumeId, Account caller)
throws ConcurrentOperationException;
void destroyVolume(VolumeVO volume);
DiskProfile allocateRawVolume(Type type, String name, DiskOfferingVO offering, Long size, VMInstanceVO vm, Account owner);
Volume attachVolumeToVM(AttachVolumeCmd command);
Volume detachVolumeFromVM(DetachVolumeCmd cmmd);
void release(VirtualMachineProfile<? extends VMInstanceVO> profile);
void cleanupVolumes(long vmId) throws ConcurrentOperationException;
Volume migrateVolume(MigrateVolumeCmd cmd);
<T extends VMInstanceVO> void migrateVolumes(T vm, VirtualMachineTO vmTo, Host srcHost, Host destHost,
Map<VolumeVO, StoragePoolVO> volumeToPool);
boolean storageMigration(
VirtualMachineProfile<? extends VirtualMachine> vm,
StoragePool destPool);
void prepareForMigration(
VirtualMachineProfile<? extends VirtualMachine> vm,
DeployDestination dest);
void prepare(VirtualMachineProfile<? extends VirtualMachine> vm,
DeployDestination dest) throws StorageUnavailableException,
InsufficientStorageCapacityException, ConcurrentOperationException;
boolean canVmRestartOnAnotherServer(long vmId);
DiskProfile allocateTemplatedVolume(Type type, String name,
DiskOfferingVO offering, VMTemplateVO template, VMInstanceVO vm,
Account owner);
String getVmNameFromVolumeId(long volumeId);
String getStoragePoolOfVolume(long volumeId);
}