[
https://issues.apache.org/jira/browse/CLOUDSTACK-9349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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-211377778
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 = 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
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
count = 1
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
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) 🐵 > start virtualmachine id=f2870d90-d294-474b-b7da-95bad01e6c09
accountid = 6b00c3ed-fc3f-11e5-9789-000c29b79f06
cmd = org.apache.cloudstack.api.command.admin.vm.StartVMCmdByAdmin
created = 2016-04-16T13:47:04-0500
jobid = e3c76fd4-1543-4480-9aac-0d8a0ada8763
jobinstanceid = f2870d90-d294-474b-b7da-95bad01e6c09
jobinstancetype = VirtualMachine
jobprocstatus = 0
jobresult:
virtualmachine:
id = f2870d90-d294-474b-b7da-95bad01e6c09
name = VM-f2870d90-d294-474b-b7da-95bad01e6c09
account = admin-2177
affinitygroup:
cpunumber = 1
cpuspeed = 500
created = 2016-04-14T07:54:23-0500
diskofferingid = 5cd05daa-9e18-4b52-90a7-534098f09b1a
diskofferingname = Small
displayname = VM-381
displayvm = True
domain = 2177
domainid = cf23158e-d33c-40c2-b176-0db4a163a93f
guestosid = 586974da-fc3f-11e5-9789-000c29b79f06
haenable = True
hostid = bf77a9df-6216-48fe-8eac-54540622965f
hostname = njcloudhost.dev.ena.net
hypervisor = KVM
instancename = i-7-42-VM
isdynamicallyscalable = False
jobid = e3c76fd4-1543-4480-9aac-0d8a0ada8763
jobstatus = 0
memory = 256
nic:
id = d37450f4-be55-4842-8ad5-e2bdc08a12d4
broadcasturi = vxlan://2378
gateway = 10.0.0.1
ipaddress = 10.0.0.168
isdefault = True
isolationuri = vxlan://2378
macaddress = 02:00:3e:41:00:0a
netmask = 255.255.255.0
networkid = 0eb4004f-38ce-4b90-a508-4ef73e837949
networkname = network-2177
secondaryip:
traffictype = Guest
type = Isolated
ostypeid = 246
passwordenabled = False
rootdeviceid = 0
rootdevicetype = ROOT
securitygroup:
serviceofferingid = b85e77fd-b897-4471-8fce-1190e71e5156
serviceofferingname = Small Instance
state = Running
tags:
templatedisplaytext = Base CentOS 7
templateid = cf02d86b-145b-4777-999c-7f37b16c945b
templatename = Linux_CentOS_7-Minimal
userid = ec083c86-e849-4b9d-bdc4-db80181d565e
username = [email protected]
zoneid = f58958e8-d24f-4a52-9a9f-8ae11cf4a3b0
zonename = Zone1
jobresultcode = 0
jobresulttype = object
jobstatus = 1
userid = 6b00cc09-fc3f-11e5-9789-000c29b79f06`
> 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)