'compressed',
'force',
'nohdr',
+ 'nofmtdisk'
]
one_param_args = [
'chapsecret',
volume_info['easy_tier'] = 'off'
if 'rsize' in kwargs:
+ volume_info['formatted'] = 'no'
# Fake numbers
volume_info['used_capacity'] = '786432'
volume_info['real_capacity'] = '21474816'
volume_info['autoexpand'] = ''
volume_info['grainsize'] = ''
volume_info['compressed_copy'] = 'no'
+ volume_info['formatted'] = 'yes'
+ if 'nofmtdisk' in kwargs:
+ if kwargs['nofmtdisk']:
+ volume_info['formatted'] = 'no'
vol_cp = {'id': '0',
'status': 'online',
rows.append(['IO_group_name', vol['IO_group_name']])
rows.append(['status', 'online'])
rows.append(['capacity', cap])
- rows.append(['formatted', 'no'])
+ rows.append(['formatted', vol['formatted']])
rows.append(['mdisk_id', ''])
rows.append(['mdisk_name', ''])
rows.append(['FC_id', fcmap_info['fc_id']])
self.driver.check_for_setup_error)
self._reset_flags()
+ self._set_flag('storwize_svc_vol_rsize', 2)
+ self._set_flag('storwize_svc_vol_nofmtdisk', True)
+ self.assertRaises(exception.InvalidInput,
+ self.driver.check_for_setup_error)
+ self._reset_flags()
+
self._set_flag('storwize_svc_connection_protocol', 'foo')
self.assertRaises(exception.InvalidInput,
self.driver.check_for_setup_error)
'iogrp': 0,
'qos': None,
'replication': False,
- 'stretched_cluster': None}
+ 'stretched_cluster': None,
+ 'nofmtdisk': False}
return opt
@mock.patch.object(helpers.StorwizeHelpers, 'add_vdisk_qos')
# easytier False 2
# iogrp 0 1
# iogrp 1 2
+ # nofmtdisk False 1
+ # nofmtdisk True 1
opts_list = []
chck_list = []
opts_list.append({'rsize': -1, 'easytier': True, 'iogrp': 0})
chck_list.append({'free_capacity': '0', 'easy_tier': 'on',
'IO_group_id': '0'})
+
+ opts_list.append({'rsize': -1, 'nofmtdisk': False})
+ chck_list.append({'formatted': 'yes'})
+
+ opts_list.append({'rsize': -1, 'nofmtdisk': True})
+ chck_list.append({'formatted': 'no'})
+
test_iogrp = 1 if self.USESIM else 0
opts_list.append({'rsize': 2, 'compression': False, 'warning': 0,
'autoexpand': True, 'grainsize': 32,
'iogrp': config.storwize_svc_vol_iogrp,
'qos': None,
'stretched_cluster': cluster_partner,
- 'replication': False}
+ 'replication': False,
+ 'nofmtdisk': config.storwize_svc_vol_nofmtdisk}
return opt
@staticmethod
% {'iogrp': opts['iogrp'],
'avail': avail_grps})
+ if opts['nofmtdisk'] and opts['rsize'] != -1:
+ raise exception.InvalidInput(
+ reason=_('If nofmtdisk is set to True, rsize must '
+ 'also be set to -1.'))
+
def _get_opts_from_specs(self, opts, specs):
qos = {}
for k, value in specs.items():
@staticmethod
def _get_vdisk_create_params(opts):
easytier = 'on' if opts['easytier'] else 'off'
-
if opts['rsize'] == -1:
params = []
+ if opts['nofmtdisk']:
+ params.append('-nofmtdisk')
else:
params = ['-rsize', '%s%%' % str(opts['rsize']),
'-autoexpand', '-warning',