[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-05-02 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/4.9-bountycastle-daan from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-05-02 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/4.9-bountycastle-daan from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/master from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/master from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/4.7 from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/4.8 from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/4.7 from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user asfgit closed the pull request at:

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


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CLOUDSTACK-9349:
-

Commit 1979f42b2d24e7d3ddaa71eeb0a01fde51dfd976 in cloudstack's branch 
refs/heads/4.8 from [~williamstev...@gmail.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=1979f42 ]

Merge pull request #1500 from myENA/KVM_root_detach

CLOUDSTACK-9349: Enable root disk detach for KVM with new Marvin testsThis PR 
addresses the KVM detach/attach ROOT disks from VMs (CLOUDSTACK-9349).  In 
short, this allows the KVM Hypervisor, and I added the Simulator as a valid 
hypervisor for ease of development and testing of marvin, to detach a root 
volume and the reattach a root volume using the deviceid=0 flag to the 
attachVolume API.  I have also written a marvin integration test that verifies 
this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.

[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)

* pr/1500:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach 
testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated 
test_volumes.py to include a test for detaching and reattaching a root volume 
from a vm. I also had to update base.py to allow attach_volume to have the 
parameter deviceid to be passed as needed.

Signed-off-by: Will Stevens 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user kiwiflyer commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215410772
  
We'll take a look at this in a separate PR. We don't use the UI.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user ustcweizhou commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215408560
  
is there any UI change possible?


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user kiwiflyer commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215401063
  
@swill CI Test good, 2+ reviews. Ready to Merge.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user koushik-das commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215372191
  
LGTM. Had already given one earlier based on simulator testing.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user nitt10prashant commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215308516
  
LGTM for test code based on code review 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215120369
  
OK, all checks have passed!  ;)  Looking for another LGTM.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user swill commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215103065
  
@koushik-das can I get your code review on this?  Thanks.  :)


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215103808
  
Yea, I saw that jenkins failed pulling 4.7 branch, so I kicked it off 
again.  I'm going to keep an eye on travis and jenkins.  There is no reason 
those tests should fail.  Hopefully, I'll get a green this time around.  ;)


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user swill commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215102785
  
Thanks @kiwiflyer.  :)  I was about to ask you to re-push to kick off the 
runs again and you did it as I was typing.   


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user kiwiflyer commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215099770
  
Tested this patch manually on a KVM 4.8 lab. We also ran the new Marvin 
unit tests successfully against the simulator, bubble instance and a hardware 
lab. Works as designed. 

LGTM


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user swill commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215087358
  
Thank you for the results.  I think that is all we need from a CI 
perspective.  Jenkins and Travis have been kicked off again as well, so that is 
good.  Hopefully we will be all green on that front too.

We need some LGTM code reviews on this one.  Thanks...


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215084188
  

