openvstorage / framework

The Framework is a set of components and tools which brings the user an interface (GUI / API) to setup, extend and manage an Open vStorage platform.
Other
27 stars 23 forks source link

Wrong offset calculation for partitioning #1095

Closed JeffreyDevloo closed 7 years ago

JeffreyDevloo commented 7 years ago

Problem description

On one of our environments I found a wrong offset calculation proposed by the GUI. Prior to the reinstall, the environment was installed around 11-10 (did not log the packages before reinstalling)

The disk I was trying to configure was a ssd.

Screenshot before the reinstall screenshot from 2016-10-27 11-45-31

Screenshot after the reinstall screenshot from 2016-10-27 14-19-16 There is a clear difference between this one and the one before the reinstall. The root partition isn't displayed as big as it is (100GB).

Tried to add roles to sda selection_027

Workers.log

2016-10-27 14:16:43 17300 +0200 - cmp01 - 15591/140302246328128 - lib/ensure single - 18 - ERROR - Ensure single CHAINED mode - ID 1477570600_0EbMaZqtcM - Task ovs.storag
erouter.configure_disk with params {'partition_guid': None, 'roles': [u'DB', u'READ', u'WRITE'], 'disk_guid': u'd76594f8-aef0-467b-973c-1b84725c580e', 'storagerouter_guid
': '3bb54d81-e362-4fc0-b6b7-19b738c86d7f', 'offset': 40810577920, 'size': 225485783040} failed
Traceback (most recent call last):
  File "/opt/OpenvStorage/ovs/lib/helpers/decorators.py", line 305, in new_function
    output = function(*args, **kwargs)
  File "/opt/OpenvStorage/ovs/lib/storagerouter.py", line 1710, in configure_disk
    partition_size=size)
  File "/usr/lib/python2.7/dist-packages/rpyc/core/netref.py", line 196, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/rpyc/core/netref.py", line 71, in syncreq
    return conn.sync_request(handler, oid, *args)
  File "/usr/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 441, in sync_request
    raise obj
CalledProcessError: Command 'parted /dev/disk/by-path/pci-0000:01:00.0-scsi-0:0:0:0 -a optimal -s mkpart pci-0000:01:00.0-scsi-0:0:0:0 14% 89%' returned non-zero exit sta
tus 1

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/tmp/tmp.wjK39pedfC/rpyc/core/protocol.py", line 305, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/tmp/tmp.wjK39pedfC/rpyc/core/protocol.py", line 535, in _handle_call
    return self._local_objects[oid](*args, **dict(kwargs))
  File "/opt/OpenvStorage/ovs/extensions/generic/disk.py", line 81, in create_partition
    check_output(command, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command 'parted /dev/disk/by-path/pci-0000:01:00.0-scsi-0:0:0:0 -a optimal -s mkpart pci-0000:01:00.0-scsi-0:0:0:0 14% 89%' returned non-zero exit status 1
2016-10-27 14:16:43 17600 +0200 - cmp01 - 15591/140302246328128 - lib/ensure single - 19 - INFO - Ensure single CHAINED mode - ID 1477570600_0EbMaZqtcM - Amount of jobs pending for key ovs_ensure_single_ovs.storagerouter.configure_disk: 0
2016-10-27 14:16:43 18300 +0200 - cmp01 - 15563/140302246328128 - celery/celery.worker.job - 50 - ERROR - Task ovs.storagerouter.configure_disk[916f7884-5b0b-4803-8066-6e125dd85d2e] raised unexpected: CalledProcessError()
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/OpenvStorage/ovs/lib/helpers/decorators.py", line 305, in new_function
    output = function(*args, **kwargs)
  File "/opt/OpenvStorage/ovs/lib/storagerouter.py", line 1710, in configure_disk
    partition_size=size)
  File "/usr/lib/python2.7/dist-packages/rpyc/core/netref.py", line 196, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/rpyc/core/netref.py", line 71, in syncreq
    return conn.sync_request(handler, oid, *args)
  File "/usr/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 441, in sync_request
    raise obj
Exception

Manual execution of the failed command:

root@cmp01:~# parted /dev/disk/by-path/pci-0000:01:00.0-scsi-0:0:0:0 -a optimal -s mkpart pci-0000:01:00.0-scsi-0:0:0:0 14% 89%
Error: You requested a partition from 42.0GB to 267GB.
The closest location we can manage is 141GB to 267GB.

lsblk output

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 279.5G  0 disk 
├─sda1   8:1    0     1G  0 part /boot
├─sda2   8:2    0    30G  0 part [SWAP]
└─sda3   8:3    0   100G  0 part /
sdb      8:16   0 447.1G  0 disk 
sdc      8:32   0 447.1G  0 disk 
sdd      8:48   0 447.1G  0 disk 
sde      8:64   0 447.1G  0 disk 
sdf      8:80   0 447.1G  0 disk 
sdg      8:96   0 447.1G  0 disk 
sdh      8:112  0 372.6G  0 disk

Lsblk clearly sees a bigger partition than the GUI proposed.

Possible problem

The reinstall introduced the new disk detection upgrade with the aliases. There must have a been an oversight with the offset calculation.

Packages

khenderick commented 7 years ago

Might be duplicated by #1164, I'm going to put this one to state_verification

JeffreyDevloo commented 7 years ago

Edit: had another ticket in my mind. They most likely are related.

kinvaris commented 7 years ago

PASSED: We've upgraded our new OVH environment to Fargo, refreshed the disks.