Bug 1666700 - `hammer host create ...` returns ISE instead of an error message when LibVirt compute-resource is not in correct organization
Summary: `hammer host create ...` returns ISE instead of an error message when LibVirt...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Compute Resources - libvirt
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Released
Assignee: satellite6-bugs
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On: 1595126
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-16 12:01 UTC by Jan Hutař
Modified: 2019-10-07 17:17 UTC (History)
3 users (show)

Fixed In Version: foreman-1.20.1.32-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1595126
Environment:
Last Closed: 2019-05-14 19:57:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 25098 None None None 2019-02-12 17:23:05 UTC

Comment 3 Jan Hutař 2019-01-16 12:09:10 UTC
At first, compute resource was not part of the organization / location. Command used to cause the traceback:

# hammer -v -u admin -p changeme --output=csv host create --architecture-id="32" --compute-resource-id="27" --domain-id="33" --environment-id="38" --ip="130.25.23.239" --location-id="117" --mac="b8:03:84:d5:c4:c6" --medium-id="42" --name="tvnhldrq" --operatingsystem-id="34" --organization-id="118" --partition-table-id="182" --puppet-proxy-id="1" --root-password="tGItndPhxFcFsofhfVicvxVv"

Traceback itself is the first one in the initial comment.

This is how org/loc looked before I have added compute resource to them:

[root@new-satellite ~]# hammer location info --id 117
Id:                 117
Title:              HGBKINsGMrk
Name:               HGBKINsGMrk
Description:        
Users:              

Smart proxies:      

Subnets:            

Compute resources:  

Installation media: 
    exJGmvuNXc
Templates:          
    Alterator default (provision)
    Alterator default finish (finish)
    Alterator default PXELinux (PXELinux)
    alterator_pkglist
    ansible_provisioning_callback
    ansible_tower_callback_script
    ansible_tower_callback_service
    Atomic Kickstart default (provision)
    AutoYaST default (provision)
    AutoYaST default iPXE (iPXE)
    AutoYaST default PXELinux (PXELinux)
    AutoYaST default user data (user_data)
    AutoYaST SLES default (provision)
    blacklist_kernel_modules
    bmc_nic_setup
    Boot disk iPXE - generic host (Bootdisk)
    Boot disk iPXE - host (Bootdisk)
    chef_client
    coreos_cloudconfig
    CoreOS provision (provision)
    CoreOS PXELinux (PXELinux)
    create_users
    csr_attributes.yaml
    Discovery Debian kexec (kexec)
    Discovery Red Hat kexec (kexec)
    epel
    fix_hosts
    FreeBSD (mfsBSD) finish (finish)
    FreeBSD (mfsBSD) provision (provision)
    FreeBSD (mfsBSD) PXELinux (PXELinux)
    freeipa_register
    Grubby default (script)
    http_proxy
    iPXE default local boot (iPXE)
    iPXE global default (iPXE)
    Jumpstart default (provision)
    Jumpstart default finish (finish)
    Jumpstart default PXEGrub (PXEGrub)
    Junos default finish (finish)
    Junos default SLAX (provision)
    Junos default ZTP config (ZTP)
    Kickstart default (provision)
    Kickstart default finish (finish)
    Kickstart default iPXE (iPXE)
    Kickstart default PXEGrub (PXEGrub)
    Kickstart default PXEGrub2 (PXEGrub2)
    Kickstart default PXELinux (PXELinux)
    Kickstart default user data (user_data)
    kickstart_ifcfg_bonded_interface
    kickstart_ifcfg_bond_interface
    kickstart_ifcfg_generic_interface
    kickstart_ifcfg_get_identifier_names
    kickstart_networking_setup
    Kickstart oVirt-RHVH (provision)
    Kickstart oVirt-RHVH PXELinux (PXELinux)
    NX-OS default POAP setup (POAP)
    Preseed default (provision)
    Preseed default finish (finish)
    Preseed default iPXE (iPXE)
    Preseed default PXEGrub2 (PXEGrub2)
    Preseed default PXELinux (PXELinux)
    Preseed default user data (user_data)
    preseed_networking_setup
    puppet.conf
    puppetlabs_repo
    puppet_setup
    pxegrub2_chainload
    PXEGrub2 default local boot (PXEGrub2)
    pxegrub2_discovery
    PXEGrub2 global default (PXEGrub2)
    pxegrub_chainload
    PXEGrub default local boot (PXEGrub)
    pxegrub_discovery
    PXEGrub global default (PXEGrub)
    PXELinux chain iPXE (PXELinux)
    PXELinux chain iPXE UNDI (PXELinux)
    pxelinux_chainload
    PXELinux default local boot (PXELinux)
    PXELinux default memdisk (PXELinux)
    pxelinux_discovery
    PXELinux global default (PXELinux)
    rancheros_cloudconfig
    RancherOS provision (provision)
    RancherOS PXELinux (PXELinux)
    redhat_register
    remote_execution_ssh_keys
    saltstack_minion
    saltstack_setup
    UserData default (user_data)
    WAIK default PXELinux (PXELinux)
    XenServer default answerfile (provision)
    XenServer default finish (finish)
    XenServer default PXELinux (PXELinux)
Domains:            
    nf8brmpcun
Environments:       
    R0BUl1tJePvx
Hostgroups:         

Parameters:         

Created at:         2019/01/14 15:37:33
Updated at:         2019/01/14 15:37:33

[root@new-satellite ~]# hammer organization info --id 118
Id:                     118
Title:                  JoLMPRPhNRYP
Name:                   JoLMPRPhNRYP
Description:            
Users:                  

