You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Carlos Reategui <cr...@gmail.com> on 2014/08/08 02:40:14 UTC

Help: Can't start instances: Db_exn.Uniqueness_constraint_violation

CS 4.4 + XS6.2 hosts.

I had been successful at creating an instance earlier but now not able to
create a new instance.  In between I deleted my ubuntu template and
re-uploaded a new version and registered it with the same name.

The SMLog on the XS hosts shows the following:

Aug  8 05:05:26 noilabxen03 SM: [10585] ***** sr_scan: EXCEPTION
XenAPI.Failure, ['INTERNAL_ERROR', 'Db_exn.Uniqueness_constraint_viol
ation("VDI", "uuid", "4aa44b51-da99-3280-8223-e07ecfcf9d25")']
Aug  8 05:05:26 noilabxen03 SM: [10585]   File
"/opt/xensource/sm/SRCommand.py", line 106, in run
Aug  8 05:05:26 noilabxen03 SM: [10585]     return self._run_locked(sr)
Aug  8 05:05:26 noilabxen03 SM: [10585]   File
"/opt/xensource/sm/SRCommand.py", line 153, in _run_locked
Aug  8 05:05:26 noilabxen03 SM: [10585]     return self._run(sr, target)
Aug  8 05:05:26 noilabxen03 SM: [10585]   File
"/opt/xensource/sm/SRCommand.py", line 313, in _run
Aug  8 05:05:26 noilabxen03 SM: [10585]     return
sr.scan(self.params['sr_uuid'])
Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/FileSR",
line 192, in scan
Aug  8 05:05:26 noilabxen03 SM: [10585]     return super(FileSR,
self).scan(sr_uuid)
Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/SR.py",
line 310, in scan
Aug  8 05:05:26 noilabxen03 SM: [10585]     scanrecord.synchronise()
Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/SR.py",
line 566, in synchronise
Aug  8 05:05:26 noilabxen03 SM: [10585]     self.synchronise_new()
Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/SR.py",
line 546, in synchronise_new
Aug  8 05:05:26 noilabxen03 SM: [10585]     vdi._db_introduce()
Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/VDI.py",
line 298, in _db_introduce
Aug  8 05:05:26 noilabxen03 SM: [10585]     vdi =
self.sr.session.xenapi.VDI.db_introduce(uuid, self.label, self.description,
self.sr.
sr_ref, ty, self.shareable, self.read_only, {}, self.location, {},
sm_config, self.managed, str(self.size), str(self.utilisation), met
adata_of_pool, is_a_snapshot, xmlrpclib.DateTime(snapshot_time),
snapshot_of)
Aug  8 05:05:26 noilabxen03 SM: [10585]   File
"/usr/lib/python2.4/site-packages/XenAPI.py", line 245, in __call__
Aug  8 05:05:26 noilabxen03 SM: [10585]     return self.__send(self.__name,
args)
Aug  8 05:05:26 noilabxen03 SM: [10585]   File
"/usr/lib/python2.4/site-packages/XenAPI.py", line 149, in xenapi_request
Aug  8 05:05:26 noilabxen03 SM: [10585]     result =
_parse_result(getattr(self, methodname)(*full_params))
Aug  8 05:05:26 noilabxen03 SM: [10585]   File
"/usr/lib/python2.4/site-packages/XenAPI.py", line 219, in _parse_result
Aug  8 05:05:26 noilabxen03 SM: [10585]     raise
Failure(result['ErrorDescription'])
Aug  8 05:05:26 noilabxen03 SM: [10585]
Aug  8 05:05:26 noilabxen03 SM: [10585] Raising exception [40, The SR scan
failed  [opterr=['INTERNAL_ERROR', 'Db_exn.Uniqueness_const
raint_violation("VDI", "uuid", "4aa44b51-da99-3280-8223-e07ecfcf9d25")']]]
Aug  8 05:05:26 noilabxen03 SM: [10585] lock: closed
/var/lock/sm/adc8e2ee-0458-442f-bc5f-f047128f0659/sr

Re: Help: Can't start instances: Db_exn.Uniqueness_constraint_violation

Posted by Carlos Reategui <ca...@reategui.com>.
Trying to dig a bit deeper here:

[root@xen01 ~]# xe vdi-list uuid=4aa44b51-da99-3280-8223-e07ecfcf9d25
uuid ( RO)                : 4aa44b51-da99-3280-8223-e07ecfcf9d25
          name-label ( RW):
    name-description ( RW):
             sr-uuid ( RO): c1320c2d-2a51-4694-aae6-f2483b7e4767
        virtual-size ( RO): 10737418240
            sharable ( RO): false
           read-only ( RO): false


[root@xen01 ~]# xe sr-list uuid=c1320c2d-2a51-4694-aae6-f2483b7e4767
uuid ( RO)                : c1320c2d-2a51-4694-aae6-f2483b7e4767
          name-label ( RW):
9de22c30-e036-444d-a16a-ab8d761c034f/var/cloud_mount/0d6bd883-fffb-3586-9dae-98b2e64995f1/template/tmpl/2/202
    name-description ( RW):
9de22c30-e036-444d-a16a-ab8d761c034f/var/cloud_mount/0d6bd883-fffb-3586-9dae-98b2e64995f1/template/tmpl/2/202
                host ( RO): xen05
                type ( RO): file
        content-type ( RO): file

The SMLog from my previous email was from my host xen03.  So looks like
this uuid already existed on a different machine and it belongs to an SR
for secondary storage mount of my ubuntu template.  In looking across my
hosts, 3 of the 6 appear to have these.

I looked on xen05 for its SMLog and I am seeing the following that tells me
this vdi should have been detached.  Is this a XS bug or did CS not send
the proper command?

Aug  8 05:06:03 noilabxen05 SM: [31624] lock: acquired
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr
Aug  8 05:06:03 noilabxen05 SM: [31624] ['/usr/sbin/td-util', 'query',
'vhd', '-vpfb',
'/var/run/sr-mount/c1320c2d-2a51-4694-aae6-f2483b7e4767/4aa44b51-da99-3280-8223-e07ecfcf9d25.vhd']
Aug  8 05:06:03 noilabxen05 SM: [31624]   pread SUCCESS
Aug  8 05:06:03 noilabxen05 SM: [31624] lock: released
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr
Aug  8 05:06:03 noilabxen05 SM: [31624] vdi_deactivate {'sr_uuid':
'c1320c2d-2a51-4694-aae6-f2483b7e4767', 'subtask_of':
'DummyRef:|50682576-c63a-956b-4266-375f0ae12d9f|VDI.deactivate', 'vdi_ref
': 'OpaqueRef:c7d88b5a-ab50-8392-43df-f488083ac4df', 'vdi_on_boot':
'persist', 'args': [], 'vdi_location':
'4aa44b51-da99-3280-8223-e07ecfcf9d25', 'host_ref':
'OpaqueRef:35d15b41-acfd-b030-ef9f-
4f673895f81c', 'session_ref':
'OpaqueRef:43c4e410-4de6-030d-2333-0757c64945d0', 'device_config':
{'SRmaster': 'true', 'location':
'/var/cloud_mount/0d6bd883-fffb-3586-9dae-98b2e64995f1/template/
tmpl/2/202'}, 'command': 'vdi_deactivate', 'vdi_allow_caching': 'false',
'sr_ref': 'OpaqueRef:74d70344-975a-03ed-72da-2965c4e23d9c', 'vdi_uuid':
'4aa44b51-da99-3280-8223-e07ecfcf9d25'}
Aug  8 05:06:03 noilabxen05 SM: [31624] blktap2.deactivate
Aug  8 05:06:03 noilabxen05 SM: [31624] lock: acquired
/var/lock/sm/4aa44b51-da99-3280-8223-e07ecfcf9d25/vdi
Aug  8 05:06:04 noilabxen05 SM: [31624] unlink of attach_info failed
Aug  8 05:06:04 noilabxen05 SM: [31624] ['/usr/sbin/tap-ctl', 'close',
'-p', '29974', '-m', '0']
Aug  8 05:06:04 noilabxen05 SM: [31624]  = 0
Aug  8 05:06:04 noilabxen05 SM: [31624] ['/usr/sbin/tap-ctl', 'detach',
'-p', '29974', '-m', '0']
Aug  8 05:06:04 noilabxen05 SM: [31624]  = 0
Aug  8 05:06:04 noilabxen05 SM: [31624] ['/usr/sbin/tap-ctl', 'free', '-m',
'0']
Aug  8 05:06:04 noilabxen05 SM: [31624]  = 0
Aug  8 05:06:04 noilabxen05 SM: [31624] tap.deactivate: Shut down
Tapdisk(vhd:/var/run/sr-mount/c1320c2d-2a51-4694-aae6-f2483b7e4767/4aa44b51-da99-3280-8223-e07ecfcf9d25.vhd,
pid=29974, minor=0,
 state=R)
Aug  8 05:06:04 noilabxen05 SM: [31624] ['/usr/sbin/td-util', 'query',
'vhd', '-vpfb',
'/var/run/sr-mount/c1320c2d-2a51-4694-aae6-f2483b7e4767/4aa44b51-da99-3280-8223-e07ecfcf9d25.vhd']
Aug  8 05:06:04 noilabxen05 SM: [31624]   pread SUCCESS
Aug  8 05:06:04 noilabxen05 SM: [31624] Removed host key
host_OpaqueRef:35d15b41-acfd-b030-ef9f-4f673895f81c for
4aa44b51-da99-3280-8223-e07ecfcf9d25
Aug  8 05:06:04 noilabxen05 SM: [31624] lock: released
/var/lock/sm/4aa44b51-da99-3280-8223-e07ecfcf9d25/vdi
Aug  8 05:06:04 noilabxen05 SM: [31624] lock: closed
/var/lock/sm/4aa44b51-da99-3280-8223-e07ecfcf9d25/vdi
Aug  8 05:06:04 noilabxen05 SM: [31624] lock: closed
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr
Aug  8 05:06:04 noilabxen05 SM: [31624] lock: closed
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr
Aug  8 05:06:04 noilabxen05 SM: [31739] lock: acquired
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr
Aug  8 05:06:04 noilabxen05 SM: [31739] ['/usr/sbin/td-util', 'query',
'vhd', '-vpfb',
'/var/run/sr-mount/c1320c2d-2a51-4694-aae6-f2483b7e4767/4aa44b51-da99-3280-8223-e07ecfcf9d25.vhd']
Aug  8 05:06:05 noilabxen05 SM: [31739]   pread SUCCESS
Aug  8 05:06:05 noilabxen05 SM: [31739] vdi_detach {'sr_uuid':
'c1320c2d-2a51-4694-aae6-f2483b7e4767', 'subtask_of':
'DummyRef:|0f771d76-acfb-e867-f56a-83a94fbbd403|VDI.detach', 'vdi_ref':
'Opaq
ueRef:c7d88b5a-ab50-8392-43df-f488083ac4df', 'vdi_on_boot': 'persist',
'args': [], 'vdi_location': '4aa44b51-da99-3280-8223-e07ecfcf9d25',
'host_ref': 'OpaqueRef:35d15b41-acfd-b030-ef9f-4f673895
f81c', 'session_ref': 'OpaqueRef:a47b24bc-bd09-4fe3-993e-f9be47928d55',
'device_config': {'SRmaster': 'true', 'location':
'/var/cloud_mount/0d6bd883-fffb-3586-9dae-98b2e64995f1/template/tmpl/2/2
02'}, 'command': 'vdi_detach', 'vdi_allow_caching': 'false', 'sr_ref':
'OpaqueRef:74d70344-975a-03ed-72da-2965c4e23d9c', 'vdi_uuid':
'4aa44b51-da99-3280-8223-e07ecfcf9d25'}
Aug  8 05:06:05 noilabxen05 SM: [31739] lock: closed
/var/lock/sm/4aa44b51-da99-3280-8223-e07ecfcf9d25/vdi
Aug  8 05:06:05 noilabxen05 SM: [31739] lock: released
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr
Aug  8 05:06:05 noilabxen05 SM: [31739] lock: closed
/var/lock/sm/c1320c2d-2a51-4694-aae6-f2483b7e4767/sr








On Thu, Aug 7, 2014 at 5:40 PM, Carlos Reategui <cr...@gmail.com> wrote:

> CS 4.4 + XS6.2 hosts.
>
> I had been successful at creating an instance earlier but now not able to
> create a new instance.  In between I deleted my ubuntu template and
> re-uploaded a new version and registered it with the same name.
>
> The SMLog on the XS hosts shows the following:
>
> Aug  8 05:05:26 noilabxen03 SM: [10585] ***** sr_scan: EXCEPTION
> XenAPI.Failure, ['INTERNAL_ERROR', 'Db_exn.Uniqueness_constraint_viol
> ation("VDI", "uuid", "4aa44b51-da99-3280-8223-e07ecfcf9d25")']
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File
> "/opt/xensource/sm/SRCommand.py", line 106, in run
> Aug  8 05:05:26 noilabxen03 SM: [10585]     return self._run_locked(sr)
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File
> "/opt/xensource/sm/SRCommand.py", line 153, in _run_locked
> Aug  8 05:05:26 noilabxen03 SM: [10585]     return self._run(sr, target)
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File
> "/opt/xensource/sm/SRCommand.py", line 313, in _run
> Aug  8 05:05:26 noilabxen03 SM: [10585]     return
> sr.scan(self.params['sr_uuid'])
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/FileSR",
> line 192, in scan
> Aug  8 05:05:26 noilabxen03 SM: [10585]     return super(FileSR,
> self).scan(sr_uuid)
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/SR.py",
> line 310, in scan
> Aug  8 05:05:26 noilabxen03 SM: [10585]     scanrecord.synchronise()
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/SR.py",
> line 566, in synchronise
> Aug  8 05:05:26 noilabxen03 SM: [10585]     self.synchronise_new()
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/SR.py",
> line 546, in synchronise_new
> Aug  8 05:05:26 noilabxen03 SM: [10585]     vdi._db_introduce()
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File "/opt/xensource/sm/VDI.py",
> line 298, in _db_introduce
> Aug  8 05:05:26 noilabxen03 SM: [10585]     vdi =
> self.sr.session.xenapi.VDI.db_introduce(uuid, self.label, self.description,
> self.sr.
> sr_ref, ty, self.shareable, self.read_only, {}, self.location, {},
> sm_config, self.managed, str(self.size), str(self.utilisation), met
> adata_of_pool, is_a_snapshot, xmlrpclib.DateTime(snapshot_time),
> snapshot_of)
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File
> "/usr/lib/python2.4/site-packages/XenAPI.py", line 245, in __call__
> Aug  8 05:05:26 noilabxen03 SM: [10585]     return
> self.__send(self.__name, args)
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File
> "/usr/lib/python2.4/site-packages/XenAPI.py", line 149, in xenapi_request
> Aug  8 05:05:26 noilabxen03 SM: [10585]     result =
> _parse_result(getattr(self, methodname)(*full_params))
> Aug  8 05:05:26 noilabxen03 SM: [10585]   File
> "/usr/lib/python2.4/site-packages/XenAPI.py", line 219, in _parse_result
> Aug  8 05:05:26 noilabxen03 SM: [10585]     raise
> Failure(result['ErrorDescription'])
> Aug  8 05:05:26 noilabxen03 SM: [10585]
> Aug  8 05:05:26 noilabxen03 SM: [10585] Raising exception [40, The SR scan
> failed  [opterr=['INTERNAL_ERROR', 'Db_exn.Uniqueness_const
> raint_violation("VDI", "uuid", "4aa44b51-da99-3280-8223-e07ecfcf9d25")']]]
> Aug  8 05:05:26 noilabxen03 SM: [10585] lock: closed
> /var/lock/sm/adc8e2ee-0458-442f-bc5f-f047128f0659/sr
>
>