openvstorage / alba-asdmanager

The ALBA ASD manager is a lightweight library which turns devices into disks which are addressable as key/value disk over an IP and port.
Other
1 stars 3 forks source link

Detect AWS disks #325

Closed JeffreyDevloo closed 6 years ago

JeffreyDevloo commented 6 years ago

Problem description

The disks of an AWS node do not have any id associated with them. AWS ensures that the diskname stays the same. The Framework is currently unable to work with only the diskname. We should detect and assume it is an AWS in that case.

Sync disk logging:

Configuration dict with all disk information:
{'xvda': {'aliases': ['/dev/xvda'],
   'is_ssd': True,
   'model': None,
   'name': 'xvda',
   'partitions': [{'aliases': ['/dev/disk/by-label/cloudimg-rootfs'],
     'filesystem': 'ext4',
     'mountpoint': '/',
     'offset': 1048576,
     'size': 8588869120,
     'state': 'FAILURE'}],
   'serial': None,
   'size': 8589934592,
   'state': 'OK'},
  'xvdb': {'aliases': ['/dev/xvdb'],
   'is_ssd': True,
   'model': None,
   'name': 'xvdb',
   'partitions': [{'aliases': ['/dev/disk/by-partlabel/xvdb'],
     'filesystem': 'xfs',
     'mountpoint': None,
     'offset': 2097152,
     'size': 2000384163840,
     'state': 'OK'}],
   'serial': None,
   'size': 2000387309568,
   'state': 'OK'},
  'xvdc': {'aliases': ['/dev/xvdc'],
   'is_ssd': True,
   'model': None,
   'name': 'xvdc',
   'partitions': [],
   'serial': None,
   'size': 2000387309568,
   'state': 'OK'},
  'xvdd': {'aliases': ['/dev/xvdd'],
   'is_ssd': True,
   'model': None,
   'name': 'xvdd',
   'partitions': [{'aliases': ['/dev/disk/by-partlabel/xvdd'],
     'filesystem': 'xfs',
     'mountpoint': '/mnt/alba-asd/2LDJKAd2DW1Tj6sh',
     'offset': 2097152,
     'size': 2000384163840,
     'state': 'FAILURE'}],
   'serial': None,
   'size': 2000387309568,
   'state': 'OK'},
  'xvde': {'aliases': ['/dev/xvde'],
   'is_ssd': True,
   'model': None,
   'name': 'xvde',
   'partitions': [{'aliases': ['/dev/disk/by-partlabel/xvde'],
     'filesystem': None,
     'mountpoint': None,
     'offset': 2097152,
     'size': 2000384163840,
     'state': 'OK'}],
   'serial': None,
   'size': 2000387309568,
   'state': 'OK'},
  'xvdf': {'aliases': ['/dev/xvdf'],
   'is_ssd': True,
   'model': None,
   'name': 'xvdf',
   'partitions': [],
   'serial': None,
   'size': 2000387309568,
   'state': 'OK'},
  'xvdg': {'aliases': ['/dev/xvdg'],
   'is_ssd': True,
   'model': None,
   'name': 'xvdg',
   'partitions': [{'aliases': ['/dev/disk/by-partlabel/xvdg'],
     'filesystem': None,
     'mountpoint': None,
     'offset': 2097152,
     'size': 2000384163840,
     'state': 'OK'}],
   'serial': None,
   'size': 2000387309568,
   'state': 'OK'},
  'xvdh': {'aliases': ['/dev/xvdh'],
   'is_ssd': True,
   'model': None,
   'name': 'xvdh',
   'partitions': [],
   'serial': None,
   'size': 107374182400,
   'state': 'OK'}}
Name alias mapping:
 {'/dev/xvda1': ['/dev/disk/by-label/cloudimg-rootfs'],
  '/dev/xvdb1': ['/dev/disk/by-partlabel/xvdb'],
  '/dev/xvdd1': ['/dev/disk/by-partlabel/xvdd'],
  '/dev/xvde1': ['/dev/disk/by-partlabel/xvde'],
  '/dev/xvdg1': ['/dev/disk/by-partlabel/xvdg']}
Alias name mapping:
 {'/dev/disk/by-label/cloudimg-rootfs': '/dev/xvda1',
  '/dev/disk/by-partlabel/xvdb': '/dev/xvdb1',
  '/dev/disk/by-partlabel/xvdd': '/dev/xvdd1',
  '/dev/disk/by-partlabel/xvde': '/dev/xvde1',
  '/dev/disk/by-partlabel/xvdg': '/dev/xvdg1'})
wimpers commented 6 years ago

@JeffreyDevloo any chance we can use a fake disk by id (something we set manually)?

JeffreyDevloo commented 6 years ago

You could try udev rules. Ask @jtorreke for an example

sjovdnbos commented 6 years ago

Can be closed as fixed since https://github.com/openvstorage/framework/issues/2023 is fixed