Method: KnifeCloudstack::CsServerStart#run

Defined in:
lib/chef/knife/cs_server_start.rb

#runObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/chef/knife/cs_server_start.rb', line 50

def run

  @name_args.each do |hostname|
    server = connection.get_server(hostname)

    if !server then
      ui.error("Server '#{hostname}' not found")
      next
    end

    puts "\n"
    msg("Name", server['name'])
    msg("Public IP", connection.get_server_public_ip(server) || '?')
    msg("Service", server['serviceofferingname'])
    msg("Template", server['templatename'])
    msg("Domain", server['domain'])
    msg("Zone", server['zonename'])
    msg("State", server['state'])

    puts "\n"
    ui.confirm("Do you really want to start this server")

    print "#{ui.color("Waiting for startup", :magenta)}"
    connection.start_server(hostname)
    puts "\n"
    ui.msg("Started server #{hostname}")
  end

end