Bug 1610684 - Unable to provision host from CLI Unknown Network ID
Summary: Unable to provision host from CLI Unknown Network ID
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Compute Resources - VMWare
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.4.0
Assignee: satellite6-bugs
QA Contact: Sanket Jagtap
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-01 08:19 UTC by Sanket Jagtap
Modified: 2019-11-05 23:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:03:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1551014 0 high CLOSED Failed to update a compute vmware (VMware) instance host.example.domain: undefined method `[]' for nil:NilClass 2022-03-13 14:44:31 UTC
Red Hat Bugzilla 1602289 0 high CLOSED Unable to provision on Vmware, no storage data submitted 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1610674 0 unspecified CLOSED Compute attributes are not user-friendly and some attributes are missing 2021-02-22 00:41:40 UTC

Internal Links: 1551014 1602289 1610674

Description Sanket Jagtap 2018-08-01 08:19:27 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Satellite 6.4.0 snap14

How reproducible:
Always

Steps to Reproduce:
1. Try to create a host on Vmware compute resource from hammer CLI

hammer -d host create --name test-host1 --hostgroup "rhel7_hstgrp" --content-source "qe-testing-rhel7.domain" --partition-table "Kickstart default" --compute-attributes "cpus=2 corespersocket=2 memory_mb=4028 cluster=Satellite_Engineering path=vm/QE guest_id=rhel7_64Guest scsi_controller_type=VirtualLsiLogic hardware_version=Default start=1" --interface "compute_network=network-148" --interface "compute_type=VirtualVmxnet3" --volume "name=Hard disk" --volume "size_gb=10" --volume "thin=true" --volume "eager_zero=false" --location "Default Location" --organization-id 1 --root-password "dog8code" --compute-resource-id 2



Actual results:
        "full_messages" => [
            [0] "Failed to create a compute vmware (VMware) instance test-host1.satqe.lab.eng.rdu2.redhat.com: Unknown Network ID: \n "


Expected results:
Host should be created 

Additional info:
PFA Debug hammer output and production log

Comment 4 Sanket Jagtap 2018-08-01 10:03:30 UTC
Workaround: Create a Compute-profile from UI and then specify it in CLI when creating a host from CLI 


hammer -d host create --name test-host-cp1 --hostgroup rhel7_hstgrp --compute-resource-id 2 --compute-profile-id 2 --location "Default Location" --organization-id 1 --root-password dog8code --compute-attributes "start=1"


Use Compute-profile-id and not compute-profile parameter.
See also https://bugzilla.redhat.com/show_bug.cgi?id=1610695

Comment 6 Marek Hulan 2018-09-11 10:46:05 UTC
This is in fact not a bug at all. The hammer command contains several mistakes. Sanket, here's the right command, that works for me.

hammer host create --name test-host1 --hostgroup "centos" --compute-attributes "cpus=2,corespersocket=2,memory_mb=4028,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=VirtualLsiLogic,hardware_version=Default,start=1" --interface "compute_network=network-148,compute_type=VirtualVmxnet3" --volume "name=Hard disk,size_gb=10,thin=true,eager_zero=false" --location "Default Location" --organization-id 1 --compute-resource-id 2

The problems in your command

1) you specified --volume and --interface multiple times, that means each such attribute generates separate volume and interface. For each you specified just one attribute. What you need to do is in fact call it just once and separate arguments with comma, e.g.

--interface "compute_network=network-148,compute_type=VirtualVmxnet3"
--volume "name=Hard disk,size_gb=10,thin=true,eager_zero=false"

2) --compute-attributes were separated with space instead of comma, therefore it though the whole string was value for cpus

3) path parameter was specified as vm/QE but must be specified as absolute path, in your case it needs to be path=/Datacenters/RH_Engineering/vm/QE

moving to ON_QA to verify

Sanket, based on your experience, would you mind opening docs BZ for improvements?

Comment 7 Sanket Jagtap 2018-09-11 11:37:40 UTC
Thanks for looking into this Marek, 

Looks, the documentation has it correct but we should have the help text for compute resource parameter like what is network which is a ID passed in CLI unlike UI, and path needs to be absolute, and datastore ID means the datastore for volume 

We already have a bug to track this https://bugzilla.redhat.com/show_bug.cgi?id=1610674

I was able to successfully create a Host

hammer -d host create --name test-host1 --hostgroup-id 2 --partition-table "Kickstart default" --compute-attributes "cpus=2,corespersocket=2,memory_mb=4028,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=VirtualLsiLogic,hardware_version=Default,start=1" --interface "compute_network=network-148,compute_type=VirtualVmxnet3" --volume "name=Hard disk,size_gb=10,thin=true,eager_zero=false,datastore=Local-Ironforge" --location "Default Location" --organization-id 1 --compute-resource-id 3 --root-password dog8code

Comment 8 Bryan Kearney 2018-10-16 19:03:29 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-2018:2927


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