3par attach fails for volume created from snapshot

Bug #1207913 reported by Walt Boring
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Critical
Kurt Martin

Bug Description

When you create a snapshot of a volume using 3par backend. Then create a volume from that snapshot. Then try to attach that new volume, it fails.

2013-08-02 15:12:53.441 ERROR cinder.openstack.common.rpc.amqp [req-c8915666-c584-40a1-ae79-167d6c36efac 5e309ff09aee4fb58e6487327bbdd417 0537f231aa7c46c28f9af735d631701e] Exception during message handling
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp Traceback (most recent call last):
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/openstack/common/rpc/amqp.py", line 433, in _process_data
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp **args)
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/openstack/common/rpc/dispatcher.py", line 148, in dispatch
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/manager.py", line 780, in initialize_connection
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp return self.driver.initialize_connection(volume_ref, connector)
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/openstack/common/lockutils.py", line 233, in inner
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp retval = f(*args, **kwargs)
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/drivers/san/hp/hp_3par_fc.py", line 174, in initialize_connection
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp self.common.client_login()
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/drivers/san/hp/hp_3par_fc.py", line 222, in _create_host
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp hostname = self.common._safe_hostname(connector['host'])
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/drivers/san/hp/hp_3par_common.py", line 189, in get_domain
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp raise exception.InvalidInput(reason=err)
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp InvalidInput: Invalid input received: Failed to get domain because CPG (None) doesn't exist on array.
2013-08-02 15:12:53.441 TRACE cinder.openstack.common.rpc.amqp

The problem is due to the fact that the volume information doesn't contain a CPG if it was created from a snapshot. The volume metadata only contains snapCPG.

The driver needs to trap for this exception and then use the snapCPG if the userCPG doesn't exist.

Tags: 3par cinder
Revision history for this message
Michael Denny (michael-denny) wrote :

Seems with MU 2 createvvcopy has -online option
 createvvcopy -p <parent_volume> -online [-snp_cpg <snap_cpg>] [-tpvv] <destination cpg>
<destination volume>

    -online
        Specifies that the copy is to be performed online. This means that the
        destination can be immediately exported and is automatically created by
        this command, meaning that it cannot exist prior to executing this
        command. This option requires the specification of a CPG for the
        destination volume and allows for the -snp_cpg and -tpvv optional
        options. Finally, -online requires the -p option and is incompatible
        with the -r, -halt, -s, -b, and -pri options.

Not sure if -online is default behavior asking Howard Hui

Changed in cinder:
assignee: Viraj Hardikar (viraj-hardikar-n) → Kurt Martin (kurt-f-martin)
Changed in cinder:
status: New → Confirmed
Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/40496

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/40496
Committed: http://github.com/openstack/cinder/commit/4f622b2a88e1bcb5808540226608095db079ba9e
Submitter: Jenkins
Branch: master

commit 4f622b2a88e1bcb5808540226608095db079ba9e
Author: Kurt Martin <email address hidden>
Date: Tue Aug 6 13:25:36 2013 -0700

    3PAR volumes created from snaps failed to attach

    An error would occur if you attempted to attach a volume that
    was created from a snapshot. The 3PAR backends does not have a
    'userCPG' entry in the volume data on the backend, it instead
    has a 'snapCPG' field. This patch will now look for the 'snapCPG'
    entry and use that CPG when attaching the volume created from a
    snapshot.

    Change-Id: Ic7dab730a68339edb4273e4fbb6f8e45e37808b3
    Fixes: bug 1207913

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.