Project

General

Profile

Actions

Bug #15154

closed

Libvirt compute resource - unclear error on VM creation failure

Added by Shimon Shtein almost 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - libvirt
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1332652
Description of problem:

in the below example i provide environment-id="122" which does not exist:

# hammer -v -u admin -p changeme --output=csv host create --medium-id="9" --root-pass="changeme" --organization-id="1" --location-id="2" --architecture-id="1" --puppet-proxy-id="1" --name="foo4" --environment-id="122" --compute-resource-id="1" --domain-id="1" --operatingsystem-id="3" --partition-table-id="61" 
[ERROR 2016-05-03 18:14:15 Exception] ERROR:  insert or update on table "hosts" violates foreign key constraint "hosts_environment_id_fk" 
DETAIL:  Key (environment_id)=(122) is not present in table "environments".

Could not create the host:
  ERROR:  insert or update on table "hosts" violates foreign key constraint "hosts_environment_id_fk" 
  DETAIL:  Key (environment_id)=(122) is not present in table "environments".

after retrigerring the same command with the correct environment id, I'm no longer able to use the same name for the host (ending up with different error):

# hammer -v -u admin -p changeme --output=csv host create --medium-id="9" --root-pass="changeme" --organization-id="1" --location-id="2" --architecture-id="1" --puppet-proxy-id="1" --name="foo4" --environment-id="1" --compute-resource-id="1" --domain-id="1" --operatingsystem-id="3" --partition-table-id="61" 
[ERROR 2016-05-03 18:17:48 Exception] Failed to create a compute my_libvirt_cr_1 (Libvirt) instance foo4.domain.com: no implicit conversion of nil into String

Could not create the host:
  Failed to create a compute my_libvirt_cr_1 (Libvirt) instance foo4.domain.com: no implicit conversion of nil into String

Version-Release number of selected component (if applicable):
6.2.0 BETA

How reproducible:
always

Steps to Reproduce:
1. create all the prerequisites for creating a host (OS, arch, partition table, ...)
2. try to create the host with providing invalid environment-id
[3. optionally, try to create the host again with using the same name]

Actual results:
ERROR: insert or update on table "hosts" violates foreign key constraint "hosts_environment_id_fk"

Expected results:
user friendly message displayed, nothing is being created on the satellite side.

Additional info:

Actions

Also available in: Atom PDF