Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-8085

Fails to attach a volume (is made from a snapshot) to a VM with using local storage as primary storage.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Problem
    • Affects Version/s: 4.5.0, 4.4.3, 4.3.2, 4.6.0
    • Fix Version/s: None
    • Component/s: KVM, Snapshot, Volumes
    • Security Level: Public (Anyone can view this level - this is the default.)
    • Labels:
      None
    • Environment:

      Description

      CloudStack fails to attach a DATADISK volume (This DATADISK volume is made from a snapshot) to a VM with using local storage as primary storage.

      Reproduction procedure:

      1. To use local storage as primary storage.
      2. Take a snapshot of a VM's ROOT/DATADISK volume. (By clicking [Take Snapshot] button on WebUI.)
      3. Create a new DATADISK volume from this snapshot. (By clicking [Create Volume] button on WebUI.)
      4. Try to attach this new DATADISK volume to a VM. (By Clicking [Attach Disk] button on WebUI.)

      When we execute these, CloudStack fails attach this new DATADISK volume to the VM with occuring the following error:

       "Failed to attach local data volume snapshot-test-std-stop to VM snapshot-test-0001 as migration of local data volume is not allowed"
      

      At this time, Cloudstack puts a exception in management-server.log. (Please see [1])

      We investigate our CloudStack environment about this problem.
      We notice that Cloudstack behaves as follows:

      • CloudStack creates a new DATADISK volume at primary storage of any one of the hosts when a user creates the volume from a snapshot by executing [Create Volume]. (This primary storage is local storage on the host.)
      • Now, the user deploys a new VM (or uses a existing VM). In many cases, the new DATADISK volume is deployed to a host different from the host that is deployed the VM.
      • User will attach the new DATADISK volume to the VM. When the user executes [Attach Disk], CloudStack tries to migrate the new DATADISK volume to the host that is deployed the VM in order to attach the new DATADISK volume to the VM.
      • However, CloudStack fails this migration because we use local storage as primary storage.

      [1] Exception in managemnet-server.log

      2014-12-02 19:37:10,807 ERROR [c.c.a.ApiAsyncJobDispatcher] (Job-Executor-50:ctx-a0ef6a5a) Unexpected exception while executing org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd
      com.cloud.utils.exception.CloudRuntimeException: Failed to attach local data volume snapshot-test-std-stop to VM snapshot-test-0001 as migration of local data volume is not allowed
              at com.cloud.storage.VolumeApiServiceImpl.attachVolumeToVM(VolumeApiServiceImpl.java:1292)
              at com.cloud.storage.VolumeApiServiceImpl.orchestrateAttachVolumeToVM(VolumeApiServiceImpl.java:1156)
              at com.cloud.storage.VolumeApiServiceImpl.attachVolumeToVM(VolumeApiServiceImpl.java:1126)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:622)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
              at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at com.sun.proxy.$Proxy197.attachVolumeToVM(Unknown Source)
              at org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd.execute(AttachVolumeCmd.java:123)
              at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:161)
              at com.cloud.api.ApiAsyncJobDispatcher.runJobInContext(ApiAsyncJobDispatcher.java:109)
              at com.cloud.api.ApiAsyncJobDispatcher$1.run(ApiAsyncJobDispatcher.java:66)
              at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
              at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
              at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
              at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:63)
              at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:509)
              at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
              at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
              at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
              at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
              at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
              at java.util.concurrent.FutureTask.run(FutureTask.java:166)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:701)
      

        Attachments

          Activity

            People

            • Assignee:
              bhaisaab Rohit Yadav
              Reporter:
              yusa Keiichi Yusa
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: