Bug 1610684

Summary: Unable to provision host from CLI Unknown Network ID
Product: Red Hat Satellite Reporter: Sanket Jagtap <sjagtap>
Component: Compute Resources - VMWareAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: bkearney, chrobert, mhulan, sjagtap
Target Milestone: 6.4.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:03:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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