    # File lib/fog/openstack/requests/compute/create_server.rb, line 6
            def create_server(name, image_ref, flavor_ref, options = {})
              data = {
                'server' => {
                  'flavorRef'  => flavor_ref,
                  'imageRef'   => image_ref,
                  'name'       => name
                }
              }

              vanilla_options = ['metadata', 'accessIPv4', 'accessIPv6',
                                 'availability_zone', 'user_data', 'key_name', 'adminPass']
              vanilla_options.select{|o| options[o]}.each do |key|
                data['server'][key] = options[key]
              end

              if options['security_groups']
                # security names requires a hash with a name prefix
                data['server']['security_groups'] =
                  Array(options['security_groups']).map do |sg|
                  name = if sg.is_a?(Fog::Compute::OpenStack::SecurityGroup) then
                           sg.name
                         else
                           sg
                         end
                  { :name => name }
                end
              end

              if options['personality']
                data['server']['personality'] = []
                for file in options['personality']
                  data['server']['personality'] << {
                    'contents'  => Base64.encode64(file['contents']),
                    'path'      => file['path']
                  }
                end
              end

              if options['os:scheduler_hints']
                data['os:scheduler_hints'] = options['os:scheduler_hints']
              end

              request(
                :body     => Fog::JSON.encode(data),
                :expects  => [200, 202],
                :method   => 'POST',
                :path     => 'servers.json'
              )
            end