@classmethod
  def spawn_node_in_cloud(cls, options):
    agent = InfrastructureAgentFactory.create_agent(options.infrastructure)
    params = agent.get_params_from_args(options)
    agent.configure_instance_security(params)
    instance_ids, public_ips, private_ips = agent.run_instances(count=1,
      parameters=params, security_configured=True)

    if options.static_ip:
      agent.associate_static_ip(params, instance_ids[0], options.static_ip)
      public_ips[0] = options.static_ip

    AppScaleLogger.log("Please wait for your instance to boot up.")
    cls.sleep_until_port_is_open(public_ips[0], cls.SSH_PORT, options.verbose)

    # Since GCE v1beta15, SSH keys don't immediately get injected to newly
    # spawned VMs. It takes around 30 seconds, so sleep a bit longer to be
    # sure.
    if options.infrastructure == 'gce':
      AppScaleLogger.log("Waiting for SSH keys to get injected to your "
        "machine.")
      time.sleep(60)

    cls.enable_root_login(public_ips[0], options.keyname,
      options.infrastructure, options.verbose)
    cls.copy_ssh_keys_to_node(public_ips[0], options.keyname, options.verbose)
    return instance_ids[0], public_ips[0], private_ips[0]
Starts a single virtual machine in a cloud infrastructure.
dataset/ETHPy150Open AppScale/appscale-tools/lib/remote_helper.py/RemoteHelper.spawn_node_in_cloud