60: def volumes_attach
61: @option.device ||= "/dev/sdh"
62: raise "Volume #{@argv.volid} does not exist" unless Rudy::AWS::EC2::Volumes.exists?(@argv.volid)
63: raise "Volume #{@argv.volid} is already attached" if Rudy::AWS::EC2::Volumes.attached?(@argv.volid)
64: raise "Instance #{@option.instance} does not exist" unless Rudy::AWS::EC2::Instances.exists?(@option.instance)
65:
66: li "Attaching #{@argv.volid} to #{@option.instance} on #{@option.device}"
67: execute_check(:low)
68: execute_action("Attach Failed") {
69: Rudy::AWS::EC2::Volumes.attach(@argv.volid, @option.instance, @option.device)
70: }
71:
72: vol = Rudy::AWS::EC2::Volumes.get(@argv.volid)
73: li @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
74: end