You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by ustcweizhou <gi...@git.apache.org> on 2015/10/26 07:39:46 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

GitHub user ustcweizhou opened a pull request:

    https://github.com/apache/cloudstack/pull/977

    CLOUDSTACK-8746: VM Snapshotting implementation for KVM

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ustcweizhou/cloudstack vm-snapshot

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/977.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #977
    
----
commit 9ea4d67817c63f82105f83e8e8686d40d80fc4c4
Author: Wei Zhou <w....@leaseweb.com>
Date:   2014-05-22T13:30:29Z

    [VM-SNAPSHOT] vm snapshot implementation for KVM

commit 19f19fd5938a9f8ead5b550031259e25734557ed
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-03-16T13:19:28Z

    [VM-SNAPSHOT] change icon for revertToVMSnapshot

commit 72a99fbff970a3f79322b9ed2bd3edce7a1ee69f
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-06-18T18:56:18Z

    [VM-SNAPSHOT] restoreVMSnapshot from qcow2 image

commit 1b8bc95cb4339edb8e26a248b1c3d9dbcf564ec1
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-06-21T20:35:29Z

    [VM-SHAPSHOT] remove vm snapshots when revert snapshot

commit e90423e4eb34c499169bda56de0ceff06812052e
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-07-03T10:44:32Z

    [VM-SNAPSHOT] create volume snapshot from vm snapshot

commit cfead75aee2961823108aedda39f816cd46f5572
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-10-13T18:41:01Z

    [VM-SHAPSHOT] enable vm snapshot for KVM in hypervisor_capabilities

commit 2046fdde14c26993cd7ee0862005f0ccc2f05bcf
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-10-14T18:50:42Z

    [VM-SNAPSHOT] fix NPE when start instance with vm snapshots

commit 5c15030d854a403efe7cf1e3eeda23ebc8d9ee7c
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-10-15T06:22:52Z

    [VM-SNAPSHOT] restore VM snapshot if migration fails

commit 72c13a144b1ca486ccdbd6125074fd605c5674a4
Author: Wei Zhou <w....@tech.leaseweb.com>
Date:   2015-10-15T06:23:01Z

    [VM-SNAPSHOT] move message for create vm snapshot

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-164401512
  
    @remibergsma 
    rebase with latest master 7c83e1b2402db9e359fb086b158d65c25309a70e
    
    result of squashing the commits:
    
    (before suqash, 16 commits)
    pick 8a523e8 [VM-SNAPSHOT] vm snapshot implementation for KVM
    pick 7e26816 [VM-SNAPSHOT] restoreVMSnapshot from qcow2 image
    pick 5a369d0 [VM-SHAPSHOT] remove vm snapshots when revert snapshot
    pick a0fe12f [VM-SNAPSHOT] create volume snapshot from vm snapshot
    pick 222746f [VM-SNAPSHOT] change icon for revertToVMSnapshot
    pick b555c5f [VM-SNAPSHOT] fix NPE when start instance with vm snapshots
    pick f5be57f [VM-SNAPSHOT] restore VM snapshot if migration fails
    pick a7eb563 [VM-SNAPSHOT] move message for create vm snapshot
    pick d9853f9 [VM-SNAPSHOT] fix NPE in createSnapshotFromVMSnapshot if vm snapshot does not exist
    pick 4b8dc8a [VM-SNAPSHOT] use libvirt-java flags instead of virsh command line
    pick e3bc928 [VM-SNAPSHOT] make small changes (checkAccess, since version, possible NPE, uuid in error message)
    pick c8c4a4f [VM-SNAPSHOT] take snapshot of specific volume from vm snapshot
    pick 5e97629 [VM-SNAPSHOT] add unit test for backupSnapshotFromVMSnapshot
    pick dd881fe [VM-SNAPSHOT] some UI changes
    pick b976eb3 [VM-SNAPSHOT] sort snapshots by name so that they can be restored by time
    pick 1047735 [VM-SNAPSHOT] move generation of VMSnapshot XML to LibvirtUtilitiesHelper
    
    (after squash, 4 commits)
    pick 357bc1c [VM-SNAPSHOT] vm snapshot implementation for KVM
    pick d2d4464 [VM-SNAPSHOT] restoreVMSnapshot from qcow2 image
    pick cb04506 [VM-SNAPSHOT] create volume snapshot from vm snapshot
    pick 7e11556 [VM-SNAPSHOT] use libvirt-java flags instead of virsh command line
    
    (no diff)
    [root@weizhou-centos master(vm-snapshot)]# git diff 1047735
    [root@weizhou-centos master(vm-snapshot)]#
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan package


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

RE: [GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by Simon Weller <sw...@ena.com>.
Yes, it's a bug, due to the number of associated comments attached to this PR.

Simon Weller/615-312-6068

-----Original Message-----
From: DaanHoogland [git@git.apache.org]
Received: Saturday, 28 Jan 2017, 12:17PM
To: dev@cloudstack.apache.org [dev@cloudstack.apache.org]
Subject: [GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Github user DaanHoogland commented on the issue:

    https://github.com/apache/cloudstack/pull/977

    hey @kiwiflyer (not related to the PR at hand) I see that this PR is not reported on acspr.enu.net as ci complete. Is that a bug?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    hey @kiwiflyer (not related to the PR at hand) I see that this PR is not reported on acspr.enu.net as ci complete. Is that a bug?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou @rhtyd 
    
    So the vmsnapshot test seems might need some work. Here's the exception it threw:
    
    2017-01-10 17:27:01,025 - CRITICAL - EXCEPTION: test_01_create_vm_snapshots: ['Traceback (most recent call last):\n', '  File "/usr/lib64/python2.7/unittest/case.py", line 369, in run\n    testMethod()\n', '  File "/marvin/tests/smoke/test_vm_snapshots.py", line 158, in test_01_create_vm_snapshots\n    "Dsiplay Text"\n', '  File "/usr/lib/python2.7/site-packages/marvin/lib/base.py", line 4702, in create\n    return VmSnapshot(apiclient.createVMSnapshot(cmd).__dict__)\n', '  File "/usr/lib/python2.7/site-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 1281, in createVMSnapshot\n    response = self.connection.marvinRequest(command, response_type=response, method=method)\n', '  File "/usr/lib/python2.7/site-packages/marvin/cloudstackConnection.py", line 379, in marvinRequest\n    raise e\n', 'CloudstackAPIException: Execute cmd: createvmsnapshot failed, due to: errorCode: 431, errorText:KVM VM does not allow to take a disk-only snapshot when VM is in running state\n']
    
    The nuance here is that you need to specify snapshotmemory=true in order to take a KVM snapshot with the VM running.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by ozhanrk <gi...@git.apache.org>.
Github user ozhanrk commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    great news \U0001f44d  thanks @ustcweizhou @kiwiflyer 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.9] CLOUDSTACK-8746: VM Snapshotting im...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-219629235
  
    rebased with rebased with apache/master.
    Add one more commit: 	
    [VM-SNAPSHOT] add role permissions for new API command createSnapshotFromVMSnapshot


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by luhaijiao <gi...@git.apache.org>.
Github user luhaijiao commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    can we run the test and get this valuable improvement included in 4.9.x ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-153650536
  
    @wido code are updated.
    I have a node running with Ubuntu 12.04/qemu 1.2.1/libvirt 0.9.13 (not stock QEMU 1.0 and libvirt 0.9.8). It works fine in the vm snapshot testing.
    I did not test libvirt 0.9.8, but I think it will work. I will test it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151442130
  
    @DaanHoogland Indeed, that is the case.
    
    The problems I had were with libvirt, not the bindings. libvirt-java is distributed via Maven and we include it in our pom.xml as a repository to libvirt.org/maven
    
    libvirt-java is not distributed via DEB or RPM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #977: [4.9] CLOUDSTACK-8746: VM Snapshotting impleme...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r93811956
  
    --- Diff: setup/db/db/schema-4910to41000.sql ---
    @@ -53,3 +53,7 @@ ALTER TABLE `cloud`.`image_store_details` CHANGE COLUMN `value` `value` VARCHAR(
     NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user' AFTER `value`;
     
     ALTER TABLE `snapshots` ADD COLUMN `location_type` VARCHAR(32) COMMENT 'Location of snapshot (ex. Primary)';
    +
    --- End diff --
    
    Move the changes to 4920to41000.sql



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-192928078
  
    We've tested this patch against master. Snapshots  work correctly and data is displayed in UI when using supported storage backend (NFS), so nice work!
    
    We also tested it against an upsupported storage backend (Ceph) to see what happened. libvirt obviously returned a failure, but ACS doesn't seem to handle it gracefully. I'd suggest you might want to check what the underlying storage is and immediately return an error, rather than sending it to libvirt and having it fail in a unexpected way.
    
    Here is the exception with Ceph backend on the management logs:
    
    2016-03-06 10:32:33,523 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-2:ctx-32d16d4e job-153) (logid:ccf67994) Unexpected exception while executing org.apache.cloudstack.api.command.user.vmsnapshot.CreateVMSnapshotCmd
    java.lang.RuntimeException: Unexpected exception
            at com.cloud.vm.snapshot.VMSnapshotManagerImpl.creatVMSnapshot(VMSnapshotManagerImpl.java:410)
            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:606)
            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.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:106)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            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.creatVMSnapshot(Unknown Source)
            at org.apache.cloudstack.api.command.user.vmsnapshot.CreateVMSnapshotCmd.execute(CreateVMSnapshotCmd.java:113)
            at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:150)
            at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
            at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:554)
            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 org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:502)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
            at java.util.concurrent.FutureTask.run(FutureTask.java:262)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NullPointerException
            at com.cloud.vm.snapshot.VMSnapshotManagerImpl.orchestrateCreateVMSnapshot(VMSnapshotManagerImpl.java:1041)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    
    The UI returns an "Unexpected Exception".
    
    If you list the snapshots, the snapshot shows in error and it you try and delete one, you get an exception:
    
    016-03-06 10:36:29,487 ERROR [o.a.c.s.v.DefaultVMSnapshotStrategy] (Work-Job-Executor-4:ctx-721398e0 job-157/job-158 ctx-965269d3) (logid:74099fa3) Delete vm snapshot i-2-26-VM_VS_20160306163232 of vm i-2-26-VM failed due to  Delete VM snapshot failed due to org.libvirt.LibvirtException: Domain snapshot not found: no domain snapshot with matching name 'i-2-26-VM_VS_20160306163232'
    2016-03-06 10:36:29,487 DEBUG [c.c.v.s.VMSnapshotManagerImpl] (Work-Job-Executor-4:ctx-721398e0 job-157/job-158 ctx-965269d3) (logid:74099fa3) Failed to delete vm snapshot: 5
    com.cloud.utils.exception.CloudRuntimeException: Delete vm snapshot i-2-26-VM_VS_20160306163232 of vm i-2-26-VM failed due to  Delete VM snapshot failed due to org.libvirt.LibvirtException: Domain snapshot not found: no domain snapshot with matching name 'i-2-26-VM_VS_20160306163232'
            at org.apache.cloudstack.storage.vmsnapshot.DefaultVMSnapshotStrategy.deleteVMSnapshot(DefaultVMSnapshotStrategy.java:218)
            at com.cloud.vm.snapshot.VMSnapshotManagerImpl.orchestrateDeleteVMSnapshot(VMSnapshotManagerImpl.java:554)
            at com.cloud.vm.snapshot.VMSnapshotManagerImpl.orchestrateDeleteVMSnapshot(VMSnapshotManagerImpl.java:1047)
            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:606)
            at com.cloud.vm.VmWorkJobHandlerProxy.handleVmWorkJob(VmWorkJobHandlerProxy.java:107)
            at com.cloud.vm.snapshot.VMSnapshotManagerImpl.handleVmWorkJob(VMSnapshotManagerImpl.java:1067)
            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:606)
            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.handleVmWorkJob(Unknown Source)
            at com.cloud.vm.VmWorkJobDispatcher.runJob(VmWorkJobDispatcher.java:102)
            at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:554)
            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 org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:502)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
            at java.util.concurrent.FutureTask.run(FutureTask.java:262)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:745)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by nathanejohnson <gi...@git.apache.org>.
