Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1746021 - [osp] Create a machine with invalid subnet, logs should output subnet is invalid
Summary: [osp] Create a machine with invalid subnet, logs should output subnet is invalid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: Pierre Prinetti
QA Contact: sunzhaohua
URL:
Whiteboard: osp
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-27 13:32 UTC by sunzhaohua
Modified: 2019-10-16 06:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:37:54 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-api-provider-openstack pull 66 0 None closed Bug 1746021: Abort Instance if no valid network 2020-08-28 16:15:55 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:38:05 UTC

Description sunzhaohua 2019-08-27 13:32:30 UTC
Description of problem:
Create a machine with invalid subnet, logs should suggest subnet is invalid 

Version-Release number of selected component (if applicable):
4.2.0-0.nightly-2019-08-22-153337

How reproducible:
always

Steps to Reproduce:
1. Create a new machine with invlid subnet

apiVersion: machine.openshift.io/v1beta1
kind: Machine
metadata:
  labels:
    machine.openshift.io/cluster-api-cluster: shared-jiazha-8ck2c
    machine.openshift.io/cluster-api-machine-role: worker
    machine.openshift.io/cluster-api-machine-type: worker
    machine.openshift.io/instance-type: m1.large
    machine.openshift.io/region: regionOne
    machine.openshift.io/zone: nova
  name: shared-jiazha-8ck2c-worker-invalidsubnet
  namespace: openshift-machine-api
spec:
  metadata:
    creationTimestamp: null
  providerSpec:
    value:
      apiVersion: openstackproviderconfig.openshift.io/v1alpha1
      cloudName: openstack
      cloudsSecret:
        name: openstack-cloud-credentials
        namespace: openshift-machine-api
      flavor: m1.large
      image: rhcos-42.80.20190815.3
      kind: OpenstackProviderSpec
      metadata:
        creationTimestamp: null
      networks:
      - filter: {}
        subnets:
        - filter:
            name: shared-jiazha-8ck2c-nodes
            tags: openshiftClusterID=shared-jiazha-8ck2c-invalid
      securityGroups:
      - filter: {}
        name: shared-jiazha-8ck2c-worker
      serverMetadata:
        Name: shared-jiazha-8ck2c-worker
        openshiftClusterID: shared-jiazha-8ck2c
      tags:
      - openshiftClusterID=shared-jiazha-8ck2c
      trunk: true
      userDataSecret:
        name: worker-user-data
        
2. Check machine-controller logs


Actual results:
I0827 06:54:30.506560       1 controller.go:129] Reconciling Machine "shared-jiazha-8ck2c-worker-invalidsubnet"
I0827 06:54:30.507042       1 controller.go:298] Machine "shared-jiazha-8ck2c-worker-invalidsubnet" in namespace "openshift-machine-api" doesn't specify "cluster.k8s.io/cluster-name" label, assuming nil cluster
I0827 06:54:30.624759       1 controller.go:129] Reconciling Machine "shared-jiazha-8ck2c-worker-invalidsubnet"
I0827 06:54:30.624795       1 controller.go:298] Machine "shared-jiazha-8ck2c-worker-invalidsubnet" in namespace "openshift-machine-api" doesn't specify "cluster.k8s.io/cluster-name" label, assuming nil cluster
I0827 06:54:31.166576       1 controller.go:247] Reconciling machine object shared-jiazha-8ck2c-worker-invalidsubnet triggers idempotent create.
E0827 06:54:39.784986       1 actuator.go:414] Machine error shared-jiazha-8ck2c-worker-invalidsubnet: error creating Openstack instance: Create new server err: Bad request with: [POST https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13774/v2.1/servers], error message: {"badRequest": {"message": "Invalid input for field/attribute server. Value: {u'name': u'shared-jiazha-8ck2c-worker-invalidsubnet', u'imageRef': u'8fe77b79-2a62-4b90-9f95-67c7bcc88070', u'tags': [u'cluster-api-provider-openstack', u'openshift-machine-api-shared-jiazha-8ck2c', u'openshiftClusterID=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ExZHhDaXRDTlZCNkwwaENZWEJoYzFkNVNFa3pNWEJUWWs4MVJEZGtja2s1Y21WWFNrcEdTRVJ4ZDNkYVIyaElZbVZGZVdFNVYxTlJXa2hOVG1OYVVtUnRNM0FLTlM5eFZuTlJZMHB5Tld4VGJFdEhaM0ZPVERoWVNuazBibVZuUFFvdExTMHRMVVZPUkNCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2c9PSIsInZlcmlmaWNhdGlvbiI6e319XX19LCJ0aW1lb3V0cyI6e30sInZlcnNpb24iOiIyLjIuMCJ9LCJuZXR3b3JrZCI6e30sInBhc3N3ZCI6e30sInN0b3JhZ2UiOnt9LCJzeXN0ZW1kIjp7fX0=', u'security_groups': [{u'name': u'842bf4b1-0f72-4e8d-b9ad-13cc838d3475'}], u'metadata': {u'openshiftClusterID': u'shared-jiazha-8ck2c', u'Name': u'shared-jiazha-8ck2c-worker'}}. 'networks' is a required property", "code": 400}}
W0827 06:54:39.785044       1 controller.go:249] Failed to create machine "shared-jiazha-8ck2c-worker-invalidsubnet": error creating Openstack instance: Create new server err: Bad request with: [POST https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13774/v2.1/servers], error message: {"badRequest": {"message": "Invalid input for field/attribute server. Value: {u'name': u'shared-jiazha-8ck2c-worker-invalidsubnet', u'imageRef': u'8fe77b79-2a62-4b90-9f95-67c7bcc88070', u'tags': [u'cluster-api-provider-openstack', u'openshift-machine-api-shared-jiazha-8ck2c', u'openshiftClusterID=shared-jiazha-8ck2c'], u'flavorRef': u'a9acc2de-39d7-4148-8d16-413c3b696e9d', u'user_data': u'eyJpZ25pdGlvbiI6eyJjb25maWciOnsiYXBwZW5kIjpbeyJzb3VyY2UiOiJodHRwczovLzE5Mi4xNjguMC41OjIyNjIzL2NvbmZpZy93b3JrZXIiLCJ2ZXJpZmljYXRpb24iOnt9fV19LCJzZWN1cml0eSI6eyJ0bHMiOnsiY2VydGlmaWNhdGVBdXRob3JpdGllcyI6W3sic291cmNlIjoi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I6e30sInZlcnNpb24iOiIyLjIuMCJ9LCJuZXR3b3JrZCI6e30sInBhc3N3ZCI6e30sInN0b3JhZ2UiOnt9LCJzeXN0ZW1kIjp7fX0=', u'security_groups': [{u'name': u'842bf4b1-0f72-4e8d-b9ad-13cc838d3475'}], u'metadata': {u'openshiftClusterID': u'shared-jiazha-8ck2c', u'Name': u'shared-jiazha-8ck2c-worker'}}. 'networks' is a required property", "code": 400}}

