AppController/djinn.rb
# This method acquires virtual machines from a cloud IaaS and adds them
# to the currently running AppScale deployment. The new machines are then
# assigned the roles given to us by the caller.
# Args:
#   ips_to_roles: A Hash that maps machines to the roles that should be
#     started on them. As we have not yet spawned the machines, we do not
#     have IP addresses for them, so any unique identifier can be used in
#     lieu of IP addresses.
# Returns:
#   An Array of Strings, where each String contains information about the
#     public IP address, private IP address, and roles that the new machines
#     have taken on.
This method acquires virtual machines from a cloud IaaS and adds them
to the currently running AppScale deployment. The new machines are then
assigned the roles given to us by the caller.
Args:
ips_to_roles: A Hash that maps machines to the roles that should be
started on them. As we have not yet spawned the machines, we do not
have IP addresses for them, so any unique identifier can be used in
lieu of IP addresses.
Returns:
An Array of Strings, where each String contains information about the
public IP address, private IP address, and roles that the new machines
have taken on.
This method acquires virtual machines from a cloud IaaS and adds them to the currently running AppScale deployment . The new machines are then assigned the roles given to us by the caller . Args : ips_to_roles : A Hash that maps machines to the roles that should be started on them . As we have not yet spawned the machines we do not have IP addresses for them so any unique identifier can be used in lieu of IP addresses . Returns : An Array of Strings where each String contains information about the public IP address private IP address and roles that the new machines have taken on .
def start_new_roles_on_nodes_in_cloud(ips_to_roles)
    Djinn.log_info("Starting new roles in cloud with following info: " +
      "#{ips_to_roles.inspect}")
    num_of_vms = ips_to_roles.keys.length
    roles = ips_to_roles.values
    disks = Array.new(num_of_vms, nil)  
    Djinn.log_info("Need to spawn up #{num_of_vms} VMs")
    imc = InfrastructureManagerClient.new(@@secret)
    begin
      new_nodes_info = imc.spawn_vms(num_of_vms, @options, roles, disks)
    rescue FailedNodeException, AppScaleException => exception
      Djinn.log_error("Couldn't spawn #{num_of_vms} VMs with roles #{roles} " +
        "because: #{exception.message}")
      return []
    end
    Djinn.log_debug("info about new nodes is " +
      "[#{new_nodes_info.join(', ')}]")
    add_nodes(new_nodes_info)
    update_hosts_info()
    return new_nodes_info
  end
def start_new_roles_on_nodes_in_cloud ( ips_to_roles ) Djinn . log_info ( "Starting new roles in cloud with following info: " + "#{ips_to_roles.inspect}" ) num_of_vms = ips_to_roles . keys . length roles = ips_to_roles . values disks = Array . new ( num_of_vms , nil ) Djinn . log_info ( "Need to spawn up #{num_of_vms} VMs" ) imc = InfrastructureManagerClient . new ( @@secret ) begin new_nodes_info = imc . spawn_vms ( num_of_vms , @options , roles , disks ) rescue FailedNodeException , AppScaleException => exception Djinn . log_error ( "Couldn't spawn #{num_of_vms} VMs with roles #{roles} " + "because: #{exception.message}" ) return [ ] end Djinn . log_debug ( "info about new nodes is " + "[#{new_nodes_info.join(', ')}]" ) add_nodes ( new_nodes_info ) update_hosts_info ( ) return new_nodes_info end
This method acquires virtual machines from a cloud IaaS and adds them
to the currently running AppScale deployment.
This method acquires virtual machines from a cloud IaaS and adds them to the currently running AppScale deployment .
# no persistent disks # initialize them and wait for them to start up
ips_to_roles
<not_specific>