redhat-openstack / openshift-on-openstack

A place to write templates, docs etc. for deploying OpenShift on OpenStack.
Apache License 2.0
136 stars 87 forks source link

Failed to validate resources when create the stack #206

Closed zhangjunli177 closed 8 years ago

zhangjunli177 commented 8 years ago

root@Oak-controller:~/JJZ/OPENSHIFT/VER3# heat stack-create oakcloud -t 180 -e env_origin.yaml -e openshift-on-openstack/env_loadbalancer_none.yaml -f openshift-on-openstack/openshift.yaml ERROR: Failed to validate: Failed to validate: resources[0]: At least one of the following properties must be specified: network, network_id

In resource section of openshift.yaml, after I change the fixed_network definition of openshift_masters & openshift_nodes from fixed_network: {get_attr: [fixed_network, name]} to fixed_network: {get_resource: fixed_network} the heat command can be submitted successfully.

In openshift.yaml, infra_host looks like the same level as openshift_masters and openshift_nodes, why fixed_network setting is happy there?

Tried with template validation command: w/o change anything: root@Oak-controller:~/JJZ/OPENSHIFT/TST/openshift-on-openstack# heat template-validate -n -e env_origin.yaml -f openshift.yaml ERROR: The Parameter (fixed_network) was not provided. After I only update the fixed_network setting for openshift_masters in openshift.yaml, the validation can passed. Why fixed_network setting for openshift_nodes is OK with validation but not stack-create?

juddmaltin-dell commented 8 years ago

I'm seeing the same thing. What are we missing?

Here's an strace... What is resources[0], and why doesn't it have a network or network_id?

connect(4, {sa_family=AF_INET, sin_port=htons(8004), sin_addr=inet_addr("192.168.190.125")}, 16) = 0 sendto(4, "POST /v1/c1b740d8571f4cb5aa66f8d"..., 131477, 0, NULL, 0) = 131477 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR) fcntl(4, F_SETFL, O_RDWR) = 0 recvfrom(4, "HTTP/1.1 400 Bad Request\r\nConten"..., 8192, 0, NULL, NULL) = 563 write(2, "ERROR: Failed to validate: Faile"..., 140ERROR: Failed to validate: Failed to validate: resources[0]: At least one of the following properties must be specified: network, network _id) = 140 write(2, "\n", 1 ) = 1 close(4) = 0 close(3) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7ff2a4b8a100}, {0x7ff2a4ea87b0, [], SA_RESTORER, 0x7ff2a4b8a100}, 8) = 0 close(12) = 0 exit_group(1) = ? +++ exited with 1 +++ [osp_admin@director ~]$

jprovaznik commented 8 years ago

Apparently this one (my) patch broke it - https://github.com/redhat-openstack/openshift-on-openstack/commit/0c8fdae3cc47d8520b1a9ebbee8d63d060e4dc39

As a hotfix you might try reverting the commit, I'll look at this ASAP.

jprovaznik commented 8 years ago

@juddmaltin-dell @zhangjunli177 hm, for some reason I can't reproduce the error "ERROR: Failed to validate: Failed to validate: resources[0]: At least one of the following properties must be specified: network, network_id" on stack-create. Could you please provide parameters (eventaully content of env file) you use?

juddmaltin-dell commented 8 years ago
parameters:
  internal_subnet: 192.168.10.0/24
  container_subnet: 10.10.0.0/24
  ssh_key_name: key_name
  infra_image: rhel72
  master_image: rhel72
  node_image: rhel72
  flavor: m1.medium
  external_network: nova
  dns_nameserver: 8.8.4.4,8.8.8.8
  node_count: 3
  rhn_username: "SECRET"
  rhn_password: "SECRET"
  rhn_pool: 'OBSCURE'
  deployment_type: openshift-enterprise
  domain_name: "10example.com"
  master_hostname: "openshift-master"
  node_hostname: "openshift-node"
  ssh_user: cloud-user
  master_docker_volume_size_gb: 25
  node_docker_volume_size_gb: 25
  extra_rhn_pools: 'OBSCURE'
  master_count: 2
  master_server_group_policies: affinity
  deploy_registry: false
  os_auth_url: http://192.168.190.125:5000/v2.0
  os_username: admin
  os_password: OBSCURE
  os_tenant_name: admin
  openshift_ansible_git_url: https://github.com/openshift/openshift-ansible.git
  #openshift_ansible_git_rev: 08791978fdf3ee385760761d4fc6bc47febf1732
  openshift_ansible_git_rev: master

resource_registry:
  OOShift::LoadBalancer: openshift-on-openstack/loadbalancer_neutron.yaml
  OOShift::ContainerPort: openshift-on-openstack/sdn_flannel.yaml
  OOShift::IPFailover: openshift-on-openstack/ipfailover_keepalived.yaml
  OOShift::DockerVolume: openshift-on-openstack/volume_docker.yaml
  OOShift::DockerVolumeAttachment: openshift-on-openstack/volume_attachment_docker.yaml
  OOShift::RegistryVolume: openshift-on-openstack/registry_ephemeral.yaml