[test_volumes_NV6XFO.zip](https://github.com/apache/cloudstack/files/238694/test_volumes_NV6XFO.zip)

Here is the zip file containing the test results.

Thanks in advance for the reviews!


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-215083560
  
Ok, I have run this through my lab again and specifically ran the 
test_volumes.py file.  All tests passed.  See below.  I have also attached the 
results dir as a zip file for review.

Test Volume attach/detach to VM (5 data volumes) ... === TestName: 
test_01_volume_attach_detach | Status : SUCCESS ===
ok
Test Root Volume attach/detach to VM ... === TestName: 
test_02_root_volume_attach_detach | Status : SUCCESS ===
ok
Test Attach volumes (max capacity) ... === TestName: test_01_volume_attach 
| Status : SUCCESS ===
ok
Test attach volumes (more than max) to an instance ... === TestName: 
test_02_volume_attach_max | Status : SUCCESS ===
ok
Test custom disk sizes beyond range ... === TestName: 
test_deployVmWithCustomDisk | Status : SUCCESS ===
ok
Attach a created Volume to a Running VM ... === TestName: 
test_01_attach_volume | Status : SUCCESS ===
ok
Detach a Volume attached to a VM ... === TestName: test_02_detach_volume | 
Status : SUCCESS ===
ok
Delete a Volume unattached to an VM ... === TestName: 
test_03_delete_detached_volume | Status : SUCCESS ===
ok
Create a volume under a non-root domain as non-root-domain user ... === 
TestName: test_create_volume_under_domain | Status : SUCCESS ===
ok

--
Ran 9 tests in 539.126s

OK

@swill - Looking at the standard bubble test suite that is run, it doesn't 
even run this test, so I thought it prudent in this case to run it specifically 
and post the results.  Once we get the bubble stuff standardized, I'm happy to 
run the full test and post those results.  Until then, I would like to submit 
this PR for code review again.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60602700
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+   

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60602084
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
--- End diff --

I have implemented this change and I'm validating it now in my lab.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60602140
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
--- End diff --

I have made this change and I'm validating this now in my lab.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60585058
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+   

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60584441
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+   

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60582064
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
--- End diff --

Understood.  I'll make the change.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60581671
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
--- End diff --

@nitt10prashant - Thanks for the feedback.  I was merely following an 
established pattern that I observed earlier in the file.  Please look at lines 
499 - 510 as an example.  I have put the code below for your convenience.  
Should that code be refactored as well? I just want to understand if my 
situation that I'm testing is different than the code I'm referencing below.  
In the end, I'm happy to make the change.  Thanks again for the feedback.

`
# Check List Volume response for newly created volume
list_volume_response = Volume.list(
self.apiclient,
id=volume.id
)
self.assertNotEqual(
list_volume_response,
None,
"Check if volume exists in ListVolumes")
self.assertEqual(
isinstance(list_volume_response, list),
True,
"Check list volumes response for valid list")`


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60582709
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+   

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user jburwell commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60582658
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+ 

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user nitt10prashant commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60533148
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user nitt10prashant commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60533118
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
--- End diff --

 No need use sleep time .Marvin automatically wait until it gets stop vm 
reply 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user nitt10prashant commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60532285
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user nitt10prashant commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60531417
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
--- End diff --

if vm_respone is empty addressing zeroth element will error out,Can you 
please use validate list and provide proper debug message 


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user nitt10prashant commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60531171
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"], required_hardware="false")
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Verify that we are testing a supported hypervisor
+# 3. Check for root volume
+# 4. Stop VM
+# 5. Detach root volume
+# 6. Verify root volume detached
+# 7. Attach root volume
+# 8. Start VM
+
+# Verify we are using a supported hypervisor
+if (self.hypervisor.lower() == 'vmware'
+or self.hypervisor.lower() == 'kvm'
+or self.hypervisor.lower() == 'simulator'
+or self.hypervisor.lower() == 'xenserver'):
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
--- End diff --

utils.py have a method validateList to check the response and instance type 
, can please you use it


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user swill commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-212533078
  
We need some LGTM code reviews of this one.  I would also like to run CI 
against it because it changes code that is common to other functionality to 
make sure nothing else gets broken from this change.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-212426369
  
@koushik-das - Thanks for the feedback.  I have added the 
require_hardware="false" as you suggested and pushed a new commit to the branch.

If all looks good, I'll squash the commits in prep for the final merge.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user kiwiflyer commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-212400883
  
@koushik-das -  Our use case is to emulate a snapshot revert with Ceph by 
using createVolume sourced from a snapshot, then detaching and reattach the 
root volume of a VM with device id of 0.

This preserves the previous volume history and allows the user to switch 
back and forth between different snapshots.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user koushik-das commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-212267285
  
@dmabry Thanks for the fix. I ran it on simulator and it worked as 
expected. So +1 on the changes. Although it existed for XenServer and Vmware, I 
am trying to understand the use case for this. Is it used for root disk 
recovery by attaching it to a new VM?


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user koushik-das commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60352254
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,144 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"])
--- End diff --

@dmabry Since the test can run on simulator, please add 
required_hardware="false" to the tags.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-212085924
  
Ok, I have made the requested changes.  Please review and let me know if 
there is anything else I need to change.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60225742
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,134 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"])
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Check for root volume
+# 3. Stop VM
+# 4. Detach root volume
+# 5. Verify root volume detached
+# 6. Attach root volume
+# 7. Start VM
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+
+# Start VM
+self.virtual_machine.start(self.apiclient)
+# Sleep to ensure that VM is in ready state
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+# Verify VM response to check whether VM deployment was 
successful
+self.assertEqual(
+isinstance(vm_response, list),
+True,
+"Check list VM 

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60222679
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,134 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"])
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Check for root volume
+# 3. Stop VM
+# 4. Detach root volume
+# 5. Verify root volume detached
+# 6. Attach root volume
+# 7. Start VM
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+
+# Start VM
+self.virtual_machine.start(self.apiclient)
+# Sleep to ensure that VM is in ready state
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+# Verify VM response to check whether VM deployment was 
successful
+self.assertEqual(
+isinstance(vm_response, list),
+True,
+"Check list VM 

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60222132
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,134 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"])
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Check for root volume
+# 3. Stop VM
+# 4. Detach root volume
+# 5. Verify root volume detached
+# 6. Attach root volume
+# 7. Start VM
+
+try:
+# Check for root volume
--- End diff --

@shwetaag Thanks for the feedback.  You are absolutely right, I should test 
to ensure the hypervisor supports Root Volume detach.  Root Volume detach is 
currently supported by a number of hypervisors, so I will put in an if block 
that will make sure that it only tests the supported hypervisors.


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user shwetaag commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60193647
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,134 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"])
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Check for root volume
+# 3. Stop VM
+# 4. Detach root volume
+# 5. Verify root volume detached
+# 6. Attach root volume
+# 7. Start VM
+
+try:
+# Check for root volume
+root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+# Grab the root volume for later use
+root_volume = root_volume_response[0]
+
+# Stop VM
+self.debug("Stopping the VM: %s" % self.virtual_machine.id)
+self.virtual_machine.stop(self.apiclient)
+
+# Ensure VM is stopped before detaching the root volume
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+vm = vm_response[0]
+self.assertEqual(
+vm.state,
+'Stopped',
+"Check the state of VM"
+)
+
+# Detach root volume from VM
+self.virtual_machine.detach_volume(
+self.apiclient,
+root_volume
+)
+
+# Verify that root disk is gone
+no_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertEqual(
+no_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+
+# Attach root volume to VM
+self.virtual_machine.attach_volume(
+self.apiclient,
+root_volume,
+0
+)
+
+# Check for root volume
+new_root_volume_response = Volume.list(
+self.apiclient,
+virtualmachineid=self.virtual_machine.id,
+type='ROOT',
+listall=True
+)
+self.assertNotEqual(
+new_root_volume_response,
+None,
+"Check if root volume exists in ListVolumes"
+)
+self.assertEqual(
+isinstance(new_root_volume_response, list),
+True,
+"Check list volumes response for valid list"
+)
+
+# Start VM
+self.virtual_machine.start(self.apiclient)
+# Sleep to ensure that VM is in ready state
+time.sleep(self.services["sleep"])
+
+vm_response = VirtualMachine.list(
+self.apiclient,
+id=self.virtual_machine.id,
+)
+# Verify VM response to check whether VM deployment was 
successful
+self.assertEqual(
+isinstance(vm_response, list),
+True,
+"Check list VM 

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user shwetaag commented on a diff in the pull request:

https://github.com/apache/cloudstack/pull/1500#discussion_r60193089
  
--- Diff: test/integration/component/test_volumes.py ---
@@ -603,7 +603,134 @@ def test_01_volume_attach_detach(self):
 "Check the state of VM"
 )
 except Exception as e:
-self.fail("Exception occuered: %s" % e)
+self.fail("Exception occurred: %s" % e)
+return
+
+@attr(tags=["advanced", "advancedns"])
+def test_02_root_volume_attach_detach(self):
+"""Test Root Volume attach/detach to VM
+"""
+
+# Validate the following
+# 1. Deploy a VM
+# 2. Check for root volume
+# 3. Stop VM
+# 4. Detach root volume
+# 5. Verify root volume detached
+# 6. Attach root volume
+# 7. Start VM
+
+try:
+# Check for root volume
--- End diff --

First Verify the hypervisor type is KVM  in order for this test to execute 
else skip this test . As root volume detach is supported for KVM .


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user swill commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-211551366
  
would you mind squashing your commits for this PR?


> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


Github user dmabry commented on the pull request:

https://github.com/apache/cloudstack/pull/1500#issuecomment-21138
  
Here is a manual test using cloudmonkey against our KVM lab.

`(local)  > list volumes 
virtualmachineid=f2870d90-d294-474b-b7da-95bad01e6c09 listall=true
count = 1
volume:
id = 6bd1cf36-2225-4f9c-a378-fe2959142912
name = ROOT-42
account = admin-2177
created = 2016-04-14T07:54:23-0500
destroyed = False
deviceid = 0
displayvolume = True
domain = 2177
domainid = cf23158e-d33c-40c2-b176-0db4a163a93f
hypervisor = KVM
isextractable = False
path = 6bd1cf36-2225-4f9c-a378-fe2959142912
provisioningtype = thin
quiescevm = False
serviceofferingdisplaytext = Small Instance
serviceofferingid = b85e77fd-b897-4471-8fce-1190e71e5156
serviceofferingname = Small Instance
size = 5368709120
state = Ready
storage = rbd1
storageid = f0dbafaa-52a3-3077-bc53-d7ad3a5ac132
storagetype = shared
tags:
templatedisplaytext = Base CentOS 7
templateid = cf02d86b-145b-4777-999c-7f37b16c945b
templatename = Linux_CentOS_7-Minimal
type = ROOT
virtualmachineid = f2870d90-d294-474b-b7da-95bad01e6c09
vmdisplayname = VM-381
vmname = VM-f2870d90-d294-474b-b7da-95bad01e6c09
vmstate = Stopped
zoneid = f58958e8-d24f-4a52-9a9f-8ae11cf4a3b0
zonename = Zone1
(local)  > detach volume id=6bd1cf36-2225-4f9c-a378-fe2959142912
 
accountid = 6b00c3ed-fc3f-11e5-9789-000c29b79f06
cmd = org.apache.cloudstack.api.command.admin.volume.DetachVolumeCmdByAdmin
created = 2016-04-16T13:45:56-0500
jobid = 8d499364-6c4a-49be-bc43-3a80ea800ffa
jobinstanceid = 6bd1cf36-2225-4f9c-a378-fe2959142912
jobinstancetype = Volume
jobprocstatus = 0
jobresult:
volume:
id = 6bd1cf36-2225-4f9c-a378-fe2959142912
name = ROOT-42
account = admin-2177
created = 2016-04-14T07:54:23-0500
destroyed = False
displayvolume = True
domain = 2177
domainid = cf23158e-d33c-40c2-b176-0db4a163a93f
hypervisor = KVM
isextractable = True
jobid = 8d499364-6c4a-49be-bc43-3a80ea800ffa
jobstatus = 0
path = 6bd1cf36-2225-4f9c-a378-fe2959142912
provisioningtype = thin
quiescevm = False
serviceofferingdisplaytext = Small Instance
serviceofferingid = b85e77fd-b897-4471-8fce-1190e71e5156
serviceofferingname = Small Instance
size = 5368709120
state = Ready
storage = rbd1
storageid = f0dbafaa-52a3-3077-bc53-d7ad3a5ac132
storagetype = shared
tags:
templatedisplaytext = Base CentOS 7
templateid = cf02d86b-145b-4777-999c-7f37b16c945b
templatename = Linux_CentOS_7-Minimal
type = DATADISK
zoneid = f58958e8-d24f-4a52-9a9f-8ae11cf4a3b0
zonename = Zone1
jobresultcode = 0
jobresulttype = object
jobstatus = 1
userid = 6b00cc09-fc3f-11e5-9789-000c29b79f06
(local)  > 
(local)  > 
(local)  > list volumes 
virtualmachineid=f2870d90-d294-474b-b7da-95bad01e6c09 listall=true
(local)  > 
(local)  > 
(local)  > attach volume id=6bd1cf36-2225-4f9c-a378-fe2959142912 
virtualmachineid=f2870d90-d294-474b-b7da-95bad01e6c09 
deviceid=  filter=id=virtualmachineid=  
(local)  > attach volume id=6bd1cf36-2225-4f9c-a378-fe2959142912 
virtualmachineid=f2870d90-d294-474b-b7da-95bad01e6c09 deviceid=0
 
accountid = 6b00c3ed-fc3f-11e5-9789-000c29b79f06
cmd = org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin
created = 2016-04-16T13:46:43-0500
jobid = 8b36e694-376a-457e-b2be-dc71872177ca
jobinstanceid = 6bd1cf36-2225-4f9c-a378-fe2959142912
jobinstancetype = Volume
jobprocstatus = 0
jobresult:
volume:
id = 6bd1cf36-2225-4f9c-a378-fe2959142912
name = ROOT-42
account = admin-2177
attached = 2016-04-16T13:46:44-0500
created = 2016-04-14T07:54:23-0500
destroyed = False
deviceid = 0
displayvolume = True
domain = 2177
domainid = cf23158e-d33c-40c2-b176-0db4a163a93f
hypervisor = KVM
isextractable = False
jobid = 8b36e694-376a-457e-b2be-dc71872177ca
jobstatus = 0
path = 6bd1cf36-2225-4f9c-a378-fe2959142912
provisioningtype = thin
quiescevm = False
serviceofferingdisplaytext = Small Instance
serviceofferingid = b85e77fd-b897-4471-8fce-1190e71e5156
serviceofferingname = Small Instance
size = 5368709120
state = Ready
storage = rbd1
storageid = f0dbafaa-52a3-3077-bc53-d7ad3a5ac132
storagetype = shared
tags:
templatedisplaytext = Base CentOS 7
templateid = cf02d86b-145b-4777-999c-7f37b16c945b
templatename = 

[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CLOUDSTACK-9349:


GitHub user dmabry opened a pull request:

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

CLOUDSTACK-9349

This PR addresses the KVM detach/attach ROOT disks from VMs 
(CLOUDSTACK-9349).  In short, this allows the KVM Hypervisor, and I added the 
Simulator as a valid hypervisor for ease of development and testing of marvin, 
to detach a root volume and the reattach a root volume using the deviceid=0 
flag to the attachVolume API.  I have also written a marvin integration test 
that verifies this feature works for both KVM and the Simulator.

Below is the marvin results files of the full marvin test_volumes.py.  All 
tests pass, including the new root detach/attach, on our KVM lab running with 
the patches in this PR.


[test_volumes_KIR4G3.zip](https://github.com/apache/cloudstack/files/223799/test_volumes_KIR4G3.zip)


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

$ git pull https://github.com/myENA/cloudstack KVM_root_detach

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

https://github.com/apache/cloudstack/pull/1500.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 #1500


commit 48ce76344040de2ab8014f76292abe0421d42f85
Author: Simon Weller 
Date:   2016-03-24T19:55:34Z

Merge pull request #4 from apache/4.7

4.7 PR

commit d0a02640dfd4878da81a2e59588c4b5ff2a06401
Author: Simon Weller 
Date:   2016-04-14T13:28:37Z

Let hypervisor type KVM detach root volumes

commit 7807955433cea390bb7358e3bb90dbc9cc06bbea
Author: David Mabry 
Date:   2016-04-15T12:30:07Z

updated test_volumes.py to include a test for detaching and reattaching a 
root volume from a vm.  I also had to update base.py to all attach_volume to 
have the parameter deviceid to be passed as needed.

commit d7d55630daff4a5e17c9a374dc2e9bc478dff808
Author: David Mabry 
Date:   2016-04-18T02:41:29Z

Added Simulator as valid hypervisor for root detach




> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CLOUDSTACK-9349) Unable to detach root volume when using Hypervisor Type KVM

2016-04-14 Thread Simon Weller (JIRA)

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

Simon Weller commented on CLOUDSTACK-9349:
--

Here's the commit: 
https://github.com/myENA/cloudstack/commit/d0a02640dfd4878da81a2e59588c4b5ff2a06401

We're going to complete some further testing prior to submitting a PR.



> Unable to detach root volume when using Hypervisor Type KVM
> ---
>
> Key: CLOUDSTACK-9349
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9349
> Project: CloudStack
>  Issue Type: Bug
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Volumes
>Affects Versions: 4.5.1, 4.6.2, 4.7.1, 4.8.0, 4.9.0
> Environment: Centos 7
>Reporter: Simon Weller
>Priority: Minor
> Fix For: 4.7.2
>
>
> Back in 4.5, support was added in CLOUDSTACK-6284 for detaching root volumes. 
> The original support was meant to work with Xen, VMware and KVM.
> After chatting with fuflo in the Cloudstack irc channel, it was pointed out 
> that a constraint was not correctly modified in VolumeApiServiceImpl.java to 
> allow the detach to occur when vm.getHypervisorType() == HypervisorType.KVM.
> This is a very useful feature, as it allows us to simulate a snapshot revert 
> with Ceph by using createVolume sourced from a snapshot, then detaching and 
> reattaching the root volume (new root volume needs to be attached as 
> device=0).
> I'm going to propose a PR for this shortly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)