def create_server
      @log.info "Creating new server..."

      memory = ((is_cloudsigma? and @appliance_config.hardware.memory < 512) ? 512 : @appliance_config.hardware.memory)

      body = hash_to_request(
          'name' => "#{@appliance_config.name}-#{@appliance_config.version}.#{@appliance_config.release}",
          'cpu' => @appliance_config.hardware.cpus * 1000, # MHz
          'smp' => 'auto',
          'mem' => memory,
          'persistent' => 'true', # hack
          'ide:0:0' => @plugin_config['drive_uuid'],
          'boot' => 'ide:0:0',
          'nic:0:model' => 'e1000',
          'nic:0:dhcp' => 'auto',
          'vnc:ip' => 'auto',
          'vnc:password' => (0...8).map { (('a'..'z').to_a + ('A'..'Z').to_a)[rand(52)] }.join # 8 character VNC password
      )

      begin
        path = is_cloudsigma? ? '/servers/create' : '/servers/create/stopped'
        ret = response_to_hash(RestClient.post(api_url(path), body))

        @log.info "Server was registered with '#{ret['name']}' name as '#{ret['server']}' UUID. Use web UI or API tools to start your server."
      rescue => e
        @log.error e.info
        raise PluginError, "An error occurred while creating the server, #{e.message}. See logs for more info."
      end
    end
def create_server
      @log.info "Creating new server..."

      memory = ((is_cloudsigma? and @appliance_config.hardware.memory < 512) ? 512 : @appliance_config.hardware.memory)

      body = hash_to_request(
          'name' => "#{@appliance_config.name}-#{@appliance_config.version}.#{@appliance_config.release}",
          'cpu' => @appliance_config.hardware.cpus * 1000, # MHz
          'smp' => 'auto',
          'mem' => memory,
          'persistent' => 'true', # hack
          'ide:0:0' => @plugin_config['drive_uuid'],
          'boot' => 'ide:0:0',
          'nic:0:model' => 'e1000',
          'nic:0:dhcp' => 'auto',
          'vnc:ip' => 'auto',
          'vnc:password' => (0...8).map { (('a'..'z').to_a + ('A'..'Z').to_a)[rand(52)] }.join # 8 character VNC password
      )

      begin
        path = is_cloudsigma? ? '/servers/create' : '/servers/create/stopped'
        ret = response_to_hash(RestClient.post(api_url(path), body))

        @log.info "Server was registered with '#{ret['name']}' name as '#{ret['server']}' UUID. Use web UI or API tools to start your server."
      rescue => e
        @log.error e.info
        raise PluginError, "An error occurred while creating the server, #{e.message}. See logs for more info."
      end
    end
Creates the server for previously uploaded disk