[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16423708#comment-16423708
 ] 

ASF GitHub Bot commented on CLOUDSTACK-7982:
--------------------------------------------

marcaurele commented on a change in pull request #1709: CLOUDSTACK-7982: KVM 
live migration with local storage
URL: https://github.com/apache/cloudstack/pull/1709#discussion_r178758112
 
 

 ##########
 File path: 
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateWithStorageCommandWrapper.java
 ##########
 @@ -0,0 +1,56 @@
+//
+// 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.hypervisor.kvm.resource.wrapper;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.MigrateWithStorageAnswer;
+import com.cloud.agent.api.MigrateWithStorageCommand;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.agent.api.to.DiskTO;
+import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
+import com.cloud.resource.CommandWrapper;
+import com.cloud.resource.ResourceWrapper;
+import org.apache.cloudstack.storage.to.VolumeObjectTO;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@ResourceWrapper(handles = MigrateWithStorageCommand.class)
+public final class  LibvirtMigrateWithStorageCommandWrapper extends 
CommandWrapper<MigrateWithStorageCommand, Answer, LibvirtComputingResource> {
+
+    @Override
+    public Answer execute(final MigrateWithStorageCommand command, final 
LibvirtComputingResource libvirtComputingResource) {
+        List<VolumeObjectTO> volumes = new ArrayList<>();
+        VirtualMachineTO vm = command.getVirtualMachine();
+        List<DiskTO> disks = Arrays.asList(vm.getDisks());
+        for (DiskTO disk : disks) {
+            DataTO data = disk.getData();
+            if (data instanceof VolumeObjectTO) {
+                volumes.add((VolumeObjectTO) data);
+            }
+        }
+
+        final String result = 
LibvirtMigrationHelper.executeMigrationWithFlags(libvirtComputingResource, 
vm.getName(), command.getTargetHost(), 
libvirtComputingResource.getMigrateWithStorageFlags(), null, true);
 
 Review comment:
   @wido shortcut here with `null, true` as last parameters

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Storage live migration support for KVM
> --------------------------------------
>
>                 Key: CLOUDSTACK-7982
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7982
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Wei Zhou
>            Assignee: Marc-Aurèle Brothier
>            Priority: Major
>             Fix For: Future
>
>
> Currently it supports Xenserver, Vmware, Hyper-V, but not KVM.
> We need to add the implementation for KVM.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to