def provision
      attempts = @options[:timeout].to_i / SLEEPWAIT
      start = Time.now

      test_group_identifier = "beaker-#{start.to_i}-"

      # get machineType resource, used by all instances
      machineType = @gce_helper.get_machineType(start, attempts)

      # set firewall to open pe ports
      network = @gce_helper.get_network(start, attempts)
      @firewall = test_group_identifier + generate_host_name
      @gce_helper.create_firewall(@firewall, network, start, attempts)

      @logger.debug("Created Google Compute firewall #{@firewall}")


      @hosts.each do |host|
        if host[:image]
          gplatform = host[:image]
        elsif host[:platform]
          gplatform = Platform.new(host[:platform])
        else
          raise('You must specify either :image or :platform, or both as necessary')
        end

        img = @gce_helper.get_latest_image(gplatform, start, attempts)

        unique_host_id = test_group_identifier + generate_host_name

        host['diskname'] = unique_host_id
        disk = @gce_helper.create_disk(host['diskname'], img, start, attempts)
        @logger.debug("Created Google Compute disk for #{host.name}: #{host['diskname']}")

        # create new host name
        host['vmhostname'] = unique_host_id
        #add a new instance of the image
        instance = @gce_helper.create_instance(host['vmhostname'], img, machineType, disk, start, attempts)
        @logger.debug("Created Google Compute instance for #{host.name}: #{host['vmhostname']}")

        # add metadata to instance, if there is any to set
        mdata = format_metadata
        unless mdata.empty?
          @gce_helper.setMetadata_on_instance(host['vmhostname'], instance['metadata']['fingerprint'],
                                              mdata,
                                              start, attempts)
          @logger.debug("Added tags to Google Compute instance #{host.name}: #{host['vmhostname']}")
        end

        # get ip for this host
        host['ip'] = instance['networkInterfaces'][0]['accessConfigs'][0]['natIP']

        # configure ssh
        default_user = host['user']
        host['user'] = 'google_compute'

        copy_ssh_to_root(host, @options)
        enable_root_login(host, @options)
        host['user'] = default_user

        # shut down connection, will reconnect on next exec
        host.close

        @logger.debug("Instance ready: #{host['vmhostname']} for #{host.name}}")
      end
    end
def provision
      attempts = @options[:timeout].to_i / SLEEPWAIT
      start = Time.now

      test_group_identifier = "beaker-#{start.to_i}-"

      # get machineType resource, used by all instances
      machineType = @gce_helper.get_machineType(start, attempts)

      # set firewall to open pe ports
      network = @gce_helper.get_network(start, attempts)
      @firewall = test_group_identifier + generate_host_name
      @gce_helper.create_firewall(@firewall, network, start, attempts)

      @logger.debug("Created Google Compute firewall #{@firewall}")


      @hosts.each do |host|
        if host[:image]
          gplatform = host[:image]
        elsif host[:platform]
          gplatform = Platform.new(host[:platform])
        else
          raise('You must specify either :image or :platform, or both as necessary')
        end

        img = @gce_helper.get_latest_image(gplatform, start, attempts)

        unique_host_id = test_group_identifier + generate_host_name

        host['diskname'] = unique_host_id
        disk = @gce_helper.create_disk(host['diskname'], img, start, attempts)
        @logger.debug("Created Google Compute disk for #{host.name}: #{host['diskname']}")

        # create new host name
        host['vmhostname'] = unique_host_id
        #add a new instance of the image
        instance = @gce_helper.create_instance(host['vmhostname'], img, machineType, disk, start, attempts)
        @logger.debug("Created Google Compute instance for #{host.name}: #{host['vmhostname']}")

        # add metadata to instance, if there is any to set
        mdata = format_metadata
        unless mdata.empty?
          @gce_helper.setMetadata_on_instance(host['vmhostname'], instance['metadata']['fingerprint'],
                                              mdata,
                                              start, attempts)
          @logger.debug("Added tags to Google Compute instance #{host.name}: #{host['vmhostname']}")
        end

        # get ip for this host
        host['ip'] = instance['networkInterfaces'][0]['accessConfigs'][0]['natIP']

        # configure ssh
        default_user = host['user']
        host['user'] = 'google_compute'

        copy_ssh_to_root(host, @options)
        enable_root_login(host, @options)
        host['user'] = default_user

        # shut down connection, will reconnect on next exec
        host.close

        @logger.debug("Instance ready: #{host['vmhostname']} for #{host.name}}")
      end
    end
Create a new instance of the Google Compute Engine hypervisor object

 @param [<Host>] google_hosts The Array of google hosts to provision, may
 ONLY be of platforms /centos-*/, /debian-*/, /rhel-*/, /suse-*/. Only
 supports the Google Compute provided templates.

 @param [Hash{Symbol=>String}] options The options hash containing
 configuration values @option options [String] :gce_project The Google
 Compute Project name to connect to

 @option options [String] :gce_keyfile The location of the Google Compute
 service account keyfile

 @option options [String] :gce_password The password for the Google Compute
 service account key

 @option options [String] :gce_email The email address for the Google
 Compute service account

 @option options [String] :gce_machine_type A Google Compute machine type
 used to create instances, defaults to n1-highmem-2

 @option options [Integer] :timeout The amount of time to attempt execution
 before quiting and exiting with failure
 Create and configure virtual machines in the Google Compute Engine,
 including their associated disks and firewall rules