vmware-archive / pcf-pipelines

PCF Pipelines
Apache License 2.0
158 stars 282 forks source link

PCF - vSphere - govc: <Resource Group> not found #335

Closed akamalov closed 6 years ago

akamalov commented 6 years ago

Environment:

vSphere: 6.5
PCF: 2.0.13
Concourse: 3.14.0
Pipelines: latest

Issue

When trying to upgrade OpsManager, Concourse exits with the following error:

Running deploy of OpsMgr VM task...
{
  "DiskProvisioning":"thin",
  "IPAllocationPolicy":"dhcpPolicy",
  "IPProtocol":"IPv4",
  "Name": "OpsManager-2.0.14-20180609182502",
  "NetworkMapping": [{
    "Name":"Network 1",
    "Network":"VLAN-XXXX"
  }],
  "PropertyMapping":[
    {"Key":"ip0","Value":"192.168.20.10"},
    {"Key":"netmask0","Value":"255.255.255.0"},
    {"Key":"gateway","Value":"192.168.20.1"},
    {"Key":"DNS","Value":"XXX.XXX.XXX.XXX"},
    {"Key":"ntp_servers","Value":"ntp1.XXXXXXXXX.XXX,ntp2.XXXXXXXX.XXX"},
    {"Key":"admin_password","Value":"XXXXXXXXXXXXXX"}
  ],
  "PowerOn":false,
  "InjectOvfEnv":false,
  "WaitForIP":false
}
Importing OVA of new OpsMgr VM...
Running govc import.ova -options=opsman_settings.json /tmp/build/39dbd1bf/pivnet-opsmgr/pcf-vsphere-2.0-build.314.ova
[09-06-18 18:50:17] Uploading pivotal-ops-manager-disk1.vmdk... OK
Setting CPUs on new OpsMgr VM... /CGLAB/cflab02_vms/OpsManager-2.0.14-20180609182502
Shutting down OLD OpsMgr VM... 192.168.20.10
govc: CFLAB02-CG not found

Context

Now, above, CFLAB02-CG is the resource group. So far, Concourse correctly identifies a resource group and uploads correctly OpsMan VMDK (into the resource group - CFLAB02-CG).

Here is my params.yml file:

# Copyright 2017-Present Pivotal Software, Inc. All rights reserved.
#
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
##  http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
#
opsman_timeout_seconds: 3600 # time to wait for new OM VM to come up
#
## Either opsman_client_id/opsman_client_secret or opsman_admin_username/opsman_admin_password needs to be specified
## If you are using opsman_admin_username/opsman_admin_password, edit opsman_client_id/opsman_client_secret to be an empty value.
## If you are using opsman_client_id/opsman_client_secret, edit opsman_admin_username/opsman_admin_password to be an empty value. 
opsman_client_id: ""
opsman_client_secret: ""
opsman_admin_username: "OpsMan"
opsman_admin_password: "XXXXXXXXXXXXX"

opsman_ssh_password: "XXXXXXXXX"   # ubuntu user ssh password
opsman_major_minor_version: ^2\.0\.[0-9]+$ # Ops Manager minor version to track (e.g ^2\.0\.[0-9]+$ will track 2.0.x versions)   # Ops Manager minor version to track
opsman_domain_or_ip_address: "opsmanager.XXXX.XXXXXXXXXXXX.XXX"
opsman_passphrase: "XXXXXXXXXXXXX"
# value must be a Pivotal Network legacy token; UAA API tokens do not work currently work
pivnet_token: "XXXXXXXXXXXX"
# Do not specify with a trailing slash.
vcenter_url: "vcenter01.XXXX.XXXXXXXXXXXX.XXX"
vcenter_username: "XXXXXXXXXXXXXX"
vcenter_password: "XXXXXXXXXXXXX
vcenter_datacenter: CGLAB
vcenter_datastore: "00-SIO-CFLAB02_Persistent_01"
vcenter_insecure: true
vcenter_ca_cert: 
# vCenter Cluster or Resource Pool to use to deploy Ops Manager.
# # Possible formats:
# #   cluster:       /<Data Center Name>/host/<Cluster Name>
# #   resource pool: /<Data Center Name>/host/<Cluster Name>/Resources/<Resource Pool Name>
vcenter_cluster: Zone01
vcenter_resource_pool: CFLAB02-CG
om_vm_folder: cflab02_vms
opsman_ip: 192.168.20.10
netmask: 255.255.255.0
gateway: 192.168.20.1
dns: XXX.XXX.XXX.XXX
ntp: "ntp1.XXXXXXXXXX.XXX, ntp2.XXXXXXXXXX.XXX"
opsman_network: VLAN-XXXXX
git_private_key:
opsman_disk_type: thin # use thick or thin disk provisioning

I tried to put vcenter_resource_poolin quotes and without it, makes no difference. Always fails at that step.

image

Now, using ‘fly hijack’ went inside the container and viewed opsman_settings.json

{
  "DiskProvisioning":"thin",
  "IPAllocationPolicy":"dhcpPolicy",
  "IPProtocol":"IPv4",
  "Name": "OpsManager-2.0.14-20180609182502",
  "NetworkMapping": [{
    "Name":"Network 1",
    "Network":"VLAN-XXXX"
  }],
  "PropertyMapping":[
    {"Key":"ip0","Value":"192.168.20.10"},
    {"Key":"netmask0","Value":"255.255.255.0"},
    {"Key":"gateway","Value":"192.168.20.1"},
    {"Key":"DNS","Value":"XXX.XXX.XXX.XXX"},
    {"Key":"ntp_servers","Value":"ntp1.XXX.XXXXXX.XXX,ntp2.XXX.XXXXXXX.XXX"},
    {"Key":"admin_password","Value":"XXXXXXXXXXXXXXXXXXXX"}
  ],
  "PowerOn":false,
  "InjectOvfEnv":false,
  "WaitForIP":false

}

…but I do not see any reference regarding my resource group (e.g., CFLAB02-CG)

Is this a bug ? I don't understand how come Concourse correctly identifies vSphere resource group, uploads VMDK there and then bails saying it can't find a resource group.

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

akamalov commented 6 years ago

Answering my own question: I had to provide a full path to the resource, such as ```/datacenter/host/cluster/resources/resource_group_name. Once provided it started working. Thank you.