Method: Fog::Compute::VirtualBox::Server#save

Defined in:
lib/rackspace-fog/virtual_box/models/compute/server.rb

#saveObject



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/rackspace-fog/virtual_box/models/compute/server.rb', line 137

def save
  unless identity
    requires :name, :os
    self.raw = connection.create_machine(nil, name, os)
    connection.register_machine(raw)
    with_session do |session|
      for attribute in [:description, :memory_size, :rtc_use_utc, :vram_size]
        session.machine.send(:"#{attribute}=", attributes[attribute])
      end
      session.machine.save_settings
    end
    true
  else
    raise Fog::Errors::Error.new('Updating an existing server is not yet implemented. Contributions welcome!')
  end
end