def vgcreate(vgname, devices, **kwargs):
 if ((not vgname) or (not devices)):
  return 'Error: vgname and device(s) are both required'
 if isinstance(devices, six.string_types):
  devices = devices.split(',')
 cmd = ['vgcreate', vgname]
 for device in devices:
  cmd.append(device)
 valid = ('clustered', 'maxlogicalvolumes', 'maxphysicalvolumes', 'vgmetadatacopies', 'metadatacopies', 'physicalextentsize')
 for var in kwargs:
  if (kwargs[var] and (var in valid)):
   cmd.append('--{0}'.format(var))
   cmd.append(kwargs[var])
 out = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
 vgdata = vgdisplay(vgname)
 vgdata['Output from vgcreate'] = out[0].strip()
 return vgdata

def vgcreate ( vgname , devices , ** kwargs ) : if ( ( not vgname ) or ( not devices ) ) : return 'Error: vgname and device(s) are both required' if isinstance ( devices , six . string_types ) : devices = devices . split ( ',' ) cmd = [ 'vgcreate' , vgname ] for device in devices : cmd . append ( device ) valid = ( 'clustered' , 'maxlogicalvolumes' , 'maxphysicalvolumes' , 'vgmetadatacopies' , 'metadatacopies' , 'physicalextentsize' ) for var in kwargs : if ( kwargs [ var ] and ( var in valid ) ) : cmd . append ( '--{0}' . format ( var ) ) cmd . append ( kwargs [ var ] ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . splitlines ( ) vgdata = vgdisplay ( vgname ) vgdata [ 'Output from vgcreate' ] = out [ 0 ] . strip ( ) return vgdata
create an lvm volume group cli examples: .