telcat / vagrant-proxmox

Use Vagrant to manage Proxmox virtual machines
MIT License
374 stars 113 forks source link

Unable to authenticate with Proxmox VE 3.4 #21

Open EmmanuelKasper opened 9 years ago

EmmanuelKasper commented 9 years ago

On calling, vagrant up, I get an authentification error with:

vagrant up --provider=proxmox
Bringing machine 'box' up with 'proxmox' provider...
Unable to communicate with proxmox server:

VagrantPlugins::Proxmox::ApiError::UnauthorizedError

I get authenticate over curl and I get the required Proxmox API ticket:

curl -k -d "username=root@pam&password=foobar"  https://pve3.local:8006/api2/json/access/ticket 
{
   "data":{
      "cap":{
         "dc":{
            "Sys.Audit":1
         },
         "access":{
            "Group.Allocate":1,
            "User.Modify":1
         },
         "nodes":{
            "Sys.Audit":1,
            "Sys.Syslog":1,
            "Sys.Console":1,
            "Sys.Modify":1,
            "Sys.PowerMgmt":1
         },
         "vms":{
            "VM.Backup":1,
            "VM.Allocate":1,
            "VM.Config.CPU":1,
            "VM.Config.Network":1,
            "VM.Migrate":1,
            "VM.Config.Memory":1,
            "VM.Config.Options":1,
            "Permissions.Modify":1,
            "VM.Monitor":1,
            "VM.Console":1,
            "VM.Config.Disk":1,
            "VM.Config.HWType":1,
            "VM.Clone":1,
            "VM.Snapshot":1,
            "VM.Audit":1,
            "VM.PowerMgmt":1,
            "VM.Config.CDROM":1
         },
         "storage":{
            "Datastore.AllocateTemplate":1,
            "Datastore.Allocate":1,
            "Datastore.Audit":1,
            "Permissions.Modify":1,
            "Datastore.AllocateSpace":1
         }
      },
      "CSRFPreventionToken":"55966DA2:4L1k9Eifb3aZEf4RmTKhkiNjP7I",
      "ticket":"PVE:root@pam:55966DA2::VoCHYYymwSBbiujQ/v1PHuuv6wNRfMd8qRSasizml6mTNWGELMXVbv4CzIrbELHHYcjdvhwDYspmFJqRXfa+TelW97foAuosE/+GrU/cHPB52THjjffVk5/7AjG8QxdpdX+/7yMbgNjAjcd20HsPMNobSFbKeFbJJRLKLs8HN2yhK/zZkzx4OyntiJkm2vGGlnR+cAFIL0pzQlaXfP8+GyyHepvUSbN1ayjKal6LQ3uefFIfCNlbVzGaD7wfnU22Yo4JfkU8vQTXsFNi9LHooTjgcPOZy33/7mZZKI9EMMzHi0aqDewO9yzD6FugkTKB6FSeYFXMMKq/oQ86AjqJww==",
      "username":"root@pam"
   }
}

Here the relevant part of my Vagrantfile:

egrep '(endpoint|user_name|password)' Vagrantfile 
        proxmox.endpoint = 'https://pve3.local:8006/api2/json/'
        proxmox.user_name = 'root@pam'
        proxmox.password = 'foobar

Am using a wrong vagrant ( 1.6.5), a wrong PVE version, or missing something else ?

MauroCasula commented 8 years ago

Any news here? I'm getting this error too..

davidcunha commented 8 years ago

Hi,

I had the same problem in my current setup. Just change the proxmox.endpoint from 'https://pve3.local:8006/api2/json/' to 'https://pve3.local:8006/api2/json'

Cheers

devekko commented 8 years ago

I am getting a similar error

but changing the end-point doesnt work for me

INFO interface: error: Unable to communicate with proxmox server:

I blogged out my steps for this http://niccolox.org/compile-custom-vagrant-plugin-for-proxmox-provider/

VagrantPlugins::Proxmox::ApiError::UnauthorizedError Unable to communicate with proxmox server:

VagrantPlugins::Proxmox::ApiError::UnauthorizedError INFO interface: Machine: error-exit ["VagrantPlugins::Proxmox::Errors::CommunicationError", "Unable to communicate with proxmox server:\n\nVagrantPlugins::Proxmox::ApiError::UnauthorizedError"]

Vertikar commented 8 years ago

I've also run into this issue, changing the end-point doesn't help.

LinkMJB commented 8 years ago

To get around this you need to specify which source to lookup the user in. If the user is a local PAM user, then 'user@pam' format must be used. If user is PVE, then it must be 'user@pve'

t-chab commented 8 years ago

I have the same error with proxmox 4.2, and I don't have any / at endpoint end.

I have also set root@pam as user, without success.