Expected results:
Logs should suggest subnet is invalid.

Additional info:

Comment 1 egarcia 2019-09-10 16:04:51 UTC
The log output is really ugly, but doesn't it say that the subnet was invalid right here:


controller.go:249] Failed to create machine "shared-jiazha-8ck2c-worker-invalidsubnet": error creating Openstack instance: Create new server err: Bad request with: [POST https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13774/v2.1/servers],


error message: {"badRequest": {"message": "Invalid input for field/attribute server. Value: {u'name': u'shared-jiazha-8ck2c-worker-invalidsubnet', u'imageRef': u'8fe77b79-2a62-4b90-9f95-67c7bcc88070', u'tags': [u'cluster-api-provider-openstack', u'openshift-machine-api-shared-jiazha-8ck2c', u'openshiftClusterID=shared-jiazha-8ck2c'], u'flavorRef': u'a9acc2de-39d7-4148-8d16-413c3b696e9d', u'user_data': ....

Comment 2 Pierre Prinetti 2019-09-12 16:14:51 UTC
The error message from OpenStack mentions that the 'networks' property is missing from the Instance definition.

And indeed, CAPO's machine-service compiles the Instance definition by inserting any real NetworkID found after querying OpenStack with the Machine's Network property filters.
If no valid NetworkID is found, the Instance's Network section is left empty.

Comment 4 sunzhaohua 2019-09-16 06:13:07 UTC
Verifed.

clusterversion: 4.2.0-0.nightly-2019-09-15-052022


I0916 06:11:04.704983       1 controller.go:129] Reconciling Machine "share-0916c-8vp8z-worker-aaa"
I0916 06:11:04.705022       1 controller.go:298] Machine "share-0916c-8vp8z-worker-aaa" in namespace "openshift-machine-api" doesn't specify "cluster.k8s.io/cluster-name" label, assuming nil cluster
I0916 06:11:04.711614       1 controller.go:129] Reconciling Machine "share-0916c-8vp8z-worker-aaa"
I0916 06:11:04.711640       1 controller.go:298] Machine "share-0916c-8vp8z-worker-aaa" in namespace "openshift-machine-api" doesn't specify "cluster.k8s.io/cluster-name" label, assuming nil cluster
I0916 06:11:05.005775       1 controller.go:247] Reconciling machine object share-0916c-8vp8z-worker-aaa triggers idempotent create.
E0916 06:11:11.340611       1 actuator.go:470] Machine error share-0916c-8vp8z-worker-aaa: error creating Openstack instance: No network was found or provided. Please check your machine configuration and try again
W0916 06:11:11.340640       1 controller.go:249] Failed to create machine "share-0916c-8vp8z-worker-aaa": error creating Openstack instance: No network was found or provided. Please check your machine configuration and try again

Comment 5 errata-xmlrpc 2019-10-16 06:37:54 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/RHBA-2019:2922


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