``
jprovaznik commented 8 years ago

If I run "heat stack-create -e env_test.yaml -f openshift-on-openstack/openshift.yaml" where env_test.yaml is quite the same as above (except externalnetwork name and ssh-key and unset rhn*), stack-create command passes without an error. Just to make sure, are you using the recent master branch of openshift-on-openstack?

I tried both on Liberty and Mitaka:

openstack-heat-api-cfn-5.0.1-6.el7ost.noarch openstack-heat-engine-5.0.1-6.el7ost.noarch openstack-heat-common-5.0.1-6.el7ost.noarch python-heatclient-1.0.0-1.el7ost.noarch openstack-heat-api-5.0.1-6.el7ost.noarch

python-heatclient-1.2.0-1.el7ost.noarch openstack-heat-api-6.0.0-11.el7ost.noarch openstack-heat-common-6.0.0-11.el7ost.noarch openstack-heat-api-cfn-6.0.0-11.el7ost.noarch openstack-heat-engine-6.0.0-11.el7ost.noarch

juddmaltin-dell commented 8 years ago

I guess it's because I'm running OSP 8.

[osp_admin@director ~]$ sudo rpm -qa | grep heat
openstack-heat-engine-5.0.1-5.el7ost.noarch
python-heatclient-1.0.0-1.el7ost.noarch
openstack-heat-api-cloudwatch-5.0.1-5.el7ost.noarch
openstack-tripleo-heat-templates-kilo-0.8.14-7.el7ost.noarch
openstack-heat-common-5.0.1-5.el7ost.noarch
openstack-heat-api-5.0.1-5.el7ost.noarch
openstack-heat-templates-0-0.1.20151019.el7ost.noarch
openstack-tripleo-heat-templates-0.8.14-7.el7ost.noarch
openstack-heat-api-cfn-5.0.1-5.el7ost.noarch
[osp_admin@director ~]$

repo id                                                                            repo name                                                                                          status
rhel-7-fast-datapath-rpms/7Server/x86_64                                           Red Hat Enterprise Linux Fast Datapath (RHEL 7 Server) (RPMs)                                           0
rhel-7-server-extras-rpms/x86_64                                                   Red Hat Enterprise Linux 7 Server - Extras (RPMs)                                                     284
rhel-7-server-nfv-rpms/7Server/x86_64                                              Red Hat Enterprise Linux for Real Time for NFV (RHEL 7 Server) (RPMs)                                  64
rhel-7-server-openstack-8-director-rpms/7Server/x86_64                             Red Hat OpenStack Platform 8 director for RHEL 7 (RPMs)                                                72
rhel-7-server-openstack-8-rpms/7Server/x86_64                                      Red Hat OpenStack Platform 8 for RHEL 7 (RPMs)                                                        779
rhel-7-server-rh-common-rpms/7Server/x86_64                                        Red Hat Enterprise Linux 7 Server - RH Common (RPMs)                                                  209
rhel-7-server-rpms/7Server/x86_64                                                  Red Hat Enterprise Linux 7 Server (RPMs)                                                           11,250

Because it doesn't work with the latest code from openshift-on-openstack.

[osp_admin@director openshift-on-openstack]$ git remote -v
dell-esg        https://github.com/dell-esg/openshift-on-openstack (fetch)
dell-esg        https://github.com/dell-esg/openshift-on-openstack (push)
judd    https://github.com/juddmaltin-dell/openshift-on-openstack/ (fetch)
judd    https://github.com/juddmaltin-dell/openshift-on-openstack/ (push)
origin  https://github.com/redhat-openstack/openshift-on-openstack (fetch)
origin  https://github.com/redhat-openstack/openshift-on-openstack (push)
[osp_admin@director openshift-on-openstack]$ git pull origin master
From https://github.com/redhat-openstack/openshift-on-openstack
 * branch            master     -> FETCH_HEAD
Already up-to-date.
[osp_admin@director openshift-on-openstack]$ cd ..
[osp_admin@director ~]$ heat --version
1.0.0
[osp_admin@director ~]$ heat stack-create judd01    --poll \
>    -t 180 \
>    -e openshift_parameters.yaml_good \
>    -f openshift-on-openstack/openshift.yaml \
>    -e openshift-on-openstack/env_flannel.yaml
ERROR: Failed to validate: Failed to validate: resources[0]: At least one of the following properties must be specified: network, network_id

I guess it's a heat version issue. Can keep supporting OSP8 based installations?

Thanks!

jprovaznik commented 8 years ago

@juddmaltin-dell we do support OSP8, for some reason I couldn't reproduce this neither in OSP 8 or 9. Anyway the patch above hopefully solves the issue in all various openstack environments.