Github user nathanejohnson commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou I'm pulling this down for testing, I will update with logs and screen shots soon


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou can you fix the conflicts and address outstanding issues?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    changed the title of commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou can you rebase against latest master, fix and merge conflicts and squash your changes, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151440654
  
    So @wido , is the discussion whether we should change libvirt-java and contribute back or use virsh?
    
    I'm all for the first one but I recall problems you had with getting those people to upgrade their distro. so maybe forking and sending patches (more maintenance but also more control) is a good middle ground?
    
    As for the feature; it is a customer request so for me as dev a must have.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43734224
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtDeleteVMSnapshotCommandWrapper.java ---
    @@ -0,0 +1,108 @@
    +//
    +// 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 org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
    +import org.apache.cloudstack.storage.to.VolumeObjectTO;
    +import org.apache.log4j.Logger;
    +import org.libvirt.Connect;
    +import org.libvirt.Domain;
    +import org.libvirt.DomainSnapshot;
    +import org.libvirt.LibvirtException;
    +
    +import com.cloud.agent.api.Answer;
    +import com.cloud.agent.api.DeleteVMSnapshotAnswer;
    +import com.cloud.agent.api.DeleteVMSnapshotCommand;
    +import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
    +import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk;
    +import com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager;
    +import com.cloud.resource.CommandWrapper;
    +import com.cloud.resource.ResourceWrapper;
    +import com.cloud.storage.Volume;
    +import com.cloud.utils.script.Script;
    +
    +@ResourceWrapper(handles =  DeleteVMSnapshotCommand.class)
    +public final class LibvirtDeleteVMSnapshotCommandWrapper extends CommandWrapper<DeleteVMSnapshotCommand, Answer, LibvirtComputingResource> {
    +
    +    private static final Logger s_logger = Logger.getLogger(LibvirtDeleteVMSnapshotCommandWrapper.class);
    +
    +    @Override
    +    public Answer execute(final DeleteVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    +        String vmName = cmd.getVmName();
    +
    +        final KVMStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    +        Domain dm = null;
    +        try {
    +            final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
    +            Connect conn = libvirtUtilitiesHelper.getConnection();
    +            dm = libvirtComputingResource.getDomain(conn, vmName);
    +
    +            DomainSnapshot snapshot = null;
    +            try {
    +                snapshot = dm.snapshotLookupByName(cmd.getTarget().getSnapshotName());
    +            } catch (LibvirtException e) {
    +                s_logger.warn("Cannot find vmSnapshot with name: " + cmd.getTarget().getSnapshotName());
    +                return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    +            }
    +
    +            snapshot.delete(0); // only remove this snapshot, not children
    +
    +            return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    +        } catch (LibvirtException e) {
    +            String msg = " Delete VM snapshot failed due to " + e.toString();
    --- End diff --
    
    Can't you move this down to where you actually throw the Answer back?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43734962
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtDeleteVMSnapshotCommandWrapper.java ---
    @@ -0,0 +1,108 @@
    +//
    +// 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 org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
    +import org.apache.cloudstack.storage.to.VolumeObjectTO;
    +import org.apache.log4j.Logger;
    +import org.libvirt.Connect;
    +import org.libvirt.Domain;
    +import org.libvirt.DomainSnapshot;
    +import org.libvirt.LibvirtException;
    +
    +import com.cloud.agent.api.Answer;
    +import com.cloud.agent.api.DeleteVMSnapshotAnswer;
    +import com.cloud.agent.api.DeleteVMSnapshotCommand;
    +import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
    +import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk;
    +import com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager;
    +import com.cloud.resource.CommandWrapper;
    +import com.cloud.resource.ResourceWrapper;
    +import com.cloud.storage.Volume;
    +import com.cloud.utils.script.Script;
    +
    +@ResourceWrapper(handles =  DeleteVMSnapshotCommand.class)
    +public final class LibvirtDeleteVMSnapshotCommandWrapper extends CommandWrapper<DeleteVMSnapshotCommand, Answer, LibvirtComputingResource> {
    +
    +    private static final Logger s_logger = Logger.getLogger(LibvirtDeleteVMSnapshotCommandWrapper.class);
    +
    +    @Override
    +    public Answer execute(final DeleteVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    +        String vmName = cmd.getVmName();
    +
    +        final KVMStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    +        Domain dm = null;
    +        try {
    +            final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
    +            Connect conn = libvirtUtilitiesHelper.getConnection();
    +            dm = libvirtComputingResource.getDomain(conn, vmName);
    +
    +            DomainSnapshot snapshot = null;
    +            try {
    +                snapshot = dm.snapshotLookupByName(cmd.getTarget().getSnapshotName());
    +            } catch (LibvirtException e) {
    +                s_logger.warn("Cannot find vmSnapshot with name: " + cmd.getTarget().getSnapshotName());
    +                return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    +            }
    +
    +            snapshot.delete(0); // only remove this snapshot, not children
    +
    +            return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    +        } catch (LibvirtException e) {
    +            String msg = " Delete VM snapshot failed due to " + e.toString();
    --- End diff --
    
    This is because I wanted to display different error/warning message when exceptions are thown on snapshotLookupByName and snapshot.delete(0).
    It looks not necessary. I will modify it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-162232240
  
    @ustcweizhou Can you please rebase and resolve the conflict? I can then run the tests again.
    
    @wido @DaanHoogland Do we want this in 4.7?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-157883615
  
    reran the tests. I noticed time out on destroy ssvm en cpvm but all others succeed. These timeouts, I have seen before in unrelated PRs. the systemvms come up but not quick enough for the test to succeed.
    
    LGTM
    
    [977.network.results.txt](https://github.com/apache/cloudstack/files/38402/977.network.results.txt)
    [977.vpc.results.txt](https://github.com/apache/cloudstack/files/38403/977.vpc.results.txt)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151050842
  
    @sateesh-chodapuneedi Thanks for your comment, I will fix it soon.
    This is an implementation of vm snapshot for KVM. 
    You may find the FS at:https://cwiki.apache.org/confluence/display/CLOUDSTACK/VM+Snapshots
    I will update the FS later.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by sateesh-chodapuneedi <gi...@git.apache.org>.
Github user sateesh-chodapuneedi commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42966249
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,191 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    --- End diff --
    
    Can we choose if we want to take snapshot of specific volume from vm snapshot? This helps if VM (owner VM of VM snapshot) has multiple volumes along with ROOT volume and the specified VM snapshot image represents chains of snapshot images of each volume of the VM.
    Probably we should add volumeId parameter to this to identify the volume that needs to be backed up?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    VM snapshot revert live:
    
    ![vmsnapshot_revert1](https://cloud.githubusercontent.com/assets/17278194/21755159/88a0d7b2-d5d4-11e6-9478-205a84a770a0.png)
    
    ![vmsnapshot_revert2](https://cloud.githubusercontent.com/assets/17278194/21755161/8d100ea8-d5d4-11e6-9fdb-e19f1e484d19.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou we can work on the db schema paths soon; assuming 4.9.3.0 won't bring in any db changes; we may not change the file names.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Packaging result: \u2714centos6 \u2714centos7 \u2714debian. JID-449


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @luhaijiao @rhtyd @ozhanrk sorry I have no testing env running with 4.9/4.10 or master. Although I can rebase the PR against latest master, I cannot test it . It is irresponsible to push a PR without enough testing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @kiwiflyer a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by ozhanrk <gi...@git.apache.org>.
Github user ozhanrk commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Hi, any news on this pr? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151491475
  
    @bhaisaab Thanks for your comments.
    The motivation of CreateSnapshotFromVMSnapshotCmd is, when we create a volume snapshot for a running vm on KVM, it will create a vm snapshot at first then create a volume snapshot from vm snapshot. Hence I think it is useful to create a volume snapshot directly from vm snapshot if it already exists.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou I'm working on fixing the tests. In regards to item 3, Is there actually an API call for this, rather that it just being on a timer thread? Maybe I'm blind, but I'm not seeing one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @kiwiflyer indeed, we need make some changes in ./test/integration/smoke/test_vm_snapshots.py
    
    1. 
    '''
            vm_snapshot = VmSnapshot.create(
                self.apiclient,
                self.virtual_machine.id,
                "false",
                "TestSnapshot",
                "Dsiplay Text"
            )
    '''
    the 4th line should be "true" if self.hypervisor is KVM.
    
    2.
    '''
            self.virtual_machine.stop(self.apiclient)
    
            VmSnapshot.revertToSnapshot(
                self.apiclient,
                list_snapshot_response[0].id)
    
            self.virtual_machine.start(self.apiclient)
    '''
    
    This part should also be changed. as the vm should be running if revert vm snapshot.
    
    3. it seems we need to add a new test to backup snapshot from vm snapshot on kvm.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-152136821
  
    I've done the following testing manually: 
    
    1. create snapshot
        snapshot-1
        snapshot-2
        snapshot-3
        snapshot-4
    
    2. revert snapshot
        snapshot-2
        snapshot-3
    
    3. delete snapshot
        snapshot-2
    
    4. migrate vm fail
        Ubuntu 14.04 -> Ubuntu 12.04
    4. stop vm (check log)
        Ubuntu 14.04
    5. start vm (check log)
        Ubuntu 12.04
    6. migrate vm succeed
        Ubuntu 12.04 -> Ubuntu 14.04
    
    7. create volume snapshot from vm snapshot
        root-snapshot-1, succeed (OK)
        root-snapshot-2, failed (OK, allow max 1 snapshot each volume/vm snapshot)
        data-snapshot-1, succeed (OK)
        data-snapshot-2, failed (OK, allow max 1 snapshot each volume/vm snapshot)
    
    8. checkAccess
    
    9. failed operations
        restore vm
        attach/detach datadisk
        revert volume snapshot



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by serg38 <gi...@git.apache.org>.
Github user serg38 commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @rhtyd @ustcweizhou We need to enable smoke tests for vmsnaphsots for KVM
    in test_vm_snapshots.py 
    if cls.hypervisor.lower() in (KVM.lower(), "hyperv", "lxc"):
                cls.unsupportedHypervisor = True
                return



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @kiwiflyer that's very good. I will rebase it , and add the restriction.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan package


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-162334352
  
    @wido any reason we shouldn't merge this in before 4.7?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-180465442
  
    rebased


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151153457
  
    @ustcweizhou I understand the reasoning and that you want this feature in 4.7, but there is no guarantee it will be fixed afterwards. Once the feature is in there nobody will probably ever fix this.
    
    I can't give a LGTM as long as we execute "virsh" to perform certain tasks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43734035
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,219 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.api.response.VolumeResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from existing vm snapshot.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, since = "4.6.0",
    +        requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "The ID of the disk volume")
    +    private Long volumeId;
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +    private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVolumeId() {
    +        return volumeId;
    +    }
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    +    }
    +
    +    @Override
    +    public long getEntityOwnerId() {
    +
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vmsnapshot by id=" + getVMSnapshotId());
    +        }
    +
    +        Account account = _accountService.getAccount(vmsnapshot.getAccountId());
    +        //Can create templates for enabled projects/accounts only
    +        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
    +            Project project = _projectService.findByProjectAccountId(vmsnapshot.getAccountId());
    +            if (project == null) {
    +                throw new InvalidParameterValueException("Unable to find project by account id=" + account.getUuid());
    +            }
    +            if (project.getState() != Project.State.Active) {
    +                throw new PermissionDeniedException("Can't add resources to the project id=" + project.getUuid() + " in state=" + project.getState() + " as it's no longer active");
    +            }
    +        } else if (account.getState() == Account.State.disabled) {
    +            throw new PermissionDeniedException("The owner of template is disabled: " + account);
    +        }
    +
    +        return vmsnapshot.getAccountId();
    +    }
    +
    +    @Override
    +    public String getEventType() {
    +        return EventTypes.EVENT_SNAPSHOT_CREATE;
    +    }
    +
    +    @Override
    +    public String getEventDescription() {
    +        return "creating snapshot from vm snapshot : " + getVMSnapshotId();
    +    }
    +
    +    @Override
    +    public ApiCommandJobType getInstanceType() {
    +        return ApiCommandJobType.Snapshot;
    +    }
    +
    +    @Override
    +    public void create() throws ResourceAllocationException {
    +        Snapshot snapshot = this._volumeService.allocSnapshotForVm(getVmId(), getVolumeId(), getSnapshotName());
    +        if (snapshot != null) {
    +            this.setEntityId(snapshot.getId());
    +            this.setEntityUuid(snapshot.getUuid());
    +        } else {
    +            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot from vm snapshot");
    +        }
    +    }
    +
    +    @Override
    +    public void execute() {
    +        s_logger.info("VOLSS: CreateSnapshotFromVMSnapshotCmd starts:" + System.currentTimeMillis());
    --- End diff --
    
    What does VOLSS mean? I've never seen this before. Could you also add a bit more about what we are starting to execute?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151094003
  
    @ustcweizhou It's just a matter of sending patches to RedHat and they will accept it. You can also request a new release of the bindings when you need to.
    
    It seems that CloudStack is about the only project who is using the bindings.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-152136784
  
    Guys, I just pushed some new commits to:
    (1) use libvirt-java flags instead of virsh command line
    (2) take snapshot of specific volume from vm snapshot
    (3) add unit test for backupSnapshotFromVMSnapshot
    (4) some UI changes
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @kiwiflyer sorry, the testing operation is restricted to few people to avoid abuse. Currently the infra is busy with 4.9.x related PRs and private usage.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by leprechau <gi...@git.apache.org>.
Github user leprechau commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou Nathan's work can be found in the `vm-snapshot` branch of our fork here: https://github.com/myENA/cloudstack/commits/vm-snapshot


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    squashed and rebased with latest master.
    However, this commit still changes the setup/db/db/schema-4920to41000.sql, not schema-4930to41000.sql which does not exist. @rhtyd 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43734401
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreVMSnapshotCommandWrapper.java ---
    @@ -0,0 +1,103 @@
    +//
    +// 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 java.util.List;
    +import java.util.Map;
    +
    +import org.apache.cloudstack.storage.to.VolumeObjectTO;
    +import org.apache.log4j.Logger;
    +import org.libvirt.Connect;
    +import org.libvirt.Domain;
    +import org.libvirt.LibvirtException;
    +
    +import com.cloud.agent.api.Answer;
    +import com.cloud.agent.api.RestoreVMSnapshotAnswer;
    +import com.cloud.agent.api.RestoreVMSnapshotCommand;
    +import com.cloud.agent.api.VMSnapshotTO;
    +import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
    +import com.cloud.resource.CommandWrapper;
    +import com.cloud.resource.ResourceWrapper;
    +import com.cloud.vm.VirtualMachine;
    +
    +@ResourceWrapper(handles =  RestoreVMSnapshotCommand.class)
    +public final class LibvirtRestoreVMSnapshotCommandWrapper extends CommandWrapper<RestoreVMSnapshotCommand, Answer, LibvirtComputingResource> {
    +
    +    private static final Logger s_logger = Logger.getLogger(LibvirtRestoreVMSnapshotCommandWrapper.class);
    +
    +    @Override
    +    public Answer execute(final RestoreVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    +        String vmName = cmd.getVmName();
    +        List<VolumeObjectTO> listVolumeTo = cmd.getVolumeTOs();
    +        VirtualMachine.PowerState vmState = VirtualMachine.PowerState.PowerOn;
    +
    +        Domain dm = null;
    +        try {
    +            final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
    +            Connect conn = libvirtUtilitiesHelper.getConnection();
    +            dm = libvirtComputingResource.getDomain(conn, vmName);
    +
    +            if (dm == null) {
    +                return new RestoreVMSnapshotAnswer(cmd, false,
    +                        "Restore VM Snapshot Failed due to can not find vm: " + vmName);
    +            }
    +            String xmlDesc = dm.getXMLDesc(0);
    +
    +            List<VMSnapshotTO> snapshots = cmd.getSnapshots();
    +            Map<Long, VMSnapshotTO> snapshotAndParents = cmd.getSnapshotAndParents();
    +            for (VMSnapshotTO snapshot: snapshots) {
    +                VMSnapshotTO parent = snapshotAndParents.get(snapshot.getId());
    +                String parentName = (parent == null)? "": ("  <parent><name>" + parent.getSnapshotName() + "</name></parent>\n");
    +                String vmSnapshotXML = "<domainsnapshot>\n"
    --- End diff --
    
    Can we maybe offload this to a helper which generates the XML? We have this for multiple things. That allows us to Unit Test the XML generation. That is very hard to do when it's inline.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-153336055
  
    @wido any chance libvirt can be upgraded?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43734254
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtDeleteVMSnapshotCommandWrapper.java ---
    @@ -0,0 +1,108 @@
    +//
    +// 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 org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
    +import org.apache.cloudstack.storage.to.VolumeObjectTO;
    +import org.apache.log4j.Logger;
    +import org.libvirt.Connect;
    +import org.libvirt.Domain;
    +import org.libvirt.DomainSnapshot;
    +import org.libvirt.LibvirtException;
    +
    +import com.cloud.agent.api.Answer;
    +import com.cloud.agent.api.DeleteVMSnapshotAnswer;
    +import com.cloud.agent.api.DeleteVMSnapshotCommand;
    +import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
    +import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk;
    +import com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager;
    +import com.cloud.resource.CommandWrapper;
    +import com.cloud.resource.ResourceWrapper;
    +import com.cloud.storage.Volume;
    +import com.cloud.utils.script.Script;
    +
    +@ResourceWrapper(handles =  DeleteVMSnapshotCommand.class)
    +public final class LibvirtDeleteVMSnapshotCommandWrapper extends CommandWrapper<DeleteVMSnapshotCommand, Answer, LibvirtComputingResource> {
    +
    +    private static final Logger s_logger = Logger.getLogger(LibvirtDeleteVMSnapshotCommandWrapper.class);
    +
    +    @Override
    +    public Answer execute(final DeleteVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    +        String vmName = cmd.getVmName();
    +
    +        final KVMStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
    +        Domain dm = null;
    +        try {
    +            final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
    +            Connect conn = libvirtUtilitiesHelper.getConnection();
    +            dm = libvirtComputingResource.getDomain(conn, vmName);
    +
    +            DomainSnapshot snapshot = null;
    +            try {
    +                snapshot = dm.snapshotLookupByName(cmd.getTarget().getSnapshotName());
    +            } catch (LibvirtException e) {
    +                s_logger.warn("Cannot find vmSnapshot with name: " + cmd.getTarget().getSnapshotName());
    +                return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    +            }
    +
    +            snapshot.delete(0); // only remove this snapshot, not children
    +
    +            return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
    +        } catch (LibvirtException e) {
    +            String msg = " Delete VM snapshot failed due to " + e.toString();
    +
    +            if (dm == null) {
    +                s_logger.debug("Can not find vm: " + vmName + ", delete the snapshot using qemu-img");
    --- End diff --
    
    Is this an action to be taken by the admin? The log line seems to suggest it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151516059
  
    @ustcweizhou Great to see that these are there! @borisroman has some pending patches as well. If we submit some patches towards libvir-list@redhat.com we can probably ask for a 0.6.0 release with what we need.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @rhtyd Any chance we could get this PR scheduled for testing? This is an old one and it would be great to get it smoked tested, merged and closed. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43104526
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,197 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +     private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    +    }
    +
    +    @Override
    +    public long getEntityOwnerId() {
    +
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vmsnapshot by id=" + getVMSnapshotId());
    +        }
    +
    +        Account account = _accountService.getAccount(vmsnapshot.getAccountId());
    +        //Can create templates for enabled projects/accounts only
    +        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
    +            Project project = _projectService.findByProjectAccountId(vmsnapshot.getAccountId());
    +            if (project.getState() != Project.State.Active) {
    +                throw new PermissionDeniedException("Can't add resources to the project id=" + project.getId() + " in state=" + project.getState() + " as it's no longer active");
    --- End diff --
    
    use Uuid in the thrown exception?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-158615300
  
    Hi @wido can you review this again please? Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43104473
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,197 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +     private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    --- End diff --
    
    Possibly use a final string from ApiConstants?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-216200365
  
    @ustcweizhou please squash changes into one, rebase against master and push -f, and update on status of your PR, thanks
    
    This looks like a interesting feature we should have :) thanks
    
    tag:needlove


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-162565931
  
    Run the tests again. LGTM based on these tests:
    
    ```
    nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=true \
    component/test_vpc_redundant.py \
    component/test_routers_iptables_default_policy.py \
    component/test_routers_network_ops.py \
    component/test_vpc_router_nics.py \
    smoke/test_loadbalance.py \
    smoke/test_internal_lb.py \
    smoke/test_ssvm.py \
    smoke/test_network.py
    
    ```
    
    Result:
    
    ```
    Test iptables default INPUT/FORWARD policies on VPC router ... === TestName: test_01_single_VPC_iptables_policies | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_01_isolate_network_FW_PF_default_routes_egress_true | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_02_isolate_network_FW_PF_default_routes_egress_false | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test nics after destroy ... === TestName: test_01_VPC_nics_after_destroy | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test default routes ... === TestName: test_02_VPC_default_routes | Status : SUCCESS ===
    ok
    Check the password file in the Router VM ... === TestName: test_isolate_network_password_server | Status : SUCCESS ===
    ok
    Check that the /etc/dhcphosts.txt doesn't contain duplicate IPs ... === TestName: test_router_dhcphosts | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===
    ok
    Test for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===
    ok
    Test to verify access to loadbalancer haproxy admin stats page ... === TestName: test02_internallb_haproxy_stats_on_all_interfaces | Status : SUCCESS ===
    ok
    Test create, assign, remove of an Internal LB with roundrobin http traffic to 3 vm's ... === TestName: test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | Status : SUCCESS ===
    ok
    Test SSVM Internals ... === TestName: test_03_ssvm_internals | Status : SUCCESS ===
    ok
    Test CPVM Internals ... === TestName: test_04_cpvm_internals | Status : SUCCESS ===
    ok
    Test stop SSVM ... === TestName: test_05_stop_ssvm | Status : SUCCESS ===
    ok
    Test stop CPVM ... === TestName: test_06_stop_cpvm | Status : SUCCESS ===
    ok
    Test reboot SSVM ... === TestName: test_07_reboot_ssvm | Status : SUCCESS ===
    ok
    Test reboot CPVM ... === TestName: test_08_reboot_cpvm | Status : SUCCESS ===
    ok
    Test destroy SSVM ... === TestName: test_09_destroy_ssvm | Status : SUCCESS ===
    ok
    Test destroy CPVM ... === TestName: test_10_destroy_cpvm | Status : SUCCESS ===
    ok
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    Test for port forwarding on source NAT ... === TestName: test_01_port_fwd_on_src_nat | Status : SUCCESS ===
    ok
    Test for port forwarding on non source NAT ... === TestName: test_02_port_fwd_on_non_src_nat | Status : SUCCESS ===
    ok
    Test for reboot router ... === TestName: test_reboot_router | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_1_static_nat_rule | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_2_nat_rule | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 33 tests in 16765.438s
    
    OK
    ```
    
    
    And:
    
    ```
    nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=false \
    smoke/test_routers.py \
    smoke/test_network_acl.py \
    smoke/test_privategw_acl.py \
    smoke/test_reset_vm_on_reboot.py \
    smoke/test_vm_life_cycle.py \
    smoke/test_vpc_vpn.py \
    smoke/test_service_offerings.py \
    component/test_vpc_offerings.py \
    component/test_vpc_routers.py
    ```
    
    Result:
    
    ```
    Test router internal advanced zone ... === TestName: test_02_router_internal_adv | Status : SUCCESS ===
    ok
    Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS ===
    ok
    Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS ===
    ok
    Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS ===
    ok
    Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS ===
    ok
    Test start router ... === TestName: test_08_start_router | Status : SUCCESS ===
    ok
    Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS ===
    ok
    test_privategw_acl (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_privategw_acl | Status : SUCCESS ===
    ok
    Test reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS ===
    ok
    Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===
    ok
    Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
    ok
    Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
    ok
    Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
    ok
    Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
    ok
    Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
    ok
    Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
    ok
    Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
    ok
    Test migrate VM ... === TestName: test_08_migrate_vm | Status : SUCCESS ===
    ok
    Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
    ok
    Test to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS ===
    ok
    Test to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS ===
    ok
    Test to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS ===
    ok
    Test for delete account ... === TestName: test_delete_account | Status : SUCCESS ===
    ok
    Test for Associate/Disassociate public IP address for admin account ... === TestName: test_public_ip_admin_account | Status : SUCCESS ===
    ok
    Test for Associate/Disassociate public IP address for user account ... === TestName: test_public_ip_user_account | Status : SUCCESS ===
    ok
    Test for release public IP address ... === TestName: test_releaseIP | Status : SUCCESS ===
    ok
    Test create VPC offering ... === TestName: test_01_create_vpc_offering | Status : SUCCESS ===
    ok
    Test VPC offering without load balancing service ... === TestName: test_03_vpc_off_without_lb | Status : SUCCESS ===
    ok
    Test VPC offering without static NAT service ... === TestName: test_04_vpc_off_without_static_nat | Status : SUCCESS ===
    ok
    Test VPC offering without port forwarding service ... === TestName: test_05_vpc_off_without_pf | Status : SUCCESS ===
    ok
    Test VPC offering with invalid services ... === TestName: test_06_vpc_off_invalid_services | Status : SUCCESS ===
    ok
    Test update VPC offering ... === TestName: test_07_update_vpc_off | Status : SUCCESS ===
    ok
    Test list VPC offering ... === TestName: test_08_list_vpc_off | Status : SUCCESS ===
    test_09_create_redundant_vpc_offering (integration.component.test_vpc_offerings.TestVPCOffering) ... === TestName: test_09_create_redundant_vpc_offering | Status : SUCCESS ===
    ok
    Test start/stop of router after addition of one guest network ... === TestName: test_01_start_stop_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test reboot of router after addition of one guest network ... === TestName: test_02_reboot_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS ===
    ok
    Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 42 tests in 8198.297s
    
    OK
    ```
    
    Haven't tested the actual functionality, this just shows you didn't break anything else.
    
    @ustcweizhou can you squash the commits please?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151090163
  
    @wido I agree with you. The ideal solution is to implement the features in libvirt-java.
    At this moment, I do not know how long it will take and when it will be ready.
    The libvirt-java is not updated for a long time, even it lacks of many features. The project looks like a zombie project.
    Considering this, I prefer to use command line at first, and modify it when libvirt-java is ready.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    <b>Trillian test result (tid-773)</b>
    Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
    Total time taken: 38115 seconds
    Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr977-t773-kvm-centos7.zip
    Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
    Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py
    Intermitten failure detected: /marvin/tests/smoke/test_vm_snapshots.py
    Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
    Test completed. 46 look ok, 3 have error(s)
    
    
    Test | Result | Time (s) | Test File
    --- | --- | --- | ---
    test_03_delete_vm_snapshots | `Failure` | 0.01 | test_vm_snapshots.py
    test_02_revert_vm_snapshots | `Failure` | 90.22 | test_vm_snapshots.py
    test_04_rvpc_privategw_static_routes | `Failure` | 391.08 | test_privategw_acl.py
    test_01_create_volume | `Error` | 280.68 | test_volumes.py
    test_01_create_vm_snapshots | `Error` | 156.65 | test_vm_snapshots.py
    test_01_vpc_site2site_vpn | Success | 155.37 | test_vpc_vpn.py
    test_01_vpc_remote_access_vpn | Success | 71.25 | test_vpc_vpn.py
    test_01_redundant_vpc_site2site_vpn | Success | 210.60 | test_vpc_vpn.py
    test_02_VPC_default_routes | Success | 438.68 | test_vpc_router_nics.py
    test_01_VPC_nics_after_destroy | Success | 814.75 | test_vpc_router_nics.py
    test_05_rvpc_multi_tiers | Success | 527.40 | test_vpc_redundant.py
    test_04_rvpc_network_garbage_collector_nics | Success | 1387.31 | test_vpc_redundant.py
    test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | Success | 532.87 | test_vpc_redundant.py
    test_02_redundant_VPC_default_routes | Success | 759.87 | test_vpc_redundant.py
    test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Success | 1273.82 | test_vpc_redundant.py
    test_09_delete_detached_volume | Success | 156.38 | test_volumes.py
    test_08_resize_volume | Success | 156.33 | test_volumes.py
    test_07_resize_fail | Success | 161.42 | test_volumes.py
    test_06_download_detached_volume | Success | 156.41 | test_volumes.py
    test_05_detach_volume | Success | 241.23 | test_volumes.py
    test_04_delete_attached_volume | Success | 151.20 | test_volumes.py
    test_03_download_attached_volume | Success | 156.23 | test_volumes.py
    test_02_attach_volume | Success | 214.67 | test_volumes.py
    test_deploy_vm_multiple | Success | 353.22 | test_vm_life_cycle.py
    test_deploy_vm | Success | 0.03 | test_vm_life_cycle.py
    test_advZoneVirtualRouter | Success | 0.02 | test_vm_life_cycle.py
    test_10_attachAndDetach_iso | Success | 26.58 | test_vm_life_cycle.py
    test_09_expunge_vm | Success | 125.18 | test_vm_life_cycle.py
    test_08_migrate_vm | Success | 86.19 | test_vm_life_cycle.py
    test_07_restore_vm | Success | 0.12 | test_vm_life_cycle.py
    test_06_destroy_vm | Success | 125.95 | test_vm_life_cycle.py
    test_03_reboot_vm | Success | 125.83 | test_vm_life_cycle.py
    test_02_start_vm | Success | 10.17 | test_vm_life_cycle.py
    test_01_stop_vm | Success | 125.82 | test_vm_life_cycle.py
    test_CreateTemplateWithDuplicateName | Success | 80.66 | test_templates.py
    test_08_list_system_templates | Success | 0.03 | test_templates.py
    test_07_list_public_templates | Success | 0.04 | test_templates.py
    test_05_template_permissions | Success | 0.06 | test_templates.py
    test_04_extract_template | Success | 5.13 | test_templates.py
    test_03_delete_template | Success | 5.11 | test_templates.py
    test_02_edit_template | Success | 90.19 | test_templates.py
    test_01_create_template | Success | 80.66 | test_templates.py
    test_10_destroy_cpvm | Success | 191.94 | test_ssvm.py
    test_09_destroy_ssvm | Success | 163.96 | test_ssvm.py
    test_08_reboot_cpvm | Success | 101.35 | test_ssvm.py
    test_07_reboot_ssvm | Success | 103.21 | test_ssvm.py
    test_06_stop_cpvm | Success | 131.75 | test_ssvm.py
    test_05_stop_ssvm | Success | 103.50 | test_ssvm.py
    test_04_cpvm_internals | Success | 0.95 | test_ssvm.py
    test_03_ssvm_internals | Success | 2.90 | test_ssvm.py
    test_02_list_cpvm_vm | Success | 0.14 | test_ssvm.py
    test_01_list_sec_storage_vm | Success | 0.15 | test_ssvm.py
    test_01_snapshot_root_disk | Success | 16.50 | test_snapshots.py
    test_04_change_offering_small | Success | 235.91 | test_service_offerings.py
    test_03_delete_service_offering | Success | 0.04 | test_service_offerings.py
    test_02_edit_service_offering | Success | 0.12 | test_service_offerings.py
    test_01_create_service_offering | Success | 0.13 | test_service_offerings.py
    test_02_sys_template_ready | Success | 0.16 | test_secondary_storage.py
    test_01_sys_vm_start | Success | 0.21 | test_secondary_storage.py
    test_09_reboot_router | Success | 35.35 | test_routers.py
    test_08_start_router | Success | 25.33 | test_routers.py
    test_07_stop_router | Success | 10.22 | test_routers.py
    test_06_router_advanced | Success | 0.08 | test_routers.py
    test_05_router_basic | Success | 0.09 | test_routers.py
    test_04_restart_network_wo_cleanup | Success | 5.62 | test_routers.py
    test_03_restart_network_cleanup | Success | 65.85 | test_routers.py
    test_02_router_internal_adv | Success | 1.42 | test_routers.py
    test_01_router_internal_basic | Success | 0.69 | test_routers.py
    test_router_dns_guestipquery | Success | 76.70 | test_router_dns.py
    test_router_dns_externalipquery | Success | 0.08 | test_router_dns.py
    test_router_dhcphosts | Success | 362.64 | test_router_dhcphosts.py
    test_router_dhcp_opts | Success | 21.48 | test_router_dhcphosts.py
    test_01_updatevolumedetail | Success | 0.07 | test_resource_detail.py
    test_01_reset_vm_on_reboot | Success | 171.19 | test_reset_vm_on_reboot.py
    test_createRegion | Success | 0.04 | test_regions.py
    test_create_pvlan_network | Success | 5.23 | test_pvlan.py
    test_dedicatePublicIpRange | Success | 0.43 | test_public_ip_range.py
    test_03_vpc_privategw_restart_vpc_cleanup | Success | 686.40 | test_privategw_acl.py
    test_02_vpc_privategw_static_routes | Success | 561.17 | test_privategw_acl.py
    test_01_vpc_privategw_acl | Success | 82.20 | test_privategw_acl.py
    test_01_primary_storage_nfs | Success | 35.85 | test_primary_storage.py
    test_createPortablePublicIPRange | Success | 15.19 | test_portable_publicip.py
    test_createPortablePublicIPAcquire | Success | 15.45 | test_portable_publicip.py
    test_isolate_network_password_server | Success | 89.71 | test_password_server.py
    test_UpdateStorageOverProvisioningFactor | Success | 0.13 | test_over_provisioning.py
    test_oobm_zchange_password | Success | 30.64 | test_outofbandmanagement.py
    test_oobm_multiple_mgmt_server_ownership | Success | 16.33 | test_outofbandmanagement.py
    test_oobm_issue_power_status | Success | 10.39 | test_outofbandmanagement.py
    test_oobm_issue_power_soft | Success | 15.34 | test_outofbandmanagement.py
    test_oobm_issue_power_reset | Success | 15.31 | test_outofbandmanagement.py
    test_oobm_issue_power_on | Success | 15.38 | test_outofbandmanagement.py
    test_oobm_issue_power_off | Success | 15.33 | test_outofbandmanagement.py
    test_oobm_issue_power_cycle | Success | 15.33 | test_outofbandmanagement.py
    test_oobm_enabledisable_across_clusterzones | Success | 87.67 | test_outofbandmanagement.py
    test_oobm_enable_feature_valid | Success | 5.17 | test_outofbandmanagement.py
    test_oobm_enable_feature_invalid | Success | 0.09 | test_outofbandmanagement.py
    test_oobm_disable_feature_valid | Success | 5.18 | test_outofbandmanagement.py
    test_oobm_disable_feature_invalid | Success | 0.10 | test_outofbandmanagement.py
    test_oobm_configure_invalid_driver | Success | 0.08 | test_outofbandmanagement.py
    test_oobm_configure_default_driver | Success | 0.07 | test_outofbandmanagement.py
    test_oobm_background_powerstate_sync | Success | 29.44 | test_outofbandmanagement.py
    test_extendPhysicalNetworkVlan | Success | 15.32 | test_non_contigiousvlan.py
    test_01_nic | Success | 540.05 | test_nic.py
    test_releaseIP | Success | 293.32 | test_network.py
    test_reboot_router | Success | 519.11 | test_network.py
    test_public_ip_user_account | Success | 10.27 | test_network.py
    test_public_ip_admin_account | Success | 40.27 | test_network.py
    test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Success | 66.72 | test_network.py
    test_network_rules_acquired_public_ip_2_nat_rule | Success | 61.50 | test_network.py
    test_network_rules_acquired_public_ip_1_static_nat_rule | Success | 123.66 | test_network.py
    test_delete_account | Success | 272.89 | test_network.py
    test_02_port_fwd_on_non_src_nat | Success | 55.64 | test_network.py
    test_01_port_fwd_on_src_nat | Success | 111.75 | test_network.py
    test_nic_secondaryip_add_remove | Success | 207.77 | test_multipleips_per_nic.py
    login_test_saml_user | Success | 19.27 | test_login.py
    test_assign_and_removal_lb | Success | 133.07 | test_loadbalance.py
    test_02_create_lb_rule_non_nat | Success | 186.82 | test_loadbalance.py
    test_01_create_lb_rule_src_nat | Success | 207.38 | test_loadbalance.py
    test_03_list_snapshots | Success | 0.09 | test_list_ids_parameter.py
    test_02_list_templates | Success | 0.04 | test_list_ids_parameter.py
    test_01_list_volumes | Success | 0.03 | test_list_ids_parameter.py
    test_07_list_default_iso | Success | 0.07 | test_iso.py
    test_05_iso_permissions | Success | 0.06 | test_iso.py
    test_04_extract_Iso | Success | 5.14 | test_iso.py
    test_03_delete_iso | Success | 95.22 | test_iso.py
    test_02_edit_iso | Success | 0.06 | test_iso.py
    test_01_create_iso | Success | 21.05 | test_iso.py
    test_04_rvpc_internallb_haproxy_stats_on_all_interfaces | Success | 208.20 | test_internal_lb.py
    test_03_vpc_internallb_haproxy_stats_on_all_interfaces | Success | 143.66 | test_internal_lb.py
    test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | Success | 561.65 | test_internal_lb.py
    test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | Success | 452.02 | test_internal_lb.py
    test_dedicateGuestVlanRange | Success | 10.37 | test_guest_vlan_range.py
    test_UpdateConfigParamWithScope | Success | 0.17 | test_global_settings.py
    test_rolepermission_lifecycle_update | Success | 6.34 | test_dynamicroles.py
    test_rolepermission_lifecycle_list | Success | 6.17 | test_dynamicroles.py
    test_rolepermission_lifecycle_delete | Success | 5.98 | test_dynamicroles.py
    test_rolepermission_lifecycle_create | Success | 6.09 | test_dynamicroles.py
    test_rolepermission_lifecycle_concurrent_updates | Success | 6.08 | test_dynamicroles.py
    test_role_lifecycle_update_role_inuse | Success | 5.97 | test_dynamicroles.py
    test_role_lifecycle_update | Success | 11.05 | test_dynamicroles.py
    test_role_lifecycle_list | Success | 6.02 | test_dynamicroles.py
    test_role_lifecycle_delete | Success | 11.00 | test_dynamicroles.py
    test_role_lifecycle_create | Success | 5.95 | test_dynamicroles.py
    test_role_inuse_deletion | Success | 5.96 | test_dynamicroles.py
    test_role_account_acls_multiple_mgmt_servers | Success | 8.60 | test_dynamicroles.py
    test_role_account_acls | Success | 8.75 | test_dynamicroles.py
    test_default_role_deletion | Success | 6.09 | test_dynamicroles.py
    test_04_create_fat_type_disk_offering | Success | 0.07 | test_disk_offerings.py
    test_03_delete_disk_offering | Success | 0.05 | test_disk_offerings.py
    test_02_edit_disk_offering | Success | 0.07 | test_disk_offerings.py
    test_02_create_sparse_type_disk_offering | Success | 0.08 | test_disk_offerings.py
    test_01_create_disk_offering | Success | 0.11 | test_disk_offerings.py
    test_deployvm_userdispersing | Success | 20.64 | test_deploy_vms_with_varied_deploymentplanners.py
    test_deployvm_userconcentrated | Success | 45.81 | test_deploy_vms_with_varied_deploymentplanners.py
    test_deployvm_firstfit | Success | 65.76 | test_deploy_vms_with_varied_deploymentplanners.py
    test_deployvm_userdata_post | Success | 10.59 | test_deploy_vm_with_userdata.py
    test_deployvm_userdata | Success | 55.79 | test_deploy_vm_with_userdata.py
    test_02_deploy_vm_root_resize | Success | 6.02 | test_deploy_vm_root_resize.py
    test_01_deploy_vm_root_resize | Success | 6.03 | test_deploy_vm_root_resize.py
    test_00_deploy_vm_root_resize | Success | 217.93 | test_deploy_vm_root_resize.py
    test_deploy_vm_from_iso | Success | 212.82 | test_deploy_vm_iso.py
    test_DeployVmAntiAffinityGroup | Success | 50.92 | test_affinity_groups.py
    test_01_test_vm_volume_snapshot | Skipped | 0.00 | test_vm_snapshots.py
    test_06_copy_template | Skipped | 0.00 | test_templates.py
    test_static_role_account_acls | Skipped | 0.02 | test_staticroles.py
    test_11_ss_nfs_version_on_ssvm | Skipped | 0.02 | test_ssvm.py
    test_01_scale_vm | Skipped | 0.00 | test_scale_vm.py
    test_01_primary_storage_iscsi | Skipped | 0.04 | test_primary_storage.py
    test_nested_virtualization_vmware | Skipped | 0.00 | test_nested_virtualization.py
    test_06_copy_iso | Skipped | 0.00 | test_iso.py
    test_deploy_vgpu_enabled_vm | Skipped | 0.03 | test_deploy_vgpu_enabled_vm.py
    test_3d_gpu_support | Skipped | 0.04 | test_deploy_vgpu_enabled_vm.py



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @karuturi please see testing above. This PR now has working tests and is ready for merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou If you rebase it, I'll get it tested. The last time I tested this PR, it was looking really good. The only thing it needed was some restriction so that it returned an error if the primary storage wasn't NFS.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou @kiwiflyer please squash your changes, use the jira id in the commit summary etc first.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @nathanejohnson do you mean the commit 7a2a1c1 ? I can add it into this PR so you do not need to open a new PR.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou can you squash your changes, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43104186
  
    --- Diff: ui/scripts/cloudStack.js ---
    @@ -22,13 +22,13 @@
                 var sections = [];
     
                 if (isAdmin()) {
    -                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "regions", "affinityGroups"];
    +                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "regions", "affinityGroups", "vmsnapshots"];
                 } else if (isDomainAdmin()) {
    -                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects", "configuration", "regions", "affinityGroups"];
    +                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects", "configuration", "regions", "affinityGroups", "vmsnapshots"];
                 } else if (g_userProjectsEnabled) {
    -                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects", "regions", "affinityGroups"];
    +                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects", "regions", "affinityGroups", "vmsnapshots"];
                 } else { //normal user
    -                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "regions", "affinityGroups"];
    +                sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "regions", "affinityGroups", "vmsnapshots"];
    --- End diff --
    
    Add a new section in the storage -> drop down (just like we've volumes and disk snapshots?) to keep consistency; or break apart Storage tab into two tabs: volumes and disk snapshots


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43733925
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,197 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +     private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    --- End diff --
    
    Agree, a String is probably not what we want to shuffle around through the code


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by sateesh-chodapuneedi <gi...@git.apache.org>.
Github user sateesh-chodapuneedi commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151054893
  
    @ustcweizhou 
    I think it's handy to include account access checks for the backup snapshot from vm snapshot.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    VM Snapshot revert was successful.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    ![create_vm](https://cloud.githubusercontent.com/assets/17278194/21755128/fa7e0ce8-d5d3-11e6-8452-7e8ea5282053.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Thanks @ustcweizhou please also meld them into a single commit


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    rebased with latest master


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    added a commit to enable the smoke test test_vm_snapshots.py on KVM.
    thanks @serg38 
    @rhtyd could you please test it again?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151155683
  
    @wido it depends on which is more important for us, more features in cloudstack or removing virsh from cloudstack? we know "virsh" provides more features than libvirt-java.
    If libvirt-java is owned by apache cloudstack , like cloudmonkey, I vote the second option. Otherwise, I vote the first option.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by sateesh-chodapuneedi <gi...@git.apache.org>.
Github user sateesh-chodapuneedi commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42966399
  
    --- Diff: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java ---
    @@ -1702,6 +1705,18 @@ protected boolean checkVmOnHost(final VirtualMachine vm, final long hostId) thro
                 }
             }
     
    +        UserVmVO userVm = _userVmDao.findById(vm.getId());
    +        if (userVm != null) {
    +            List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vm.getId());
    +            RestoreVMSnapshotCommand command = _vmSnapshotMgr.createRestoreCommand(userVm, vmSnapshots);
    +            if (command != null) {
    +                RestoreVMSnapshotAnswer restoreVMSnapshotAnswer = (RestoreVMSnapshotAnswer) _agentMgr.send(hostId, command);
    +                if (restoreVMSnapshotAnswer == null || !restoreVMSnapshotAnswer.getResult()) {
    +                    s_logger.warn("Unable to restore the vm snapshot from image file after migration to the VM: " + restoreVMSnapshotAnswer.getDetails());
    --- End diff --
    
    What is the migration (type?) mentioned in this log message? Can you please elaborate this a bit?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by nathanejohnson <gi...@git.apache.org>.
Github user nathanejohnson commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    As an update, I've been battling technical difficulties getting my bubble environment back operational again, and I am about to go out of town for a bit so I have not had a chance to properly test this PR.  I'll be back in town next Thursday, hopefully I'll find a bit of time between then and now to work on it but otherwise I will probably not be able to get back to this until late next week.  Assuming someone else hasn't had a chance to tackle it by then.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    ![create_vm1_result](https://cloud.githubusercontent.com/assets/17278194/21755136/34e832dc-d5d4-11e6-8702-05b249f2fd04.png)
    
    ![create_vm2_result](https://cloud.githubusercontent.com/assets/17278194/21755137/37eee5ca-d5d4-11e6-8fe2-dc73c0660fe1.png)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151490894
  
    @wido @DaanHoogland I just checked the libvirt-java, the snapshot operations with flags already exist in 0.5.1 , which did not exist in 0.4.9. I will modify the code and test it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151160292
  
    @ustcweizhou I want a stable master branch which works all the time. Executing binaries is not reliable as we can't do proper exception handling.
    
    Also, virsh doesn't read out the hypervisor URI we might configure in agent.properties, thus it might break things in the future.
    
    How much I like the feature, I'm in favor or stabilizing CloudStack instead of being mainly feature driven.
    
    The fact that libvirt-java isn't a ASF project shouldn't matter, multiple projects we consume aren't under our control.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Packaging result: \u2714centos6 \u2714centos7 \u2714debian. JID-407


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    VMsnapshot was successful with running VM as seen above. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-152302260
  
    @wido @sateesh-chodapuneedi @bhaisaab can you please see if you are satisfied with the present state (with respect to your comments)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-192928190
  
    ![unexpected_exception](https://cloud.githubusercontent.com/assets/17278194/13555514/d00ca0e4-e387-11e5-9274-7b8605489484.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by sateesh-chodapuneedi <gi...@git.apache.org>.
Github user sateesh-chodapuneedi commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42965130
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,191 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +     private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    +    }
    +
    +    @Override
    +    public long getEntityOwnerId() {
    +
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vmsnapshot by id=" + getVMSnapshotId());
    +        }
    +
    +        Account account = _accountService.getAccount(vmsnapshot.getAccountId());
    +        //Can create templates for enabled projects/accounts only
    +        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
    +            Project project = _projectService.findByProjectAccountId(vmsnapshot.getAccountId());
    +            if (project.getState() != Project.State.Active) {
    +                throw new PermissionDeniedException("Can't add resources to the project id=" + project.getId() + " in state=" + project.getState() + " as it's no longer active");
    +            }
    +        } else if (account.getState() == Account.State.disabled) {
    +            throw new PermissionDeniedException("The owner of template is disabled: " + account);
    +        }
    +
    +        return vmsnapshot.getAccountId();
    +    }
    +
    +    @Override
    +    public String getEventType() {
    +        return EventTypes.EVENT_SNAPSHOT_CREATE;
    +    }
    +
    +    @Override
    +    public String getEventDescription() {
    +        return "creating snapshot from vm snapshot : " + getVMSnapshotId();
    +    }
    +
    +    @Override
    +    public ApiCommandJobType getInstanceType() {
    +        return ApiCommandJobType.Snapshot;
    +    }
    +
    +    @Override
    +    public void create() throws ResourceAllocationException {
    +        Snapshot snapshot = this._volumeService.allocSnapshotForVm(getVmId(), getSnapshotName());
    +        if (snapshot != null) {
    +            this.setEntityId(snapshot.getId());
    +            this.setEntityUuid(snapshot.getUuid());
    +        } else {
    +            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot from vm snapshot");
    +        }
    +    }
    +
    +    @Override
    +    public void execute() {
    +        s_logger.info("VOLSS: createSnapshotCmd starts:" + System.currentTimeMillis());
    +        CallContext.current().setEventDetails("Vm Snapshot Id: "+getVMSnapshotId());
    +        Snapshot snapshot;
    +        try {
    +            snapshot = _snapshotService.backupSnapshotFromVmSnapshot(getEntityId(), getVmId(), getVMSnapshotId());
    --- End diff --
    
    @ustcweizhou Thanks for the patch.
    
    getVmId() doesn't check if the specified VM snapshot is valid. This may cause NullPointerException, could be avoided.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151864368
  
    @remibergsma no problem. I am working on some changes , I will push the commits with rebase tomorrow.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-192928201
  
    ![snapshot_list](https://cloud.githubusercontent.com/assets/17278194/13555519/dab4ae2e-e387-11e5-9b51-dfe6300b63f5.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43104400
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,197 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +     private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    --- End diff --
    
    What's the purpose or use of this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Great job all. I think this one is ready.
    @ustcweizhou @nathanejohnson 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-162234338
  
    Yes we do, it might not be the final solution as per the discussion above but it is an improvement.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151804289
  
    @ustcweizhou Can you please rebase against current master (and resolve conflict)? Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43104502
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,197 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +     private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    +    }
    +
    +    @Override
    +    public long getEntityOwnerId() {
    +
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vmsnapshot by id=" + getVMSnapshotId());
    --- End diff --
    
    use Uuid?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43104351
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,191 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    --- End diff --
    
    Add from version in the @APICommand 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-175675613
  
    @ustcweizhou please rebase against latest and send for a re-review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42975057
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---
    @@ -3388,4 +3419,83 @@ public String mapRbdDevice(final KVMPhysicalDisk disk){
             }
             return device;
         }
    +
    +    public List<Ternary<String, Boolean, String>> cleanVMSnapshotMetadata(Domain dm) throws LibvirtException {
    +        s_logger.debug("Cleaning the metadata of vm snapshots of vm " + dm.getName());
    +        List<Ternary<String, Boolean, String>> vmsnapshots = new ArrayList<Ternary<String, Boolean, String>>();
    +        String currentSnapshotName = null;
    +        try {
    +            DomainSnapshot snapshotCurrent = dm.snapshotCurrent();
    +            String snapshotXML = snapshotCurrent.getXMLDesc();
    +            snapshotCurrent.free();
    +            DocumentBuilder builder;
    +            try {
    +                builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    +
    +                InputSource is = new InputSource();
    +                is.setCharacterStream(new StringReader(snapshotXML));
    +                Document doc = builder.parse(is);
    +                Element rootElement = doc.getDocumentElement();
    +
    +                currentSnapshotName = getTagValue("name", rootElement);
    +            } catch (ParserConfigurationException e) {
    +                s_logger.debug(e.toString());
    +            } catch (SAXException e) {
    +                s_logger.debug(e.toString());
    +            } catch (IOException e) {
    +                s_logger.debug(e.toString());
    +            }
    +        } catch (LibvirtException e) {
    +            s_logger.debug("Fail to get the current vm snapshot for vm: " + dm.getName() + ", continue");
    +        }
    +        for (String snapshotName: dm.snapshotListNames()) {
    +            DomainSnapshot snapshot = dm.snapshotLookupByName(snapshotName);
    +            Boolean isCurrent = (currentSnapshotName != null && currentSnapshotName.equals(snapshotName)) ? true: false;
    +            vmsnapshots.add(new Ternary<String, Boolean, String>(snapshotName, isCurrent, snapshot.getXMLDesc()));
    +            snapshot.free();
    +        }
    +        for (String snapshotName: dm.snapshotListNames()) {
    +            String cmdvirsh = "virsh snapshot-delete --metadata " + dm.getName() + " " + snapshotName;
    +            int cmdout = Script.runSimpleBashScriptForExitValue(cmdvirsh);
    +            if (cmdout != 0) {
    +                s_logger.debug("Fail to delete the metadata of vm snapshot: " + snapshotName);
    +            }
    +        }
    +        return vmsnapshots;
    +    }
    +
    +    private static String getTagValue(String tag, Element eElement) {
    +        NodeList nlList = eElement.getElementsByTagName(tag).item(0).getChildNodes();
    +        Node nValue = nlList.item(0);
    +
    +        return nValue.getNodeValue();
    +    }
    +
    +    public void restoreVMSnapshotMetadata(String vmName, List<Ternary<String, Boolean, String>> vmsnapshots) {
    +        s_logger.debug("Restoring the metadata of vm snapshots of vm " + vmName);
    +        for (Ternary<String, Boolean, String> vmsnapshot: vmsnapshots) {
    +            s_logger.debug("Restoring vm snapshot " + vmsnapshot.first() + " on " + vmName + " with XML:\n " + vmsnapshot.third());
    +            File tmpCfgFile = null;
    +            try {
    +                tmpCfgFile = File.createTempFile(vmName + "-", "cfg");
    +                final PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(tmpCfgFile)));
    +                out.println(vmsnapshot.third());
    +                out.close();
    +                String cfgFilePath = tmpCfgFile.getAbsolutePath();
    +                String cmdvirsh = "virsh snapshot-create --redefine " + vmName + (vmsnapshot.second()? " --current ":" ") + cfgFilePath;
    +                int cmdout = Script.runSimpleBashScriptForExitValue(cmdvirsh);
    --- End diff --
    
    Same goes for this, see my comment above about libvirt-java.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-153369869
  
    @DaanHoogland I meant the version of libvirt running on the HV which is out of our control.
    
    I still vote for no longer supporting Ubuntu 12.04 for that reason for example.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151447134
  
    @ustcweizhou Can you add some unit tests for the new methods and classes, thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implem...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/977


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    I've tested the latest master with this PR with the following environment and setup:
    Advanced KVM zone
    NFS primary and secondary storage
    All tests were completed with CloudMonkey
    
    Please see following screenshots for command detail and results.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Packaging result: \u2714centos6 \u2714centos7 \u2714debian. JID-428


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by karuturi <gi...@git.apache.org>.
Github user karuturi commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    great effort from everyone in terms of code, testing and discussion. Overall, all the comments are addressed and has test runs. I am merging this now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Packaging result: \u2714centos6 \u2714centos7 \u2714debian. JID-450


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #977: [4.9] CLOUDSTACK-8746: VM Snapshotting impleme...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r93811944
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,219 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.api.response.VolumeResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from existing vm snapshot.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, since = "4.6.0",
    --- End diff --
    
    Add since field?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151792666
  
    FYI,run a set of tests that on this branch (which I rebased myself first), just to make sure no existing functionality is broken by this PR. Looking good!
    
    ```
    nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=true \
    component/test_vpc_redundant.py \
    component/test_routers_iptables_default_policy.py \
    component/test_routers_network_ops.py \
    component/test_vpc_router_nics.py \
    smoke/test_loadbalance.py \
    smoke/test_internal_lb.py \
    smoke/test_ssvm.py \
    smoke/test_network.py
    
    ```
    
    Result:
    
    ```
    Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Status : SUCCESS ===
    ok
    Create a redundant VPC with two networks with two VMs in each network and check default routes ... === TestName: test_02_redundant_VPC_default_routes | Status : SUCCESS ===
    ok
    Test iptables default INPUT/FORWARD policy on RouterVM ... === TestName: test_02_routervm_iptables_policies | Status : SUCCESS ===
    ok
    Test iptables default INPUT/FORWARD policies on VPC router ... === TestName: test_01_single_VPC_iptables_policies | Status : SUCCESS ===
    ok
    Stop existing router, add a PF rule and check we can access the VM ... === TestName: test_isolate_network_FW_PF_default_routes | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_RVR_Network_FW_PF_SSH_default_routes | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test nics after destroy ... === TestName: test_01_VPC_nics_after_destroy | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test default routes ... === TestName: test_02_VPC_default_routes | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===
    ok
    Test for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===
    ok
    Test to verify access to loadbalancer haproxy admin stats page ... === TestName: test02_internallb_haproxy_stats_on_all_interfaces | Status : SUCCESS ===
    ok
    Test create, assign, remove of an Internal LB with roundrobin http traffic to 3 vm's ... === TestName: test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | Status : SUCCESS ===
    ok
    Test SSVM Internals ... === TestName: test_03_ssvm_internals | Status : SUCCESS ===
    ok
    Test CPVM Internals ... === TestName: test_04_cpvm_internals | Status : SUCCESS ===
    ok
    Test stop SSVM ... === TestName: test_05_stop_ssvm | Status : SUCCESS ===
    ok
    Test stop CPVM ... === TestName: test_06_stop_cpvm | Status : SUCCESS ===
    ok
    Test reboot SSVM ... === TestName: test_07_reboot_ssvm | Status : SUCCESS ===
    ok
    Test reboot CPVM ... === TestName: test_08_reboot_cpvm | Status : SUCCESS ===
    ok
    Test destroy SSVM ... === TestName: test_09_destroy_ssvm | Status : SUCCESS ===
    ok
    Test destroy CPVM ... === TestName: test_10_destroy_cpvm | Status : SUCCESS ===
    ok
    Test for port forwarding on source NAT ... === TestName: test_01_port_fwd_on_src_nat | Status : SUCCESS ===
    ok
    Test for port forwarding on non source NAT ... === TestName: test_02_port_fwd_on_non_src_nat | Status : SUCCESS ===
    ok
    Test for reboot router ... === TestName: test_reboot_router | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_1_static_nat_rule | Status : FAILED ===
    FAIL
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_2_nat_rule | Status : FAILED ===
    FAIL
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Status : FAILED ===
    FAIL
    ```
    
    The 3 errors at the bottom are due to CLOUDSTACK-8991 and unrelated to this PR.
    
    And:
    
    ```
    nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=false \
    smoke/test_routers.py \
    smoke/test_network_acl.py \
    smoke/test_privategw_acl.py \
    smoke/test_reset_vm_on_reboot.py \
    smoke/test_vm_life_cycle.py \
    smoke/test_vpc_vpn.py \
    smoke/test_service_offerings.py \
    component/test_vpc_offerings.py \
    component/test_vpc_routers.py
    ```
    
    Result:
    
    ```
    Test router internal advanced zone ... === TestName: test_02_router_internal_adv | Status : SUCCESS ===
    ok
    Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS ===
    ok
    Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS ===
    ok
    Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS ===
    ok
    Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS ===
    ok
    Test start router ... === TestName: test_08_start_router | Status : SUCCESS ===
    ok
    Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS ===
    ok
    test_privategw_acl (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_privategw_acl | Status : SUCCESS ===
    ok
    Test reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS ===
    ok
    Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===
    ok
    Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
    ok
    Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
    ok
    Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
    ok
    Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
    ok
    Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
    ok
    Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
    ok
    Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
    ok
    Test migrate VM ... === TestName: test_08_migrate_vm | Status : SUCCESS ===
    ok
    Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
    ok
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    Test to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS ===
    ok
    Test to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS ===
    ok
    Test to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS ===
    ok
    Test for delete account ... === TestName: test_delete_account | Status : SUCCESS ===
    ok
    Test for Associate/Disassociate public IP address for admin account ... === TestName: test_public_ip_admin_account | Status : SUCCESS ===
    ok
    Test for Associate/Disassociate public IP address for user account ... === TestName: test_public_ip_user_account | Status : SUCCESS ===
    ok
    Test for release public IP address ... === TestName: test_releaseIP | Status : SUCCESS ===
    ok
    Test create VPC offering ... === TestName: test_01_create_vpc_offering | Status : SUCCESS ===
    ok
    Test VPC offering without load balancing service ... === TestName: test_03_vpc_off_without_lb | Status : SUCCESS ===
    ok
    Test VPC offering without static NAT service ... === TestName: test_04_vpc_off_without_static_nat | Status : SUCCESS ===
    ok
    Test VPC offering without port forwarding service ... === TestName: test_05_vpc_off_without_pf | Status : SUCCESS ===
    ok
    Test VPC offering with invalid services ... === TestName: test_06_vpc_off_invalid_services | Status : SUCCESS ===
    ok
    Test update VPC offering ... === TestName: test_07_update_vpc_off | Status : SUCCESS ===
    ok
    Test list VPC offering ... === TestName: test_08_list_vpc_off | Status : SUCCESS ===
    ok
    test_09_create_redundant_vpc_offering (integration.component.test_vpc_offerings.TestVPCOffering) ... === TestName: test_09_create_redundant_vpc_offering | Status : SUCCESS ===
    ok
    Test start/stop of router after addition of one guest network ... === TestName: test_01_start_stop_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test reboot of router after addition of one guest network ... === TestName: test_02_reboot_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS ===
    ok
    Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 44 tests in 9010.110s
    
    OK
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by remibergsma <gi...@git.apache.org>.
Github user remibergsma commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-152569385
  
    FYI: Results of tests that I run on this branch:
    
    ```
    nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=true \
    component/test_vpc_redundant.py \
    component/test_routers_iptables_default_policy.py \
    component/test_routers_network_ops.py \
    component/test_vpc_router_nics.py \
    smoke/test_loadbalance.py \
    smoke/test_internal_lb.py \
    smoke/test_ssvm.py \
    smoke/test_network.py
    
    ```
    
    Result:
    
    ```
    Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Status : SUCCESS ===
    ok
    Create a redundant VPC with two networks with two VMs in each network and check default routes ... === TestName: test_02_redundant_VPC_default_routes | Status : SUCCESS ===
    ok
    Test iptables default INPUT/FORWARD policy on RouterVM ... === TestName: test_02_routervm_iptables_policies | Status : SUCCESS ===
    ok
    Test iptables default INPUT/FORWARD policies on VPC router ... === TestName: test_01_single_VPC_iptables_policies | Status : SUCCESS ===
    ok
    Stop existing router, add a PF rule and check we can access the VM ... === TestName: test_isolate_network_FW_PF_default_routes | Status : SUCCESS ===
    ok
    Test redundant router internals ... === TestName: test_RVR_Network_FW_PF_SSH_default_routes | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test nics after destroy ... === TestName: test_01_VPC_nics_after_destroy | Status : SUCCESS ===
    ok
    Create a VPC with two networks with one VM in each network and test default routes ... === TestName: test_02_VPC_default_routes | Status : SUCCESS ===
    ok
    Check the password file in the Router VM ... === TestName: test_isolate_network_password_server | Status : SUCCESS ===
    ok
    Check that the /etc/dhcphosts.txt doesn't contain duplicate IPs ... === TestName: test_router_dhcphosts | Status : FAILED ===
    FAIL
    Test to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===
    ok
    Test to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===
    ok
    Test for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===
    ok
    Test to verify access to loadbalancer haproxy admin stats page ... === TestName: test02_internallb_haproxy_stats_on_all_interfaces | Status : SUCCESS ===
    ok
    Test create, assign, remove of an Internal LB with roundrobin http traffic to 3 vm's ... === TestName: test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | Status : SUCCESS ===
    ok
    Test SSVM Internals ... === TestName: test_03_ssvm_internals | Status : SUCCESS ===
    ok
    Test CPVM Internals ... === TestName: test_04_cpvm_internals | Status : SUCCESS ===
    ok
    Test stop SSVM ... === TestName: test_05_stop_ssvm | Status : SUCCESS ===
    ok
    Test stop CPVM ... === TestName: test_06_stop_cpvm | Status : SUCCESS ===
    ok
    Test reboot SSVM ... === TestName: test_07_reboot_ssvm | Status : SUCCESS ===
    ok
    Test reboot CPVM ... === TestName: test_08_reboot_cpvm | Status : SUCCESS ===
    ok
    Test destroy SSVM ... === TestName: test_09_destroy_ssvm | Status : SUCCESS ===
    ok
    Test destroy CPVM ... === TestName: test_10_destroy_cpvm | Status : SUCCESS ===
    ok
    Test for port forwarding on source NAT ... === TestName: test_01_port_fwd_on_src_nat | Status : SUCCESS ===
    ok
    Test for port forwarding on non source NAT ... === TestName: test_02_port_fwd_on_non_src_nat | Status : SUCCESS ===
    ok
    Test for reboot router ... === TestName: test_reboot_router | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_1_static_nat_rule | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_2_nat_rule | Status : SUCCESS ===
    ok
    Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Status : SUCCESS ===
    ok
    ----------------------------------------------------------------------
    Ran 29 tests in 12630.025s
    
    FAILED (failures=1)
    
    ```
    
    The test that failed is `test_router_dhcphosts`, as it was recently added/fixed this is probably an issue not related to this PR.
    
    
    And:
    
    ```
    nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=false \
    smoke/test_routers.py \
    smoke/test_network_acl.py \
    smoke/test_privategw_acl.py \
    smoke/test_reset_vm_on_reboot.py \
    smoke/test_vm_life_cycle.py \
    smoke/test_vpc_vpn.py \
    smoke/test_service_offerings.py \
    component/test_vpc_offerings.py \
    component/test_vpc_routers.py
    ```
    
    Result:
    
    ```
    Test router internal advanced zone ... === TestName: test_02_router_internal_adv | Status : SUCCESS ===
    ok
    Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS ===
    ok
    Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS ===
    ok
    Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS ===
    ok
    Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS ===
    ok
    Test start router ... === TestName: test_08_start_router | Status : SUCCESS ===
    ok
    Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS ===
    ok
    test_privategw_acl (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_privategw_acl | Status : SUCCESS ===
    ok
    Test reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS ===
    ok
    Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===
    ok
    Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
    ok
    Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
    ok
    Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
    ok
    Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
    ok
    Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
    ok
    Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
    ok
    Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
    ok
    Test migrate VM ... === TestName: test_08_migrate_vm | Status : SUCCESS ===
    ok
    Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
    ok
    Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
    ok
    Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
    ok
    Test to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS ===
    ok
    Test to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS ===
    ok
    Test to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS ===
    ok
    Test for delete account ... === TestName: test_delete_account | Status : SUCCESS ===
    ok
    Test for Associate/Disassociate public IP address for admin account ... === TestName: test_public_ip_admin_account | Status : SUCCESS ===
    ok
    Test for Associate/Disassociate public IP address for user account ... === TestName: test_public_ip_user_account | Status : SUCCESS ===
    ok
    Test for release public IP address ... === TestName: test_releaseIP | Status : SUCCESS ===
    ok
    Test create VPC offering ... === TestName: test_01_create_vpc_offering | Status : SUCCESS ===
    ok
    Test VPC offering without load balancing service ... === TestName: test_03_vpc_off_without_lb | Status : SUCCESS ===
    ok
    Test VPC offering without static NAT service ... === TestName: test_04_vpc_off_without_static_nat | Status : SUCCESS ===
    ok
    Test VPC offering without port forwarding service ... === TestName: test_05_vpc_off_without_pf | Status : SUCCESS ===
    ok
    Test VPC offering with invalid services ... === TestName: test_06_vpc_off_invalid_services | Status : SUCCESS ===
    ok
    Test update VPC offering ... === TestName: test_07_update_vpc_off | Status : SUCCESS ===
    ok
    Test list VPC offering ... === TestName: test_08_list_vpc_off | Status : SUCCESS ===
    ok
    test_09_create_redundant_vpc_offering (integration.component.test_vpc_offerings.TestVPCOffering) ... === TestName: test_09_create_redundant_vpc_offering | Status : SUCCESS ===
    ok
    Test start/stop of router after addition of one guest network ... === TestName: test_01_start_stop_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test reboot of router after addition of one guest network ... === TestName: test_02_reboot_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS ===
    ok
    Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS ===
    ok
    Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS ===
    ok
    Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 44 tests in 8959.677s
    
    OK
    
    ```
    
    These test do not cover your change, all they do is show you didn't break them. Someone else needs to review the code.
    
    When you guys are done, ping me again and I'll schedule another test run.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r43734583
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,219 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.api.response.VolumeResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from existing vm snapshot.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, since = "4.6.0",
    +        requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
    +public class CreateSnapshotFromVMSnapshotCmd extends BaseAsyncCreateCmd {
    +    public static final Logger s_logger = Logger.getLogger(CreateSnapshotFromVMSnapshotCmd.class.getName());
    +    private static final String s_name = "createsnapshotfromvmsnapshotresponse";
    +
    +    // ///////////////////////////////////////////////////
    +    // ////////////// API parameters /////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "The ID of the disk volume")
    +    private Long volumeId;
    +
    +    @Parameter(name=ApiConstants.VM_SNAPSHOT_ID, type=CommandType.UUID, entityType=VMSnapshotResponse.class,
    +            required=true, description="The ID of the VM snapshot")
    +    private Long vmSnapshotId;
    +
    +    @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the snapshot")
    +    private String snapshotName;
    +
    +    private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject;
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////////// Accessors ///////////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    public Long getVolumeId() {
    +        return volumeId;
    +    }
    +
    +    public Long getVMSnapshotId() {
    +        return vmSnapshotId;
    +    }
    +
    +    public String getSnapshotName() {
    +        return snapshotName;
    +    }
    +
    +    private Long getVmId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm == null) {
    +            throw new InvalidParameterValueException("Unable to find vm by vm snapshot id=" + getVMSnapshotId());
    +        }
    +        return vm.getId();
    +    }
    +    private Long getHostId() {
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vm snapshot by id=" + getVMSnapshotId());
    +        }
    +        UserVm vm = _entityMgr.findById(UserVm.class, vmsnapshot.getVmId());
    +        if (vm != null) {
    +            if(vm.getHostId() != null) {
    +                return vm.getHostId();
    +            } else if(vm.getLastHostId() != null) {
    +                return vm.getLastHostId();
    +            }
    +        }
    +        return null;
    +    }
    +
    +
    +    // ///////////////////////////////////////////////////
    +    // ///////////// API Implementation///////////////////
    +    // ///////////////////////////////////////////////////
    +
    +    @Override
    +    public String getCommandName() {
    +        return s_name;
    +    }
    +
    +    public static String getResultObjectName() {
    +        return "snapshot";
    +    }
    +
    +    @Override
    +    public long getEntityOwnerId() {
    +
    +        VMSnapshot vmsnapshot = _entityMgr.findById(VMSnapshot.class, getVMSnapshotId());
    +        if (vmsnapshot == null) {
    +            throw new InvalidParameterValueException("Unable to find vmsnapshot by id=" + getVMSnapshotId());
    +        }
    +
    +        Account account = _accountService.getAccount(vmsnapshot.getAccountId());
    +        //Can create templates for enabled projects/accounts only
    +        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
    +            Project project = _projectService.findByProjectAccountId(vmsnapshot.getAccountId());
    +            if (project == null) {
    +                throw new InvalidParameterValueException("Unable to find project by account id=" + account.getUuid());
    +            }
    +            if (project.getState() != Project.State.Active) {
    +                throw new PermissionDeniedException("Can't add resources to the project id=" + project.getUuid() + " in state=" + project.getState() + " as it's no longer active");
    +            }
    +        } else if (account.getState() == Account.State.disabled) {
    +            throw new PermissionDeniedException("The owner of template is disabled: " + account);
    +        }
    +
    +        return vmsnapshot.getAccountId();
    +    }
    +
    +    @Override
    +    public String getEventType() {
    +        return EventTypes.EVENT_SNAPSHOT_CREATE;
    +    }
    +
    +    @Override
    +    public String getEventDescription() {
    +        return "creating snapshot from vm snapshot : " + getVMSnapshotId();
    +    }
    +
    +    @Override
    +    public ApiCommandJobType getInstanceType() {
    +        return ApiCommandJobType.Snapshot;
    +    }
    +
    +    @Override
    +    public void create() throws ResourceAllocationException {
    +        Snapshot snapshot = this._volumeService.allocSnapshotForVm(getVmId(), getVolumeId(), getSnapshotName());
    +        if (snapshot != null) {
    +            this.setEntityId(snapshot.getId());
    +            this.setEntityUuid(snapshot.getUuid());
    +        } else {
    +            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot from vm snapshot");
    +        }
    +    }
    +
    +    @Override
    +    public void execute() {
    +        s_logger.info("VOLSS: CreateSnapshotFromVMSnapshotCmd starts:" + System.currentTimeMillis());
    --- End diff --
    
    This file was copied from CreateSnapshot.Cmd.java. I will modify the info message.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151412595
  
    @ustcweizhou I think we shouldn't want a enable/disable flag in the agent.properties, it should work for anybody.
    
    That we already have a lot of commands being executed doesn't mean we should add more. We should try to get rid of all of them.
    
    Executing subcommands limits you to only checking the exit-status, but proper exception handling isn't possible.
    
    We shouldn't introduce new cases of executing subcommands. This can be fixed by addings these features to libvirt-java and using them afterwards.
    
    Maybe @bhaisaab, @DaanHoogland and @remibergsma can chime in?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-192958023
  
    @kiwiflyer Simon, Thanks for your bug report, I will fix it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou @nathanejohnson 
    https://github.com/myENA/cloudstack/commit/7a2a1c1c432dd2e39065627eed38bd3fb429cf70
    
    Nathan is going to test this for us.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #977: [4.9] CLOUDSTACK-8746: VM Snapshotting impleme...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r93811952
  
    --- Diff: setup/db/db/schema-4910to41000-cleanup.sql ---
    @@ -18,3 +18,9 @@
     --;
     -- Schema upgrade cleanup from 4.9.1.0 to 4.10.0.0;
     --;
    +
    --- End diff --
    
    Move the changes to 4920to41000.sql


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by asaivan <gi...@git.apache.org>.
Github user asaivan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Would be great to get this integrated, thanks for working on this, guys.  Our organization really needs it right now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    squashed. no code change compared with last commit.
    git diff 9d4d2683ff7eaed27e15e7db91aadcba05736cc8



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151204309
  
    @wido now I got your concern.
    I will change code to enable/disable vm snapshot for kvm by  a global configuration kvm.snapshot.enabled, so that someone who do not need this feature will not be impacted.
    
    It is not an big issue if we configure hypervisor URI in agent.properties, cloudstack read similar setting from the configuration file. It can be fixed easily.
    
    we have many command lines in scripts for network and hypervisor settings, or inside systemvms. Even in java side, there are many Scripts. The function runSimpleBashScriptForExitValue() can get the return value of Script, and deal with it.
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @nathanejohnson I rebased my branch with latest master, and apply your commit. 
    now this PR should have same code with vm-snapshot branch under your account.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    ![vmsnapshot_with_memory](https://cloud.githubusercontent.com/assets/17278194/21755147/5a30a556-d5d4-11e6-8e5d-320e6995b173.png)
    
    ![vmsnapshot_listing](https://cloud.githubusercontent.com/assets/17278194/21755148/5e42608a-d5d4-11e6-97b4-d9aa9023c38b.png)
    
    ![snapshot_on_disk](https://cloud.githubusercontent.com/assets/17278194/21755149/60bcd16a-d5d4-11e6-9871-2835ceaf6de4.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.9] CLOUDSTACK-8746: VM Snapshotting implementation...

Posted by Tosta-Mixta <gi...@git.apache.org>.
Github user Tosta-Mixta commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Many thanks for the work, very nice feature.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    Based on functional testing LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-153371179
  
    My bad, there is no libvirt-java upgrade possible at this point. I was mistaking libvirt 1.1.0 for a possibility.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42975005
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreVMSnapshotCommandWrapper.java ---
    @@ -0,0 +1,121 @@
    +//
    +// 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 java.io.BufferedWriter;
    +import java.io.File;
    +import java.io.FileWriter;
    +import java.io.IOException;
    +import java.io.PrintWriter;
    +import java.util.List;
    +import java.util.Map;
    +
    +import org.apache.cloudstack.storage.to.VolumeObjectTO;
    +import org.apache.log4j.Logger;
    +import org.libvirt.Connect;
    +import org.libvirt.Domain;
    +import org.libvirt.LibvirtException;
    +
    +import com.cloud.agent.api.Answer;
    +import com.cloud.agent.api.RestoreVMSnapshotAnswer;
    +import com.cloud.agent.api.RestoreVMSnapshotCommand;
    +import com.cloud.agent.api.VMSnapshotTO;
    +import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
    +import com.cloud.resource.CommandWrapper;
    +import com.cloud.resource.ResourceWrapper;
    +import com.cloud.utils.script.Script;
    +import com.cloud.vm.VirtualMachine;
    +
    +@ResourceWrapper(handles =  RestoreVMSnapshotCommand.class)
    +public final class LibvirtRestoreVMSnapshotCommandWrapper extends CommandWrapper<RestoreVMSnapshotCommand, Answer, LibvirtComputingResource> {
    +
    +    private static final Logger s_logger = Logger.getLogger(LibvirtRestoreVMSnapshotCommandWrapper.class);
    +
    +    @Override
    +    public Answer execute(final RestoreVMSnapshotCommand cmd, final LibvirtComputingResource libvirtComputingResource) {
    +        String vmName = cmd.getVmName();
    +        List<VolumeObjectTO> listVolumeTo = cmd.getVolumeTOs();
    +        VirtualMachine.PowerState vmState = VirtualMachine.PowerState.PowerOn;
    +
    +        Domain dm = null;
    +        try {
    +            final LibvirtUtilitiesHelper libvirtUtilitiesHelper = libvirtComputingResource.getLibvirtUtilitiesHelper();
    +            Connect conn = libvirtUtilitiesHelper.getConnection();
    +            dm = libvirtComputingResource.getDomain(conn, vmName);
    +
    +            if (dm == null) {
    +                return new RestoreVMSnapshotAnswer(cmd, false,
    +                        "Restore VM Snapshot Failed due to can not find vm: " + vmName);
    +            }
    +            String xmlDesc = dm.getXMLDesc(0);
    +
    +            List<VMSnapshotTO> snapshots = cmd.getSnapshots();
    +            Map<Long, VMSnapshotTO> snapshotAndParents = cmd.getSnapshotAndParents();
    +            for (VMSnapshotTO snapshot: snapshots) {
    +                VMSnapshotTO parent = snapshotAndParents.get(snapshot.getId());
    +                String parentName = (parent == null)? "": ("  <parent><name>" + parent.getSnapshotName() + "</name></parent>\n");
    +                String vmSnapshotXML = "<domainsnapshot>\n"
    +                        + "  <name>" + snapshot.getSnapshotName() + "</name>\n"
    +                        + "  <state>running</state>\n"
    +                        + parentName
    +                        + "  <creationTime>" + (int) Math.rint(snapshot.getCreateTime()/1000) + "</creationTime>\n"
    +                        + xmlDesc
    +                        + "</domainsnapshot>";
    +                s_logger.debug("Restoring vm snapshot " + snapshot.getSnapshotName() + " on " + vmName + " with XML:\n " + vmSnapshotXML);
    +                File tmpCfgFile = null;
    +                try {
    +                    tmpCfgFile = File.createTempFile(vmName + "-", "cfg");
    +                    final PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(tmpCfgFile)));
    +                    out.println(vmSnapshotXML);
    +                    out.close();
    +                    String cfgFilePath = tmpCfgFile.getAbsolutePath();
    +                    String cmdvirsh = "virsh snapshot-create --redefine " + vmName + (snapshot.getCurrent()? " --current ":" ") + cfgFilePath;
    +                    int cmdout = Script.runSimpleBashScriptForExitValue(cmdvirsh);
    --- End diff --
    
    Although I understand that the libvirt-java bindings don't have all the required support, we should not introduce any new cases where we execute "virsh".
    
    The proper way to do this would be to implement these features in libvirt-java and depend on a new release of those bindings.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-153312402
  
    @DaanHoogland @ustcweizhou Overall it seems good! It's just hard to test this since it can break migration of VMs and you also have to deal with all the versions of libvirt.
    
    But overall I think it's OK. If you can take a look at my comments?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by sateesh-chodapuneedi <gi...@git.apache.org>.
Github user sateesh-chodapuneedi commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151049279
  
    @ustcweizhou Can you please share FS or design document for this work?
    It'd help greatly in reviewing this patch.
    Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: [4.7] CLOUDSTACK-8746: VM Snapshotting im...

Posted by kiwiflyer <gi...@git.apache.org>.
Github user kiwiflyer commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-192928225
  
    ![snapshot_nodelete](https://cloud.githubusercontent.com/assets/17278194/13555523/e508d76a-e387-11e5-976f-d03437b1eab1.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/977#issuecomment-151130476
  
    @wido good to know it, thanks. I will implement some features in libvirt-java.
    I would like to keep current command line and merge it to cs 4.7, and change it after new libvirt-java release. command line is not perfect, but it works.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by wido <gi...@git.apache.org>.
Github user wido commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42975042
  
    --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---
    @@ -3388,4 +3419,83 @@ public String mapRbdDevice(final KVMPhysicalDisk disk){
             }
             return device;
         }
    +
    +    public List<Ternary<String, Boolean, String>> cleanVMSnapshotMetadata(Domain dm) throws LibvirtException {
    +        s_logger.debug("Cleaning the metadata of vm snapshots of vm " + dm.getName());
    +        List<Ternary<String, Boolean, String>> vmsnapshots = new ArrayList<Ternary<String, Boolean, String>>();
    +        String currentSnapshotName = null;
    +        try {
    +            DomainSnapshot snapshotCurrent = dm.snapshotCurrent();
    +            String snapshotXML = snapshotCurrent.getXMLDesc();
    +            snapshotCurrent.free();
    +            DocumentBuilder builder;
    +            try {
    +                builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    +
    +                InputSource is = new InputSource();
    +                is.setCharacterStream(new StringReader(snapshotXML));
    +                Document doc = builder.parse(is);
    +                Element rootElement = doc.getDocumentElement();
    +
    +                currentSnapshotName = getTagValue("name", rootElement);
    +            } catch (ParserConfigurationException e) {
    +                s_logger.debug(e.toString());
    +            } catch (SAXException e) {
    +                s_logger.debug(e.toString());
    +            } catch (IOException e) {
    +                s_logger.debug(e.toString());
    +            }
    +        } catch (LibvirtException e) {
    +            s_logger.debug("Fail to get the current vm snapshot for vm: " + dm.getName() + ", continue");
    +        }
    +        for (String snapshotName: dm.snapshotListNames()) {
    +            DomainSnapshot snapshot = dm.snapshotLookupByName(snapshotName);
    +            Boolean isCurrent = (currentSnapshotName != null && currentSnapshotName.equals(snapshotName)) ? true: false;
    +            vmsnapshots.add(new Ternary<String, Boolean, String>(snapshotName, isCurrent, snapshot.getXMLDesc()));
    +            snapshot.free();
    +        }
    +        for (String snapshotName: dm.snapshotListNames()) {
    +            String cmdvirsh = "virsh snapshot-delete --metadata " + dm.getName() + " " + snapshotName;
    +            int cmdout = Script.runSimpleBashScriptForExitValue(cmdvirsh);
    --- End diff --
    
    Same goes for this, see my comment above about libvirt-java.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: CLOUDSTACK-8746: VM Snapshotting implemen...

Posted by ustcweizhou <gi...@git.apache.org>.
Github user ustcweizhou commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/977#discussion_r42966712
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java ---
    @@ -0,0 +1,191 @@
    +// 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 org.apache.cloudstack.api.command.user.snapshot;
    +
    +import org.apache.cloudstack.api.APICommand;
    +import org.apache.cloudstack.api.ApiCommandJobType;
    +import org.apache.cloudstack.api.ApiConstants;
    +import org.apache.cloudstack.api.ApiErrorCode;
    +import org.apache.cloudstack.api.BaseAsyncCmd;
    +import org.apache.cloudstack.api.BaseAsyncCreateCmd;
    +import org.apache.cloudstack.api.Parameter;
    +import org.apache.cloudstack.api.ServerApiException;
    +import org.apache.cloudstack.api.response.SnapshotResponse;
    +import org.apache.cloudstack.api.response.VMSnapshotResponse;
    +import org.apache.cloudstack.context.CallContext;
    +import org.apache.log4j.Logger;
    +
    +import com.cloud.event.EventTypes;
    +import com.cloud.exception.InvalidParameterValueException;
    +import com.cloud.exception.PermissionDeniedException;
    +import com.cloud.exception.ResourceAllocationException;
    +import com.cloud.projects.Project;
    +import com.cloud.storage.Snapshot;
    +import com.cloud.user.Account;
    +import com.cloud.uservm.UserVm;
    +import com.cloud.vm.snapshot.VMSnapshot;
    +
    +@APICommand(name = "createSnapshotFromVMSnapshot", description = "Creates an instant snapshot of a volume from vm snapshot.", responseObject = SnapshotResponse.class)
    --- End diff --
    
    good point. I think it is feasible, but it need more testing. If yes, I will modify it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    <b>Trillian test result (tid-772)</b>
    Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
    Total time taken: 48642 seconds
    Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr977-t772-kvm-centos7.zip
    Intermitten failure detected: /marvin/tests/smoke/test_internal_lb.py
    Intermitten failure detected: /marvin/tests/smoke/test_iso.py
    Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
    Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py
    Intermitten failure detected: /marvin/tests/smoke/test_snapshots.py
    Intermitten failure detected: /marvin/tests/smoke/test_templates.py
    Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
    Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
    Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
    Test completed. 41 look ok, 11 have error(s)
    
    
    Test | Result | Time (s) | Test File
    --- | --- | --- | ---
    test_04_extract_template | `Failure` | 5.17 | test_templates.py
    test_04_rvpc_privategw_static_routes | `Failure` | 340.87 | test_privategw_acl.py
    test_04_extract_Iso | `Failure` | 5.10 | test_iso.py
    ContextSuite context=TestVpcSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
    ContextSuite context=TestVpcRemoteAccessVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
    ContextSuite context=TestRVPCSite2SiteVpn>:setup | `Error` | 0.00 | test_vpc_vpn.py
    ContextSuite context=TestVPCRedundancy>:setup | `Error` | 0.00 | test_vpc_redundant.py
    test_01_create_volume | `Error` | 279.69 | test_volumes.py
    ContextSuite context=TestSnapshotRootDisk>:setup | `Error` | 0.00 | test_snapshots.py
    ContextSuite context=TestInternalLb>:setup | `Error` | 0.00 | test_internal_lb.py
    test_02_VPC_default_routes | Success | 448.19 | test_vpc_router_nics.py
    test_01_VPC_nics_after_destroy | Success | 824.92 | test_vpc_router_nics.py
    test_09_delete_detached_volume | Success | 156.67 | test_volumes.py
    test_08_resize_volume | Success | 156.47 | test_volumes.py
    test_07_resize_fail | Success | 156.46 | test_volumes.py
    test_06_download_detached_volume | Success | 156.30 | test_volumes.py
    test_05_detach_volume | Success | 241.30 | test_volumes.py
    test_04_delete_attached_volume | Success | 146.22 | test_volumes.py
    test_03_download_attached_volume | Success | 151.26 | test_volumes.py
    test_02_attach_volume | Success | 214.74 | test_volumes.py
    test_deploy_vm_multiple | Success | 343.24 | test_vm_life_cycle.py
    test_deploy_vm | Success | 0.03 | test_vm_life_cycle.py
    test_advZoneVirtualRouter | Success | 0.02 | test_vm_life_cycle.py
    test_10_attachAndDetach_iso | Success | 26.72 | test_vm_life_cycle.py
    test_09_expunge_vm | Success | 125.26 | test_vm_life_cycle.py
    test_08_migrate_vm | Success | 40.98 | test_vm_life_cycle.py
    test_07_restore_vm | Success | 0.13 | test_vm_life_cycle.py
    test_06_destroy_vm | Success | 130.86 | test_vm_life_cycle.py
    test_03_reboot_vm | Success | 125.95 | test_vm_life_cycle.py
    test_02_start_vm | Success | 10.20 | test_vm_life_cycle.py
    test_01_stop_vm | Success | 125.87 | test_vm_life_cycle.py
    test_CreateTemplateWithDuplicateName | Success | 80.72 | test_templates.py
    test_08_list_system_templates | Success | 0.03 | test_templates.py
    test_07_list_public_templates | Success | 0.04 | test_templates.py
    test_05_template_permissions | Success | 0.05 | test_templates.py
    test_03_delete_template | Success | 5.11 | test_templates.py
    test_02_edit_template | Success | 90.13 | test_templates.py
    test_01_create_template | Success | 40.47 | test_templates.py
    test_10_destroy_cpvm | Success | 161.69 | test_ssvm.py
    test_09_destroy_ssvm | Success | 168.59 | test_ssvm.py
    test_08_reboot_cpvm | Success | 131.76 | test_ssvm.py
    test_07_reboot_ssvm | Success | 133.58 | test_ssvm.py
    test_06_stop_cpvm | Success | 131.77 | test_ssvm.py
    test_05_stop_ssvm | Success | 138.82 | test_ssvm.py
    test_04_cpvm_internals | Success | 1.20 | test_ssvm.py
    test_03_ssvm_internals | Success | 3.47 | test_ssvm.py
    test_02_list_cpvm_vm | Success | 0.12 | test_ssvm.py
    test_01_list_sec_storage_vm | Success | 0.13 | test_ssvm.py
    test_04_change_offering_small | Success | 239.61 | test_service_offerings.py
    test_03_delete_service_offering | Success | 0.04 | test_service_offerings.py
    test_02_edit_service_offering | Success | 0.08 | test_service_offerings.py
    test_01_create_service_offering | Success | 0.11 | test_service_offerings.py
    test_02_sys_template_ready | Success | 0.13 | test_secondary_storage.py
    test_01_sys_vm_start | Success | 0.18 | test_secondary_storage.py
    test_09_reboot_router | Success | 35.35 | test_routers.py
    test_08_start_router | Success | 30.28 | test_routers.py
    test_07_stop_router | Success | 10.16 | test_routers.py
    test_06_router_advanced | Success | 0.06 | test_routers.py
    test_05_router_basic | Success | 0.04 | test_routers.py
    test_04_restart_network_wo_cleanup | Success | 5.69 | test_routers.py
    test_03_restart_network_cleanup | Success | 60.55 | test_routers.py
    test_02_router_internal_adv | Success | 1.06 | test_routers.py
    test_01_router_internal_basic | Success | 0.59 | test_routers.py
    test_router_dns_guestipquery | Success | 76.70 | test_router_dns.py
    test_router_dns_externalipquery | Success | 0.08 | test_router_dns.py
    test_router_dhcphosts | Success | 388.13 | test_router_dhcphosts.py
    test_router_dhcp_opts | Success | 21.66 | test_router_dhcphosts.py
    test_01_updatevolumedetail | Success | 0.08 | test_resource_detail.py
    test_01_reset_vm_on_reboot | Success | 161.40 | test_reset_vm_on_reboot.py
    test_createRegion | Success | 0.04 | test_regions.py
    test_create_pvlan_network | Success | 5.22 | test_pvlan.py
    test_dedicatePublicIpRange | Success | 0.45 | test_public_ip_range.py
    test_03_vpc_privategw_restart_vpc_cleanup | Success | 701.94 | test_privategw_acl.py
    test_02_vpc_privategw_static_routes | Success | 542.75 | test_privategw_acl.py
    test_01_vpc_privategw_acl | Success | 92.31 | test_privategw_acl.py
    test_01_primary_storage_nfs | Success | 35.84 | test_primary_storage.py
    test_createPortablePublicIPRange | Success | 15.19 | test_portable_publicip.py
    test_createPortablePublicIPAcquire | Success | 15.59 | test_portable_publicip.py
    test_isolate_network_password_server | Success | 86.57 | test_password_server.py
    test_UpdateStorageOverProvisioningFactor | Success | 0.14 | test_over_provisioning.py
    test_oobm_zchange_password | Success | 30.71 | test_outofbandmanagement.py
    test_oobm_multiple_mgmt_server_ownership | Success | 11.33 | test_outofbandmanagement.py
    test_oobm_issue_power_status | Success | 10.24 | test_outofbandmanagement.py
    test_oobm_issue_power_soft | Success | 15.33 | test_outofbandmanagement.py
    test_oobm_issue_power_reset | Success | 15.35 | test_outofbandmanagement.py
    test_oobm_issue_power_on | Success | 15.35 | test_outofbandmanagement.py
    test_oobm_issue_power_off | Success | 15.40 | test_outofbandmanagement.py
    test_oobm_issue_power_cycle | Success | 15.32 | test_outofbandmanagement.py
    test_oobm_enabledisable_across_clusterzones | Success | 87.64 | test_outofbandmanagement.py
    test_oobm_enable_feature_valid | Success | 5.16 | test_outofbandmanagement.py
    test_oobm_enable_feature_invalid | Success | 0.10 | test_outofbandmanagement.py
    test_oobm_disable_feature_valid | Success | 5.19 | test_outofbandmanagement.py
    test_oobm_disable_feature_invalid | Success | 0.12 | test_outofbandmanagement.py
    test_oobm_configure_invalid_driver | Success | 0.09 | test_outofbandmanagement.py
    test_oobm_configure_default_driver | Success | 0.08 | test_outofbandmanagement.py
    test_oobm_background_powerstate_sync | Success | 23.53 | test_outofbandmanagement.py
    test_extendPhysicalNetworkVlan | Success | 15.32 | test_non_contigiousvlan.py
    test_01_nic | Success | 535.34 | test_nic.py
    test_releaseIP | Success | 268.21 | test_network.py
    test_reboot_router | Success | 479.05 | test_network.py
    test_public_ip_user_account | Success | 10.27 | test_network.py
    test_public_ip_admin_account | Success | 40.29 | test_network.py
    test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Success | 67.10 | test_network.py
    test_network_rules_acquired_public_ip_2_nat_rule | Success | 61.78 | test_network.py
    test_network_rules_acquired_public_ip_1_static_nat_rule | Success | 124.22 | test_network.py
    test_delete_account | Success | 272.81 | test_network.py
    test_02_port_fwd_on_non_src_nat | Success | 55.82 | test_network.py
    test_01_port_fwd_on_src_nat | Success | 111.74 | test_network.py
    test_nic_secondaryip_add_remove | Success | 227.93 | test_multipleips_per_nic.py
    login_test_saml_user | Success | 19.23 | test_login.py
    test_assign_and_removal_lb | Success | 133.57 | test_loadbalance.py
    test_02_create_lb_rule_non_nat | Success | 187.26 | test_loadbalance.py
    test_01_create_lb_rule_src_nat | Success | 218.19 | test_loadbalance.py
    test_03_list_snapshots | Success | 0.07 | test_list_ids_parameter.py
    test_02_list_templates | Success | 0.04 | test_list_ids_parameter.py
    test_01_list_volumes | Success | 0.03 | test_list_ids_parameter.py
    test_07_list_default_iso | Success | 0.07 | test_iso.py
    test_05_iso_permissions | Success | 0.06 | test_iso.py
    test_03_delete_iso | Success | 95.21 | test_iso.py
    test_02_edit_iso | Success | 0.05 | test_iso.py
    test_01_create_iso | Success | 21.02 | test_iso.py
    test_dedicateGuestVlanRange | Success | 10.51 | test_guest_vlan_range.py
    test_UpdateConfigParamWithScope | Success | 0.15 | test_global_settings.py
    test_rolepermission_lifecycle_update | Success | 6.21 | test_dynamicroles.py
    test_rolepermission_lifecycle_list | Success | 5.99 | test_dynamicroles.py
    test_rolepermission_lifecycle_delete | Success | 5.87 | test_dynamicroles.py
    test_rolepermission_lifecycle_create | Success | 5.89 | test_dynamicroles.py
    test_rolepermission_lifecycle_concurrent_updates | Success | 6.14 | test_dynamicroles.py
    test_role_lifecycle_update_role_inuse | Success | 5.92 | test_dynamicroles.py
    test_role_lifecycle_update | Success | 5.97 | test_dynamicroles.py
    test_role_lifecycle_list | Success | 5.94 | test_dynamicroles.py
    test_role_lifecycle_delete | Success | 10.96 | test_dynamicroles.py
    test_role_lifecycle_create | Success | 6.04 | test_dynamicroles.py
    test_role_inuse_deletion | Success | 5.89 | test_dynamicroles.py
    test_role_account_acls_multiple_mgmt_servers | Success | 8.46 | test_dynamicroles.py
    test_role_account_acls | Success | 8.43 | test_dynamicroles.py
    test_default_role_deletion | Success | 6.00 | test_dynamicroles.py
    test_04_create_fat_type_disk_offering | Success | 0.08 | test_disk_offerings.py
    test_03_delete_disk_offering | Success | 0.04 | test_disk_offerings.py
    test_02_edit_disk_offering | Success | 0.05 | test_disk_offerings.py
    test_02_create_sparse_type_disk_offering | Success | 0.07 | test_disk_offerings.py
    test_01_create_disk_offering | Success | 0.11 | test_disk_offerings.py
    test_deployvm_userdispersing | Success | 45.90 | test_deploy_vms_with_varied_deploymentplanners.py
    test_deployvm_userconcentrated | Success | 20.62 | test_deploy_vms_with_varied_deploymentplanners.py
    test_deployvm_firstfit | Success | 50.66 | test_deploy_vms_with_varied_deploymentplanners.py
    test_deployvm_userdata_post | Success | 35.58 | test_deploy_vm_with_userdata.py
    test_deployvm_userdata | Success | 55.78 | test_deploy_vm_with_userdata.py
    test_02_deploy_vm_root_resize | Success | 6.00 | test_deploy_vm_root_resize.py
    test_01_deploy_vm_root_resize | Success | 6.00 | test_deploy_vm_root_resize.py
    test_00_deploy_vm_root_resize | Success | 217.50 | test_deploy_vm_root_resize.py
    test_deploy_vm_from_iso | Success | 207.71 | test_deploy_vm_iso.py
    test_DeployVmAntiAffinityGroup | Success | 65.97 | test_affinity_groups.py
    test_03_delete_vm_snapshots | Skipped | 0.00 | test_vm_snapshots.py
    test_02_revert_vm_snapshots | Skipped | 0.00 | test_vm_snapshots.py
    test_01_test_vm_volume_snapshot | Skipped | 0.00 | test_vm_snapshots.py
    test_01_create_vm_snapshots | Skipped | 0.00 | test_vm_snapshots.py
    test_06_copy_template | Skipped | 0.00 | test_templates.py
    test_static_role_account_acls | Skipped | 0.02 | test_staticroles.py
    test_11_ss_nfs_version_on_ssvm | Skipped | 0.02 | test_ssvm.py
    test_01_scale_vm | Skipped | 0.00 | test_scale_vm.py
    test_01_primary_storage_iscsi | Skipped | 0.04 | test_primary_storage.py
    test_nested_virtualization_vmware | Skipped | 0.00 | test_nested_virtualization.py
    test_06_copy_iso | Skipped | 0.00 | test_iso.py
    test_deploy_vgpu_enabled_vm | Skipped | 0.04 | test_deploy_vgpu_enabled_vm.py
    test_3d_gpu_support | Skipped | 0.04 | test_deploy_vgpu_enabled_vm.py



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan package


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan package


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by blueorangutan <gi...@git.apache.org>.
Github user blueorangutan commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by nathanejohnson <gi...@git.apache.org>.
Github user nathanejohnson commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou I just now squashed the commits, but the branch @leprechau mentioned above is the branch I was working on that incorporates that commit plus a few others.
    
    Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by nathanejohnson <gi...@git.apache.org>.
Github user nathanejohnson commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou for what it's worth, our branch / fork has all changes from master incorporated


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by nathanejohnson <gi...@git.apache.org>.
Github user nathanejohnson commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @ustcweizhou @kiwiflyer I was finally able to get an environment to run tests.  So far I have reworked smoke/test_vm_snapshots.py with @kiwiflyer so that it handles the chnages from this PR for KVM, and the tests were successful:
    
    @Desc: Test that Volume snapshot for root volume is not allowed ... SKIP: Skipping test because unsupported                    hypervisor KVM
    Test to create VM snapshots ... === TestName: test_01_create_vm_snapshots | Status : SUCCESS ===
    ok
    Test to revert VM snapshots ... === TestName: test_02_revert_vm_snapshots | Status : SUCCESS ===
    ok
    Test to delete vm snapshots ... === TestName: test_03_delete_vm_snapshots | Status : SUCCESS ===
    ok
    
    ----------------------------------------------------------------------
    Ran 4 tests in 564.793s
    
    OK (SKIP=1)
    
    @ustcweizhou I committed those to a branch we forked from your vm-snapshot branch, and then we rebased it off of master.  Would you like me to open a PR against your fork / branch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #977: [4.10] CLOUDSTACK-8746: VM Snapshotting implementatio...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the issue:

    https://github.com/apache/cloudstack/pull/977
  
    @blueorangutan test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---