Smart proxies:          
    satellite.nodhcp.local
Subnets:                

Compute resources:      

Installation media:     
    exJGmvuNXc
Templates:              
    Alterator default (provision)
    Alterator default finish (finish)
    Alterator default PXELinux (PXELinux)
    alterator_pkglist
    ansible_provisioning_callback
    ansible_tower_callback_script
    ansible_tower_callback_service
    Atomic Kickstart default (provision)
    AutoYaST default (provision)
    AutoYaST default iPXE (iPXE)
    AutoYaST default PXELinux (PXELinux)
    AutoYaST default user data (user_data)
    AutoYaST SLES default (provision)
    blacklist_kernel_modules
    bmc_nic_setup
    Boot disk iPXE - generic host (Bootdisk)
    Boot disk iPXE - host (Bootdisk)
    chef_client
    coreos_cloudconfig
    CoreOS provision (provision)
    CoreOS PXELinux (PXELinux)
    create_users
    csr_attributes.yaml
    Discovery Debian kexec (kexec)
    Discovery Red Hat kexec (kexec)
    epel
    fix_hosts
    FreeBSD (mfsBSD) finish (finish)
    FreeBSD (mfsBSD) provision (provision)
    FreeBSD (mfsBSD) PXELinux (PXELinux)
    freeipa_register
    Grubby default (script)
    http_proxy
    iPXE default local boot (iPXE)
    iPXE global default (iPXE)
    Jumpstart default (provision)
    Jumpstart default finish (finish)
    Jumpstart default PXEGrub (PXEGrub)
    Junos default finish (finish)
    Junos default SLAX (provision)
    Junos default ZTP config (ZTP)
    Kickstart default (provision)
    Kickstart default finish (finish)
    Kickstart default iPXE (iPXE)
    Kickstart default PXEGrub (PXEGrub)
    Kickstart default PXEGrub2 (PXEGrub2)
    Kickstart default PXELinux (PXELinux)
    Kickstart default user data (user_data)
    kickstart_ifcfg_bonded_interface
    kickstart_ifcfg_bond_interface
    kickstart_ifcfg_generic_interface
    kickstart_ifcfg_get_identifier_names
    kickstart_networking_setup
    Kickstart oVirt-RHVH (provision)
    Kickstart oVirt-RHVH PXELinux (PXELinux)
    NX-OS default POAP setup (POAP)
    Preseed default (provision)
    Preseed default finish (finish)
    Preseed default iPXE (iPXE)
    Preseed default PXEGrub2 (PXEGrub2)
    Preseed default PXELinux (PXELinux)
    Preseed default user data (user_data)
    preseed_networking_setup
    puppet.conf
    puppetlabs_repo
    puppet_setup
    pxegrub2_chainload
    PXEGrub2 default local boot (PXEGrub2)
    pxegrub2_discovery
    PXEGrub2 global default (PXEGrub2)
    pxegrub_chainload
    PXEGrub default local boot (PXEGrub)
    pxegrub_discovery
    PXEGrub global default (PXEGrub)
    PXELinux chain iPXE (PXELinux)
    PXELinux chain iPXE UNDI (PXELinux)
    pxelinux_chainload
    PXELinux default local boot (PXELinux)
    PXELinux default memdisk (PXELinux)
    pxelinux_discovery
    PXELinux global default (PXELinux)
    rancheros_cloudconfig
    RancherOS provision (provision)
    RancherOS PXELinux (PXELinux)
    redhat_register
    remote_execution_ssh_keys
    saltstack_minion
    saltstack_setup
    UserData default (user_data)
    WAIK default PXELinux (PXELinux)
    XenServer default answerfile (provision)
    XenServer default finish (finish)
    XenServer default PXELinux (PXELinux)
Domains:                
    nf8brmpcun
Environments:           
    R0BUl1tJePvx
Hostgroups:             

Parameters:             

Created at:             2019/01/14 15:37:34
Updated at:             2019/01/14 15:37:34
Label:                  JoLMPRPhNRYP
Description:            
Red Hat Repository URL: https://cdn.redhat.com
Service Levels:

Comment 8 Lukáš Hellebrandt 2019-04-16 09:24:12 UTC
Verified with Sat 6.5 snap 23.

1) Setup all the necessary entities. Make sure they are in the correct org.
2) # hammer -v -u admin -p <password> --output=csv host create --architecture="x86_64" --compute-resource-id="1" --domain-id="3" --environment="pupenv1" --ip="192.168.1.10" --location-id="2" --mac="b8:03:84:d5:c4:c6" --medium-id="3" --name="bz1666700-sweetpath" --operatingsystem-id="1" --organization-id="1" --partition-table-id="99" --puppet-proxy-id="1" --root-password="testrootpassword"
Message,Id,Name
Host created.,7,bz1666700-sweetpath.lab.eng.bos.redhat.com
3) Setup an additional libvirt compute resource (here with ID 2) that is in different org.
4) # hammer -v -u admin -p <password> --output=csv host create --architecture="x86_64" --compute-resource-id="2" --domain-id="3" --environment="pupenv1" --ip="192.168.1.11" --location-id="2" --mac="b8:03:84:d5:c4:c7" --medium-id="3" --name="bz1666700-reproduce" --operatingsystem-id="1" --organization-id="1" --partition-table-id="99" --puppet-proxy-id="1" --root-password="testrootpassword"
Could not create the host:
  Compute resource with id 2 doesn't exist or is not assigned to proper organization and/or location

Comment 9 Bryan Kearney 2019-05-14 19:57:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222


Note You need to log in before you can comment on or make changes to this bug.