@utils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
@utils.arg('volume', metavar='<volume>', help=_('ID of the volume to attach.'))
@utils.arg('device', metavar='<device>', default=None, nargs='?', help=_('Name of the device e.g. /dev/vdb. Use "auto" for autoassign (if supported). Libvirt driver will use default device name.'))
def do_volume_attach(cs, args):
 if (args.device == 'auto'):
  args.device = None
 volume = cs.volumes.create_server_volume(_find_server(cs, args.server).id, args.volume, args.device)
 _print_volume(volume)

@ utils . arg ( 'server' , metavar = '<server>' , help = _ ( 'Name or ID of server.' ) ) @ utils . arg ( 'volume' , metavar = '<volume>' , help = _ ( 'ID of the volume to attach.' ) ) @ utils . arg ( 'device' , metavar = '<device>' , default = None , nargs = '?' , help = _ ( 'Name of the device e.g. /dev/vdb. Use "auto" for autoassign (if supported). Libvirt driver will use default device name.' ) ) def do_volume_attach ( cs , args ) : if ( args . device == 'auto' ) : args . device = None volume = cs . volumes . create_server_volume ( _find_server ( cs , args . server ) . id , args . volume , args . device ) _print_volume ( volume )
attach a volume to a server .