Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to LXC (proxmox4) #26

Merged
merged 5 commits into from
Mar 22, 2016
Merged

Adding support to LXC (proxmox4) #26

merged 5 commits into from
Mar 22, 2016

Conversation

antoinerrr
Copy link
Contributor

Little fix, not the best but it works,

New network configuration with lxc:

on your vagrant file:

proxmox.vm_type = :lxc
&
box.vm.network :public_network, ip: '10.150.170.237', interface: 'eth0', bridge: 'vmbr0', gw: '10.150.170.1'

Managing multiple interfaces does not work yet, do not hesitate to propose a fix

Issue: #25

@devekko
Copy link

devekko commented Jan 5, 2016

hi everyone

any chance these PR's could be accepted into the mainline?

would hate to have to for this provider !

@devekko
Copy link

devekko commented Jan 5, 2016

btw, for proxmox at ovh a mac address is required

I will compile this and try it

@antoinerrr
Copy link
Contributor Author

I'm using proxmox from ovh too and it work like a charm without any mac address, btw, no need to compile :)
Regards

@devekko
Copy link

devekko commented Jan 5, 2016

huh ! thanks for that info

@devekko
Copy link

devekko commented Jan 5, 2016

before I forget, is this OVH in France? I remember reading something about mac addresses not being needed in France... anyways, will test in BHS in comings days, maybe actually next week

@devekko
Copy link

devekko commented Jan 13, 2016

sorry, I had to compile the gem for vagrant from the fork

have I missed something?

@devekko
Copy link

devekko commented Jan 14, 2016

hi again

I built this gem and am trying lxc

am getting connection errors trying for OVH

this is my Vagrantfile

Vagrant.configure('2') do |config|

config.vm.provider :proxmox do |proxmox|
    proxmox.endpoint = 'https://159.39.33.153:8006/api2/json'
    proxmox.user_name = 'root@pam'
    proxmox.password = 'hjdfhfjdshfd'
    proxmox.vm_id_range = 900..999
    proxmox.vm_name_prefix = 'vagrant_'
    proxmox.openvz_os_template = '/var/lib/vz/template/cache/ubuntu-14.04-standard_14.04-1_amd64.tar.gz'
    proxmox.vm_type = :lxc
    proxmox.vm_memory = 512
end

config.vm.define :box, primary: true do |box|
    box.vm.box = 'dummy'    
    box.vm.network :public_network, ip: '145.4.191.18', interface: 'eth0', bridge: 'vmbr0', gw: '159.39.33.254'
end

end

I can test connect

curl -k -d "username=root@pam&password=hjdfhfjdshfd" https://159.39.33.153:8006/api2/json/access/ticket
{ "data": {
"CSRFPreventionToken":"4EEC61E2:lwk7od06fa1+DcPUwBTXCcndyAY",
"ticket":"PVE:root@pam:4EEC61E2::rsKoApxDTLYPn6H3NNT6iP2mv...",
"username":"root@pam"}
}

@antoinerrr
Copy link
Contributor Author

Built this gem ? Just add the plugin and change the file after (Check #25) What's your error ?

@devekko
Copy link

devekko commented Jan 14, 2016

hi, thanks for responding... I'll try the method above

I am on Ubuntu Trusty, are you using a Mac?

I actually tried to merge all repos and build a new plugin, vs modifying existing gem/ plugin source
http://niccolox.org/compile-custom-vagrant-plugin-for-proxmox-provider/

my error

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

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"]

@devekko
Copy link

devekko commented Jan 14, 2016

I actually got passed this error 400 which was erroneous
mitchellh/vagrant-aws#75 (comment)

there was a .vagrant folder created with failed attempts and so I

vagrant destroy -f (probably redundant)
rm -fR .vagrant

then vagrant up provider=proxmox works

now to the next error !

telcat pushed a commit that referenced this pull request Mar 22, 2016
Adding support to LXC (proxmox4)
@telcat telcat merged commit f87c076 into telcat:master Mar 22, 2016
@linuxmail
Copy link

hi,

I've installed via "vagrant plugin install vagrant-proxmox" (0.0.10) and tried also to create a lxc container on a ZPool. It works with qemu and this patch.
With LXC I can create containers via web, but not via Vagrant:


[...]
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<VagrantPlugins::Proxmox::Errors::CommunicationError: Unable to communicate with proxmox server:
Unable to create the virtual machine!
Cause: 400 Bad Request>
ERROR vagrant: Unable to communicate with proxmox server:
Unable to create the virtual machine!
Cause: 400 Bad Request
ERROR vagrant: /home/dfuchs
[...]
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
 INFO interface: error: Unable to communicate with proxmox server:
Unable to create the virtual machine!
Cause: 400 Bad Request
Unable to communicate with proxmox server:
Unable to create the virtual machine!
Cause: 400 Bad Request

My Vagrant file:

Vagrant.configure('2') do |config|
   config.vm.provider :proxmox do |proxmox|
      proxmox.endpoint = 'https://pmox-01.foobar:8006/api2/json'
      proxmox.user_name = 'zxy@pve'
      proxmox.password = 'xxxxxxxxx'
      proxmox.vm_id_range = 900..999
      proxmox.vm_name_prefix = 'vagrant_'
      proxmox.openvz_os_template = '/var/lib/vz/template/cache/lxc-template.tar.gz'
      proxmox.vm_type = :lxc
      proxmox.vm_memory = 512
   end

   config.vm.define :box, primary: true do |box|
      box.vm.box = 'dummy'
      box.vm.network :public_network, ip: '1.2.4.3', interface: 'eth0', bridge: 'vmbr1', gw: '1.2.4.254'
   end
end

On the PVE side, I don't find any logs, what is going wrong ...

any suggestions ?

cu denny

ThomasLamprecht added a commit to ThomasLamprecht/vagrant-proxmox that referenced this pull request Apr 12, 2016
The storage parameter is for the storage only, nothing more.
Use the rootfs parameter to correctly give the PVE API the disk size and the storage.

Addresses:
telcat#26 (comment)
GastonGonzalez pushed a commit to GastonGonzalez/vagrant-proxmox that referenced this pull request Dec 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants