Giter Site home page Giter Site logo

theforeman / foreman_fog_proxmox Goto Github PK

View Code? Open in Web Editor NEW
102.0 24.0 30.0 10.82 MB

Foreman plugin to add Proxmox compute resource based on fog-proxmox gem

License: GNU General Public License v3.0

Ruby 77.21% HTML 16.05% Makefile 0.47% JavaScript 6.14% CSS 0.12%
foreman foreman-proxmox foreman-plugins fog-computing fog cloud cloud-computing proxmox proxmox-ve fog-proxmox

foreman_fog_proxmox's Introduction

ForemanFogProxmox

CI Maintainability Test Coverage Gem Version

ForemanFogProxmox

Foreman plugin that adds Proxmox compute resource: managing virtual machines and containers using the fog-proxmox module.

It is intended to satisfy this feature.

If you like it and need more features you can contribute or simply support it:

Support

You can support the plugin development via the following methods:

Compatibility versions

Fog-proxmox Proxmox Foreman-fog-proxmox Foreman Ruby
<0.6 <5.3 <0.6 <=1.20 >=2.3
=0.6 <5.4 =0.6 =1.21 >=2.3
<=0.8 <6.0 >=0.7 >=1.22 >=2.3
<0.9 <6.0 =0.9 >=1.22 >=2.3
>=0.9 >=5.4 >=0.9.1 >=1.22 >=2.3
>=0.10 >=5.4 >=0.9.4 >=1.22 >=2.5
>=0.11 >=5.4 >=0.10 >=1.22 >=2.5
>=0.12 >=6.1 >=0.11 >=2.0 >=2.5
>=0.14 >=6.2 =0.13.0 >=2.4 >=2.7
>=0.14 >=6.2 >=0.13.1 >=2.3 >=2.5
>=0.14 >=6.2 >=0.14.0 >=2.5 >=2.5

Installation

From OS packages (required)

Please see the Foreman manual for complete instructions:

Install from package is the easiest way to install the plugin. Choose the latest release plugins repository. If you don't find it in the same foreman release repository, get it from the nightly repository.

Then you can install it with the package manager, in Debian/Ubuntu:

sudo apt-get install ruby-foreman-fog-proxmox

and in Fedora/Redhat Linux:

sudo dnf install rubygem-foreman_fog_proxmox

Redhat, CentOS or Fedora users should also setup Selinux to allow foreman and all its plugins to work.

From gem

See complete details in plugin installation from gem

Here is a Debian sample:

sudo apt install -y foreman foreman-pgsql
  • Use only foreman user (not root!) sudo -u foreman ...
  • In /usr/share/foreman/bundler.d directory, add Gemfile.local.rb file and add this line in it:
echo "gem 'foreman_fog_proxmox'" | sudo -u foreman tee /usr/share/foreman/bundler.d/Gemfile.local.rb
  • Install the gem plugin:
sudo -u foreman /usr/bin/foreman-ruby /usr/bin/bundle install
  • Precompile plugin assets:

You need nodejs installed in order to use foreman-assets package.

/usr/bin/foreman-ruby /usr/bin/bundle exec bin/rake plugin:assets:precompile[foreman_fog_proxmox]
  • Compile plugin translations if (french) needed :
/usr/bin/foreman-ruby /usr/bin/bundle exec bin/rake plugin:gettext[foreman_fog_proxmox]
  • Complete installation of foreman 1.22 with foreman-installer:
sudo apt install -y foreman-installer
sudo foreman-installer

If you don't want to have HTTP 503 errors when apt is trying to install puppetserver, then add this before launching foreman-installer:

echo 'Acquire::http::User-agent "Mozilla/5.0 (Linux)";' | sudo tee /etc/apt/apt.conf.d/96useragent

See complete details in plugin installation from gem

Then you can check plugin installation after login into your new foreman server seeing the about foreman page:

About resources About greffon

Usage

Development

Dev prerequisites

See Foreman dev setup

  • You need a Proxmox VE 6.2+ server running.
  • You need ruby 2.7. You can install it with asdf-vm.
  • You also need nodejs 14 in your dev machine to run webpack-dev-server. You can install it with asdf-vm.

Platform

  • Fork this github repo.
  • Clone it on your local machine
  • Install foreman v2.5+ on your machine:
git clone https://github.com/theforeman/foreman -b develop
  • Create a Gemfile.local.rb file in foreman/bundler.d/
  • Add this line:
gem 'foreman_fog_proxmox', :path => '../../theforeman/foreman_fog_proxmox'
gem 'fog-proxmox', :path => '../../fog/fog-proxmox' # optional if you need to modify fog-proxmox code too
gem 'ruby-debug-ide' # dev
gem 'debase' # dev
gem 'solargraph' # dev
gem 'simplecov' # test
  • In foreman directory, install dependencies:
gem install bundler
# prerequisites libraries on Ubuntu OS:
# sudo apt install postgresql-client-13 libpq-dev libsystemd-dev
bundle config set without 'libvirt ovirt'
bundle install
npm install
  • Configure foreman settings:
cp config/settings.yaml.test config/settings.yaml

add these lines to config/settings.yml:

    :webpack_dev_server: true
    :destroy_vm_on_host_delete: true # optional, could be set on UI
    :logging:
      :level: debug
    :loggers:
      :sql:
       :enabled: false
  • SQLite is no more default rails dev or test database, instead add:
DATABASE_URL=nulldb://nohost
  • (Optional) test and dev with postgresql database:
cp config/database.yml.example config/database.yml

add these lines to each environment in config/database.yml:

    host: localhost
    username: foreman
    password: foreman
cp config/ignored_environments.yml.sample config/ignored_environments.yml
docker run --name foreman-db -v foreman_data:/var/lib/postgresql/data -e POSTGRES_DB=foreman -e POSTGRES_USER=foreman -e POSTGRES_PASSWORD=foreman -p 5432:5432 -d postgres:13
bundle exec bin/rake db:migrate
RAILS_ENV=development bundle exec bin/rake db:seed assets:precompile locale:pack webpack:compile
  • You can reset and change your admin password if needed:
RAILS_ENV=development bundle exec bin/rake permissions:reset password=changeme
  • You should write tests and you can execute those specific to this plugin:

first, create database foreman-test:

RAILS_ENV=test bundle exec rake db:create

then add test schema and seeds:

RAILS_ENV=test bundle exec bin/rake db:migrate
RAILS_ENV=test bundle exec bin/rake db:seed

Finally you can test all:

export DISABLE_SPRING=true
bundle exec bin/rake test:foreman_fog_proxmox

or just one:

export DISABLE_SPRING=true
bundle exec bin/rake test TEST=../foreman_fog_proxmox/test/functional/compute_resources_controller_test.rb DATABASE_URL=nulldb://nohost
  • In foreman_fog_proxmox source directory, check code syntax with rubocop and foreman rules:
bundle exec rubocop

safe autocorrect:

bundle exec rubocop -a

Temporary ignore offenses:

bundle exec rubocop --auto-gen-config
  • See deface overrides result:
bundle exec bin/rake deface:get_result['hosts/_compute_detail']
  • In foreman directory, after you modify foreman_fog_proxmox specific assets (proxmox.js, etc) you have to precompile it:
bundle exec bin/rake plugin:assets:precompile[foreman_fog_proxmox]
  • In foreman directory, after you modify foreman_fog_proxmox translations (language, texts in new files, etc) you have to compile it:

Prerequisites: Transifex CLI

bundle exec bin/rake plugin:gettext\[foreman_fog_proxmox\]
  • In foreman directory, run in a new terminal the webpack-dev-server:
./node_modules/.bin/webpack-dev-server-without-h2 --config config/webpack.config.js
  • Or without webpack-dev-server, add this line in config/settings.yml:
:webpack_dev_server: false

then compile webpack assets:

bundle exec bin/rake webpack:compile
  • In foreman directory, run rails server:
bundle exec bin/rails server
  • Or you can launch all together:
bundle exec foreman start

See details in foreman plugin development

Contributing

If you like it and still want to improve it, sponsor me!

Please read more information about how to contribute.

License

The code is available as open source under the terms of the GNU Public License v3.

foreman_fog_proxmox's People

Contributors

abenari avatar agx avatar daviddavis avatar dependabot[bot] avatar dlobatog avatar domcleal avatar elelayan avatar evgeni avatar github-actions[bot] avatar gmalfray avatar gregsutcliffe avatar hedius avatar hlawatschek avatar lzap avatar m-bucher avatar manisha15 avatar mimodian avatar mmoll avatar neomilium avatar ohadlevy avatar quba42 avatar rogerfachini avatar sbernhard avatar timogoebel avatar tristanrobert avatar unorthodoxgeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foreman_fog_proxmox's Issues

OVS bridges are not listed when creating a new host in Foreman

Describe the bug
When creating a new host, under the Nic section the dropdown menu for selecting a bridge is empty, even though the Proxmox node has an OpenVirtualSwitch (OVS) bridge in its network config.

To Reproduce
Steps to reproduce the behavior:

  1. Go through the process of creating a new host within Foreman, up until the interfaces tab is reached.
  2. Click on the Edit button for the first interface
  3. Scroll down to the Nic section
  4. The bridge section is empty, and does not list the OVS bridges available to the system.

Expected behavior
OVS bridges available to the node should be listed in the dropdown menu.

Screenshots

nic
The OVS bridge is not listed under Foreman.

proxnic
The OVS bridge is listed under Proxmox.

Desktop

  • OS: Windows 10
  • Browser Chrome
  • Version 70.0.3538.77

Foreman

  • OS: Ubuntu 18.04
  • foreman_fog_proxmox version: 0.5.3
  • foreman version: 1.19.0

Proxmox

  • Version: 5.2-10

Additional context
I read through the plugin's code, and this issue appears to be caused on line 89 of app/models/foreman_fog_proxmox/proxmox.rb. In this function, only interfaces of type bridge are returned, however OVS bridges have the type OVSBridge. According to Proxmox's API documentation there also appears to be a type of any_bridge, which I assume would return bridges of both types.

Problem installing on debian 9 with foreman 1.17.1

Prerequisites

Please check (put an X between the brackets) the following items before posting any issue:

Description

I'm trying to install the plugin on a debian 9.4 with foreman 1.17.1 installed with foreman-installer, however I experience trouble starting foreman after installing the plugin.
In the apache log I find that the problem is caused by an uninitialized constant TheForemanProxmox::Engine::Uglifier.
Trying to do a "foreman-rake db:migrate --trace" also trigger a similar problem "NameError: uninitialized constant TheForemanProxmox::Engine::Uglifier "

Environment

OS: Debian 9.4 (up to date)
ruby: 2.3.3p222 (from Debian)
foreman 1.17.1 (upgraded from 1.16

Version

fog-proxmox 0.4.0 from https://github.com/fog/fog-proxmox.git (at master@0f191c7)
the_foreman_proxmox 0.3.1 from https://github.com/tristanrobert/foreman_proxmox.git (at master@ade2325)

Steps to reproduce

add the_foreman_proxmox and fog-proxmox to ~foreman/bundler.d/Gemfile.local.rb
/usr/bin/foreman-ruby /usr/bin/bundle install
restart apache

Reproduces how often:

Every time

Additional Information

I'm not sure what more information I can give to help, Logs?

when creating multiple virtio disks, disk id0 is always created as scsi disk.

First, thanks for fixing the bugs I find :-)

Version used: master 0.5.5

Describe the bug
when I create 2 disks with virtio interface, the disk with id0 is always created as scsi disk with disk size 8GB.

To Reproduce
Steps to reproduce the behavior:

  1. create a new server with 2 virtio disks

Expected behavior
server with 2 virtio disks should be created.

**observed behavior **
disk0 is created as scsi disk with 8GB
disk1 is created as requested.

In a cluster, the correct Proxmox host isn't always queried

Describe the bug
I have a cluster of three Proxmox nodes. After adding one of the nodes' IP address to set up the Compute Resource, all of the VMs are properly listed in the Virtual Machines tab. Using an example of the issue, a guest with VMID 117 is currently running on vmhost1 (this is also the node that I'm connected to, but it happens seemingly at random as many guests on this node are properly connected to) and is reported running on that host if I run pvesh get /cluster/resources. If I click on the VM in the tab I get an error that states "Configuration file 'nodes/vmhost3/qemu-server/117.conf' does not exist" which would make sense, as that guest is not running on vmhost3. I can't really deduce what causes the plugin to query the incorrect host though, there doesn't seem to be a pattern to me.

To Reproduce
Steps to reproduce the behavior:

  1. Have Proxmox cluster of three nodes or more
  2. Click on any guest in the Virtual Machines tab

Expected behavior
Virtual machine guest information is displayed

Actual behavior
Sometimes virtual machine guest is displayed, sometimes above error is shown

Desktop (please complete the following information):

  • OS: Linux, Windows, MacOS
  • Browser Firefox, Chrome, Safari
  • Version all

Additional context
I looked through the source of this plugin, but I don't know ruby all that well so I couldn't really figure out where the 'node' part of the query comes from or why it would be polling the incorrect one only 50% of the time. The plugin does seem to correctly show guests on other nodes from the one that I'm connected to sometimes.

Only one disk is created on host creation

When I try to define multiple disks during host creation, only one disk is created.

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Create Host'
  2. In 'Virtual Machnine' modify the Disk configuration to two disks
  3. Submit

Expected behavior
Only one disk is created

Observed behavior
two disks should be created

Use next available vmid

It would be a good thing to be able to create a new vm without having to know what the next available vmid is.
At the moment I'm looking at automatic deployment of vm's based on messages comming from a RabbitMQ queue. The system creating these messages have no idea of what vmid's are available in my PVE cluster.

In a cluster, all guests are listed but guests not belonging to the node return an error

Describe the bug
When connected to a cluster, all VMs are listed even if they are not located on the node which was selected under the compute resource settings. When trying to view a VM that is not on the node selected (but is still a part of the cluster), the following error is encountered:

Oops, we're sorry but something went wrong Expected([200]) <=> Actual(500 InternalServerError) excon.error.response :body => "{\"data\":null}" :cookies => [ ] :headers => { "Cache-Control" => "max-age=0" "Connection" => "close" "Content-Length" => "13" "Content-Type" => "application/json;charset=UTF-8" "Date" => "Fri, 02 Nov 2018 04:41:11 GMT" "Expires" => "Fri, 02 Nov 2018 04:41:11 GMT" "Pragma" => "no-cache" "Server" => "pve-api-daemon/3.0" } :host => "192.168.5.11" :local_address => "192.168.5.50" :local_port => 49268 :path => "/api2/json/nodes/LAPIS/qemu/100/status/current" :port => 8006 :reason_phrase => "Configuration file 'nodes/LAPIS/qemu-server/100.conf' does not exist" :remote_ip => "192.168.5.11" :status => 500 :status_line => "HTTP/1.1 500 Configuration file 'nodes/LAPIS/qemu-server/100.conf' does not exist\r\n"

In this instance VM 100 is on the node PERIDOT, but the compute resource is configured to use node LAPIS.

To Reproduce
Steps to reproduce the behavior:

  1. Connect a Proxmox cluster to a Foreman installation
  2. Click on Compute Resources -> NodeName -> Virtual Machines
  3. Click on a VM that is not hosted on the node, but is a part of the cluster.
  4. See error

Expected behavior
Upon clicking on the VM, the VM's properties page should be displayed. Alternatively, the virtual machines tab should not list VMs that are not assigned to the selected node.

Desktop

  • OS: Windows 10
  • Browser Chrome
  • Version 70.0.3538.77

Foreman

  • OS: Ubuntu 18.04
  • foreman_fog_proxmox version: 0.5.3
  • foreman version: 1.19.0

Proxmox

  • Version: 5.2-10

Additional context
This appears to be related to #30 however it occurs on version 0.5.3

LXC presence break VM display

Describe the bug
If there is a LXC in the cluster, listing VMs in Foreman is broken.
The URL to get configuration used is /api2/json/nodes/mynode/qemu/[ID]/config. It result as a 500 error response from Proxmox API, when ID is a LXC.
All the other requests (VM) have 200 but these valid results are not shown in Foreman.

To Reproduce
Create a LXC on proxmox and browse the VM tab in the compute resource in Foreman.

Expected behavior
LXC is correctly identified.
An error on an item (VM or LXC) doesn't prevent to display items for which the API calls are OK.

Screenshots
image
image

10.10.10.10 - apiuser@myrealm [11/08/2018:22:09:53 +0200] "GET /api2/json/nodes/mynode/qemu/107/config HTTP/1.1" 500 13

Proxmox VE version : 5.2-2

When only non scsi disks are attached to vm, a default scsi disk is created

Describe the bug

When I create multiple virtio disks, a "default 8GB scsi disk" is created additionally

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Create Host'
  2. Click on 'Virtual Machine'
  3. Create multiple virtio disks
  4. click "Submit"

All disks are created, but also a "default 8GB scsi disk"

Expected behavior
only the virtio disks should be created.

Autocreate netX identifier entry

Hi!
I had a rough time to understand that it is necessary to add the "netX" identifier for creating a new network interface ;-). At the end walking through the source code helped.
It would be great if the identifier would be automatically created.

-Mark

Some settings in compute profiles do not save on submit

Describe the bug
When creating a new compute profile, or editing an existing one, a few settings that I've tried don't save when I submit the form. Under CPU, the only setting that will save is the 'Spectre-CTRL' checkbox. Under memory, 'Minimum memory', 'shares' and 'Ballooning Device' do not save. Upon form reload, all mentioned items revert to their default state. I've noticed no errors when submitting.

When I go to use this profile during guest creation, if I set any one of these options that do not save under the 'Virtual Machine' tab, they do get correctly sent to Proxmox.

Installation Steps

Installation Steps

Prerequisites

Please check (put an X between the brackets) the following items before posting any issue:

Description

Looking for information on how to install this.

Environment

Brand new foreman with only provisioning setup completed.

Version

v0.1.0

Steps to reproduce

N/A

Expected behavior

Plugin to be installed and to see a new provisioning resource.

Actual behavior

N/A

Reproduces how often:

N/A

Additional Information

N/A

Version 0.5 dependency problem

Describe the bug
Depending on deface 1.3 makes it impossible to install this module on a foreman 1.18 installation on debian 9.5

To Reproduce
add gem 'foreman_fog_proxmox', :git => "https://github.com/tristanrobert/foreman_fog_proxmox.git"
to ~foreman/bundler.d/Gemfile.local.rb and run https://github.com/tristanrobert/foreman_fog_proxmox.git as foreman

Screenshots
Bundler could not find compatible versions for gem "deface":
In snapshot (Gemfile.lock):
deface (= 1.2.0)

In Gemfile:
deface (= 1.2.0)

foreman_dhcp_browser (= 0.0.8) was resolved to 0.0.8, which depends on
  deface

foreman_fog_proxmox was resolved to 0.5.0, which depends on
  deface (~> 1.3)

foreman_monitoring (= 1.0.1) was resolved to 1.0.1, which depends on
  deface (< 2.0)

foreman_monitoring (= 1.0.1) was resolved to 1.0.1, which depends on
  deface (< 2.0)

Running bundle update will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

"property is not defined in schema and the schema does not allow additional properties" when creating a new PVE VM

I've been busy but I finally got to the point that I am ready to start provisioning VMs with Foreman 1.19. When I go to create a new host I fill in the required fields and hit submit and see the error "Oops, we're sorry but something went wrong undefined method `[]' for nil:NilClass"

I investigated the /var/log/foreman/production.log logs and found this related error: https://pastebin.com/WrXV4cj8

I think Proxmox is not accepting one of the fields that Foreman is trying to pass it? I've tried to create a new host several times and I think I am only filling in the fields that are absolutely required.

To Reproduce
Steps to reproduce the behavior:

  1. Click Hosts > Create Host
  2. Fill in required fields:
    a. Under Host fill in Name, Deploy On (Proxmox), Environment, Puppet Master, Puppet CA
    b. Under Virtual Machine change the VM ID to an open ID. All other settings are left default to try and troubleshoot the bug.
    c. Under Operating System fill in Architecture, Operating System, Provisioning Method (Network Based), Build (checked), Media, Partition Table, PXE Loader, Root Pass. Verify settings with the Resolve button at the bottom of the page.
    d. Under interfaces edit the default interface. Fill in Type (Interface), Mac Address (used 00:11:22:33:44:55), Device Identifer (net0), DNS Name, Domain, IPv4 Subnet, IPv4 Address. Change the NIC Card to VirtIO paravirtualized.
  3. Click Submit
  4. After clicking Submit get error "Oops, we're sorry but something went wrong undefined method `[]' for nil:NilClass"

Expected behavior
Expect Foreman to provision a new VM on Proxmox

In "edit host" a wrong disk size is reported

Describe the bug
When I click on edit host, the wrong disk size is reported.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a newly created host and click "edit"
  2. Go to Virtual machine and have a look at the disk size
    The disk size is wrong (115MB)

Expected behavior
The correct disk size is reported

Missing Route

Hi Tristan,

i followed your installation instructions (for CentOS). I can see the plugin under Ressources in Foreman. But when i want to add the proxmox hosts, i get only this error (in Foreman - production.log):

2018-11-09T15:27:44 [I|app|66136] Proxying request to 10.10.14.2 via
2018-11-09T15:27:44 [I|app|66136] Rendered /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/foreman_fog_proxmox-0.5.3/app/views/compute_resources/form/_proxmox.html.erb (11.3ms)
2018-11-09T15:27:44 [I|app|66136] Rendered taxonomies/_loc_org_tabs.html.erb (15.9ms)
2018-11-09T15:27:44 [I|app|66136] Rendered compute_resources/form.html.erb (35.9ms)
2018-11-09T15:27:44 [I|app|66136] Completed 200 OK in 90ms (Views: 33.6ms | ActiveRecord: 10.2ms)
2018-11-09T15:27:44 [I|app|] Started GET "/javascripts/foreman_fog_proxmox/proxmox_compute_resource.js?
=1541772575785" for 10.10.200.2 at 2018-11-09 15:27:44 +0100
2018-11-09T15:27:44 [F|app|]
2018-11-09T15:27:44 [F|app|] ActionController::RoutingError (No route matches [GET] "/javascripts/foreman_fog_proxmox/proxmox_compute_resource.js"):
2018-11-09T15:27:44 [F|app|]
2018-11-09T15:27:44 [F|app|] actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call'

Are there additional steps to do under CentOS 7?

OS: CentOS 7.5.1804
Foreman: 1.19
PVE: 5.2-10
Ruby: 2.5.1p57 (tested also with 2.3 + 2.4)

regards

What versions of foreman are actually supported?

Here I see "It is only available with Foreman 1.17" but on the Github project README I see "Foreman >= 1.17". I'm unsure which of these it actually means.

I've been trying to get this to work for hours and was very frustrated when I say that only 1.17 works on the feature request, because I assumed 1.19 would work from reading the README.

The Disk Controller Type cannot be modified inside compute profiles

Describe the bug
When I try to modify the disk controller type in the compute resource it always falls back to scsi.

To Reproduce
Steps to reproduce the behavior:

  1. Go to compute resource
  2. change the disk controller type to VirtIO
  3. Click on "Submit"
  4. the disk controller type falls back to scsi.

Expected behavior
The disk controller type is changed to VirtIO

Disk controller setting always falls back to scsi

When I try to define the disk controller setting to something different than scsi, the setting automatically switches back to scsi.

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Create Host'
  2. In 'Virtual Machnine' modify the Disk configuration to Controller "VirtIO block"
  3. Submit

Expected behavior
A virtIO disk is created

Observed behavior
A scsi disk is created

Unable to create a compute profile with LXc

Describe the bug
When i try to create a new compute profile for a compute resource with type LXC container, i have this following error:
"""
Oups, désolé quelque chose s'est mal passé undefined method `first' for nil:NilClass
"""

Logs associate with this error:
2018-11-02T18:41:07 [I|app|] Started POST "/compute_profiles/4-LXC/compute_attributes" for 172.17.1.17 at 2018-11-02 18:41:07 +0100
2018-11-02T18:41:07 [I|app|27aec] Processing by ComputeAttributesController#create as HTML
2018-11-02T18:41:07 [I|app|27aec] Parameters: {"utf8"=>"✓", "authenticity_token"=>"...", "compute_attribute"=>{"vm_attrs"=>{"type"=>"lxc", "ostemplate_storage"=>"", "ostemplate_file"=>"", "password"=>"[FILTERED]", "config_attributes"=>{"description"=>"", "onboot"=>"0", "arch"=>"amd64", "cores"=>"1", "cpulimit"=>"", "cpuunits"=>"", "memory"=>"536870912", "swap"=>"", "nameserver"=>"", "searchdomain"=>"", "ostype"=>"debian"}, "interfaces_attributes"=>{"0"=>{"name"=>"", "tag"=>"", "rate"=>"", "bridge"=>"vmbr0", "id"=>"net0"}}, "volumes_attributes"=>{"0"=>{"storage"=>"kvm-disks", "size"=>"8589934592", "id"=>"rootfs"}}}, "compute_profile_id"=>"4", "compute_resource_id"=>"1"}, "commit"=>"Valider", "compute_profile_id"=>"4-LXC"}
2018-11-02T18:41:07 [I|app|27aec] Current user set to ... (admin)
2018-11-02T18:41:07 [E|app|27aec] Failed to save: Profil de calcul n'est pas disponible, Ressource de calcul n'est pas disponible
2018-11-02T18:41:07 [I|app|27aec] Rendering compute_attributes/new.html.erb within layouts/application
2018-11-02T18:41:07 [I|app|27aec] Rendered compute_attributes/_form.html.erb (479.6ms)
2018-11-02T18:41:07 [I|app|27aec] Rendered compute_attributes/new.html.erb within layouts/application (516.6ms)
2018-11-02T18:41:07 [W|app|27aec] Action failed
| ActionView::Template::Error: undefined method first' for nil:NilClass | /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/proxmox/helpers/nic_helper.rb:45:in extract_name'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/container_config.rb:86:in block in compute_nets' | /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/container_config.rb:83:in each'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/container_config.rb:83:in compute_nets' | /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/container_config.rb:61:in initialize'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/container.rb:58:in new' | /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/container.rb:58:in set_config'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/server.rb:59:in initialize' | /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-core-1.45.0/lib/fog/core/collection.rb:88:in new'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-core-1.45.0/lib/fog/core/collection.rb:88:in new' | /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/servers.rb:39:in new'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-proxmox-0.5.2/lib/fog/compute/proxmox/models/containers.rb:38:in new' | /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman_fog_proxmox-0.5.3/app/models/foreman_fog_proxmox/proxmox.rb:206:in new_container_vm'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman_fog_proxmox-0.5.3/app/models/foreman_fog_proxmox/proxmox.rb:197:in new_vm' | /usr/share/foreman/app/views/compute_attributes/_form.html.erb:7:in block in _774b1727827c7173d33736321f26f786'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/helpers/capture_helper.rb:39:in block in capture' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/helpers/capture_helper.rb:203:in with_output_buffer'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/helpers/capture_helper.rb:39:in capture' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/helpers/form_helper.rb:450:in form_for'
| /usr/share/foreman/app/helpers/form_helper.rb:296:in form_for' | /usr/share/foreman/app/views/compute_attributes/_form.html.erb:1:in _774b1727827c7173d33736321f26f786'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/template.rb:157:in block in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:168:in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/template.rb:352:in instrument_render_template' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/template.rb:155:in render'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/deface-1.3.2/lib/deface/action_view_extensions.rb:41:in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/partial_renderer.rb:342:in block in render_partial'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/abstract_renderer.rb:42:in block in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in block in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications/instrumenter.rb:21:in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/abstract_renderer.rb:41:in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/partial_renderer.rb:331:in render_partial'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/partial_renderer.rb:310:in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/renderer.rb:47:in render_partial'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/helpers/rendering_helper.rb:35:in render' | /usr/share/foreman/app/views/compute_attributes/new.html.erb:23:in _9be5211cfd188a17e3ad4d62c975069b'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/template.rb:157:in block in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:168:in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/template.rb:352:in instrument_render_template' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/template.rb:155:in render'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/deface-1.3.2/lib/deface/action_view_extensions.rb:41:in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/template_renderer.rb:52:in block (2 levels) in render_template'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/abstract_renderer.rb:42:in block in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in block in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications/instrumenter.rb:21:in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/abstract_renderer.rb:41:in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/template_renderer.rb:51:in block in render_template'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/template_renderer.rb:59:in render_with_layout' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/template_renderer.rb:50:in render_template'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/template_renderer.rb:14:in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/renderer.rb:42:in render_template'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/renderer/renderer.rb:23:in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/rendering.rb:103:in _render_template'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/streaming.rb:217:in _render_template' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/rendering.rb:83:in render_to_body'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/rendering.rb:52:in render_to_body' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/renderers.rb:141:in render_to_body'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/rendering.rb:24:in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/rendering.rb:36:in render'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:44:in block (2 levels) in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/core_ext/benchmark.rb:12:in block in ms'
| /usr/lib/ruby/2.3.0/benchmark.rb:308:in realtime' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/core_ext/benchmark.rb:12:in ms'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:44:in block in render' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:87:in cleanup_view_runtime'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/railties/controller_runtime.rb:29:in cleanup_view_runtime' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:43:in render'
| /usr/share/foreman/app/controllers/application_controller.rb:307:in process_error' | /usr/share/foreman/app/controllers/compute_attributes_controller.rb:14:in create'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/basic_implicit_render.rb:4:in send_action' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:186:in process_action'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/rendering.rb:30:in process_action' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:20:in block in process_action'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:108:in block in run_callbacks' | /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in set_timezone'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in block in run_callbacks' | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in clear_thread'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in block in run_callbacks' | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in set_topbar_sweeper_controller'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in block in run_callbacks' | /usr/share/foreman/vendor/ruby/2.3.0/gems/audited-4.8.0/lib/audited/sweeper.rb:14:in around'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in block in run_callbacks' | /usr/share/foreman/vendor/ruby/2.3.0/gems/audited-4.8.0/lib/audited/sweeper.rb:14:in around'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in block in run_callbacks' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:135:in run_callbacks'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:19:in process_action' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/rescue.rb:20:in process_action'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:32:in block in process_action' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in block in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications/instrumenter.rb:21:in instrument' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in instrument'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:30:in process_action' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal/params_wrapper.rb:252:in process_action'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.6/lib/active_record/railties/controller_runtime.rb:22:in process_action' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:124:in process'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionview-5.1.6/lib/action_view/rendering.rb:30:in process' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal.rb:189:in dispatch'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_controller/metal.rb:253:in dispatch' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:49:in dispatch'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:31:in serve' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:50:in block in serve'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in each' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in serve'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:844:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/apipie-rails-0.5.10/lib/apipie/static_dispatcher.rb:65:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/apipie-rails-0.5.10/lib/apipie/extractor/recorder.rb:136:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in call'
| /usr/share/foreman/lib/middleware/telemetry.rb:9:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/apipie-rails-0.5.10/lib/apipie/middleware/checksum_in_headers.rb:27:in call'
| /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/etag.rb:25:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/head.rb:12:in call'
| /usr/share/foreman/lib/middleware/logging_context.rb:23:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in context'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/cookies.rb:613:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:26:in block in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:97:in run_callbacks'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:24:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/debug_exceptions.rb:59:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/show_exceptions.rb:31:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/rack/logger.rb:36:in call_app'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/rack/logger.rb:26:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/remote_ip.rb:79:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/request_id.rb:25:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/runtime.rb:22:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.6/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/executor.rb:12:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/secure_headers-5.0.5/lib/secure_headers/middleware.rb:13:in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/engine.rb:522:in call'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/railtie.rb:185:in public_send' | /usr/share/foreman/vendor/ruby/2.3.0/gems/railties-5.1.6/lib/rails/railtie.rb:185:in method_missing'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in block in call' | /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in each'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in call' | /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in process_request'
| /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:160:in accept_and_process_next_request' | /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in main_loop'
| /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in block (3 levels) in start_threads' | /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in block in create_thread_and_abort_on_exception'
| /usr/share/foreman/vendor/ruby/2.3.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2018-11-02T18:41:07 [I|app|27aec] Rendering common/500.html.erb within layouts/application
2018-11-02T18:41:07 [I|app|27aec] Rendered common/500.html.erb within layouts/application (2.6ms)
2018-11-02T18:41:07 [I|app|27aec] Rendered layouts/_application_content.html.erb (1.8ms)
2018-11-02T18:41:07 [I|app|27aec] Rendering layouts/base.html.erb
2018-11-02T18:41:07 [I|app|27aec] Rendered layouts/base.html.erb (2.5ms)
2018-11-02T18:41:07 [I|app|27aec] Completed 500 Internal Server Error in 594ms (Views: 9.7ms | ActiveRecord: 12.4ms)
2018-11-02T18:41:07 [I|app|de51b] Rendering text template
2018-11-02T18:41:07 [I|app|de51b] Rendered text template (0.0ms)

To Reproduce
Steps to reproduce the behavior:

  1. Create a compute resource
  2. Create a new compute profile on this resource, with type LXC (whatever parameters)
  3. Validate

Expected behavior
Just no error, create the compute profile as expected

Desktop (please complete the following information):

  • OS: Server running on Debian 9.5

Thanks for your help

Overwrite persisted? method of compute object

To create a vm, foreman uses vm_exists? from app/models/concerns/orchestration/compute.rb which uses persisted? from app/models/concerns/fog_extensions/model.rb which uses !!identity from fog model.
The issue is that proxmox requires vmid to be submitted by the client in order to create a new vm.
vmid is the identity attribute. So it is always persisted to foreman.
To resolve it, it is necessary to overwrite persisted? method.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.