lib/openstack/compute/server.rb
# The rebuild function removes all data on the server and replaces it with
# the specified image. The serverRef and all IP addresses will remain the
# same. If name and metadata are specified, they will replace existing
# values, otherwise they will not change. A rebuild operation always
# removes data injected into the file system via server personality. You
# may reinsert data into the filesystem during the rebuild.
#
# This method expects a hash of the form:
# {
#   :imageRef => "https://foo.com/v1.1/images/2",
#   :name => "newName",
#   :metadata => { :values => { :foo : "bar" } },
#   :personality => [
#     {
#       :path => "/etc/banner.txt",
#       :contents => : "ICAgpY2hhcmQgQmFjaA=="
#     }
#   ]
# }
#
# This will wipe and rebuild the server, but keep the server ID number,
# name, and IP addresses the same.
#
# Returns true if the API call succeeds.
#
#   >> server.rebuild!
#   => true
The rebuild function removes all data on the server and replaces it with
the specified image. The serverRef and all IP addresses will remain the
same. If name and metadata are specified, they will replace existing
values, otherwise they will not change. A rebuild operation always
removes data injected into the file system via server personality. You
may reinsert data into the filesystem during the rebuild.



This will wipe and rebuild the server, but keep the server ID number,
name, and IP addresses the same.

Returns true if the API call succeeds.


The rebuild function removes all data on the server and replaces it with the specified image . The serverRef and all IP addresses will remain the same . If name and metadata are specified they will replace existing values otherwise they will not change . A rebuild operation always removes data injected into the file system via server personality . You may reinsert data into the filesystem during the rebuild . This will wipe and rebuild the server but keep the server ID number name and IP addresses the same . Returns true if the API call succeeds .
def rebuild!(options)
      options[:personality] = Personalities.get_personality(options[:personality])
      json = JSON.generate(:rebuild => options)
      response = @compute.connection.req('POST', "/servers/#{@id}/action", :data => json)
      OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
      data = JSON.parse(response.body)['server']
      self.populate(data)
      self.adminPass = data['adminPass'] if data['adminPass']
      true
    end
def rebuild! ( options ) options [ :personality ] = Personalities . get_personality ( options [ :personality ] ) json = JSON . generate ( :rebuild => options ) response = @compute . connection . req ( 'POST' , "/servers/#{@id}/action" , :data => json ) OpenStack :: Exception . raise_exception ( response ) unless response . code . match ( / ^20.$ / ) data = JSON . parse ( response . body ) [ 'server' ] self . populate ( data ) self . adminPass = data [ 'adminPass' ] if data [ 'adminPass' ] true end
The rebuild function removes all data on the server and replaces it with
the specified image.
The rebuild function removes all data on the server and replaces it with the specified image .
options