def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
requires :flavor_id, :image_id, :location_id
options = {}
if identity.nil?
raise(ArgumentError, "password or public_key is required for this operation") if !password && !public_key
options['ssh_public_key'] = public_key if public_key
options['password'] = password if @password
end
if @lb_backends
options['lb_backends'] = lb_backends
elsif @lb_services
options['lb_services'] = lb_services
elsif @lb_applications
options['lb_applications'] = lb_applications
end
options['username'] = username
options['hostname'] = hostname if @hostname
data = connection.create_block(flavor_id, image_id, location_id, options)
merge_attributes(data.body)
true
end