def create_disk(name, img, start, attempts)
      #create a new boot disk for this instance
      disk = execute( disk_insert_req( name, img['selfLink'] ), start, attempts )

      status = ''
      try = (Time.now - start) / SLEEPWAIT
      while status !~ /READY/ and try <= attempts
        begin
          disk = execute( disk_get_req( name ), start, attempts )
          status = disk['status']
        rescue GoogleComputeError => e
          @logger.debug("Waiting for #{name} disk creation")
          sleep(SLEEPWAIT)
        end
        try += 1
      end
      if status == ''
        raise "Unable to create disk #{name}"
      end
      disk
    end
def create_disk(name, img, start, attempts)
      #create a new boot disk for this instance
      disk = execute( disk_insert_req( name, img['selfLink'] ), start, attempts )

      status = ''
      try = (Time.now - start) / SLEEPWAIT
      while status !~ /READY/ and try <= attempts
        begin
          disk = execute( disk_get_req( name ), start, attempts )
          status = disk['status']
        rescue GoogleComputeError => e
          @logger.debug("Waiting for #{name} disk creation")
          sleep(SLEEPWAIT)
        end
        try += 1
      end
      if status == ''
        raise "Unable to create disk #{name}"
      end
      disk
    end
Create a Google Compute disk on the current connection

 @param [String] name The name of the disk to create

 @param [Hash] img The Google Compute image to use for instance creation

 @param [Integer] start The time when we started code execution, it is
 compared to Time.now to determine how many further code execution
 attempts remain

 @param [Integer] attempts The total amount of attempts to execute that we
 are willing to allow

 @raise [Exception] Raised if we fail create the disk, either through
 errors or running out of attempts