Page MenuHomePhabricator

Cannot create magnum cluster template
Closed, ResolvedPublic

Description

When attempting to create magnum cluster in eqiad1 I am getting the following error:

Cluster type (vm, Unset, kubernetes) not supported (HTTP 400) (Request-ID: req-182abe3f-9457-4055-a146-81d90727d3cf)

This is done by connecting to cloudcontrol1005.wikimedia.org as root and running:

# source novaenv.sh 
# export OS_PROJECT_ID=paws
# openstack coe cluster template create paws-k8s23 \
--image Fedora-CoreOS-34 \
--external-network wan-transport-eqiad \
--fixed-network lan-flat-cloudinstances2b \
--fixed-subnet cloud-instances2-b-eqiad \
--dns-nameserver 8.8.8.8 \
--network-driver flannel \
--docker-storage-driver overlay2 \
--docker-volume-size 50 \
--master-flavor g3.cores2.ram4.disk20 \
--flavor g3.cores8.ram32.disk20 \
--coe kubernetes \
--labels kube_tag=v1.23.15-rancher1-linux-amd64,hyperkube_prefix=docker.io/rancher/,cloud_provider_enabled=true \
--floating-ip-disabled

I notice the same when I do not switch the project to paws (export OS_PROJECT_ID=paws)

Event Timeline

rook renamed this task from Cannot create magnum cluster to Cannot create magnum cluster template.Feb 8 2023, 6:43 PM

Trying a more generic cluster template. Though getting the same result

root@cloudcontrol1005:~# openstack coe cluster template create k8s23 \
--image Fedora-CoreOS-34 \
--external-network wan-transport-eqiad \
--fixed-network lan-flat-cloudinstances2b \
--fixed-subnet cloud-instances2-b-eqiad \
--dns-nameserver 8.8.8.8 \
--network-driver flannel \
--docker-storage-driver overlay2 \
--master-flavor g3.cores2.ram4.disk20 \
--flavor g3.cores2.ram4.disk20 \
--coe kubernetes \
--labels kube_tag=v1.23.15-rancher1-linux-amd64,hyperkube_prefix=docker.io/rancher/,cloud_provider_enabled=true \
--floating-ip-disabled \
--public
Cluster type (vm, Unset, kubernetes) not supported (HTTP 400) (Request-ID: req-65b7c324-93ea-4fc8-bb29-f1194631b7cc)

I'm seeing a few messages in magnum-api.log that might be related, I'm not watching all 3 cloud control nodes, so they only show up some of the time when I attempt to create a template.

/usr/lib/python3/dist-packages/urllib3/connectionpool.py:1015: InsecureRequestWarning: Unverified HTTPS request is being made to host 'openstack.eqiad1.wikimediacloud.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
/usr/lib/python3/dist-packages/magnum/drivers/common/driver.py:38: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.
  yield entry_point, entry_point.load(require=False)
2023-02-09 21:23:35.483 2032743 WARNING oslo_policy.policy [None req-481b576c-59b0-4995-92bf-9d370a4a73b7 - - - - - -] Policy Rules ['admin_or_owner', 'context_is_admin', 'cluster_user', 'bay:create', 'bay:delete', 'bay:detail', 'bay:get', 'bay:get_all', 'bay:update', 'baymodel:create', 'baymodel:delete', 'baymodel:detail', 'baymodel:get', 'baymodel:get_all', 'baymodel:update', 'baymodel:publish', 'certificate:create', 'certificate:get', 'cluster:create', 'cluster:delete', 'cluster:delete_all_projects', 'cluster:detail', 'cluster:detail_all_projects', 'cluster:get', 'cluster:get_one_all_projects', 'cluster:get_all', 'cluster:get_all_all_projects', 'cluster:update', 'cluster:update_health_status', 'cluster:update_all_projects', 'cluster:resize', 'cluster:upgrade', 'cluster:upgrade_all_projects', 'clustertemplate:create', 'clustertemplate:delete_all_projects', 'clustertemplate:detail_all_projects', 'clustertemplate:detail', 'clustertemplate:get', 'clustertemplate:get_one_all_projects', 'clustertemplate:get_all', 'clustertemplate:get_all_all_projects', 'clustertemplate:update_all_projects', 'clustertemplate:publish', 'federation:create', 'federation:delete', 'federation:detail', 'federation:get', 'federation:get_all', 'federation:update', 'magnum-service:get_all', 'quota:create', 'quota:delete', 'quota:get_all', 'quota:update', 'nodegroup:get_all_all_projects', 'nodegroup:get_one_all_projects'] specified in policy files are the same as the defaults provided by the service. You can remove these rules from policy files which will make maintenance easier. You can detect these redundant rules by ``oslopolicy-list-redundant`` tool also.

The policy rule warnings are almost certainly harmless -- they're fallout from a giant in-process refactor of rbac in all the openstack projects, and we should have ages to migrate over. Slightly more detail can be found on T276018

It's likely that you're seeing them when you create a template because that's the only time a 'real' magnum api is getting hit.

The supported set of cluster types seems to be:

{('vm', 'coreos', 'kubernetes'): {'entry_point_name': 'k8s_coreos_v1', 'class': <class 'magnum.drivers.k8s_coreos_v1.driver.Driver'>}, ('vm', 'fedora-atomic', 'kubernetes'): {'entry_point_name': 'k8s_fedora_atomic_v1', 'class': <class 'magnum.drivers.k8s_fedora_atomic_v1.driver.Driver'>}, ('vm', 'fedora-coreos', 'kubernetes'): {'entry_point_name': 'k8s_fedora_coreos_v1', 'class': <class 'magnum.drivers.k8s_fedora_coreos_v1.driver.Driver'>}, ('bm', 'fedora', 'kubernetes'): {'entry_point_name': 'k8s_fedora_ironic_v1', 'class': <class 'magnum.drivers.k8s_fedora_ironic_v1.driver.Driver'>}, ('vm', 'ubuntu', 'mesos'): {'entry_point_name': 'mesos_ubuntu_v1', 'class': <class 'magnum.drivers.mesos_ubuntu_v1.driver.Driver'>}, ('vm', 'fedora-atomic', 'swarm'): {'entry_point_name': 'swarm_fedora_atomic_v1', 'class': <class 'magnum.drivers.swarm_fedora_atomic_v1.driver.Driver'>}, ('vm', 'fedora-atomic', 'swarm-mode'): {'entry_point_name': 'swarm_fedora_atomic_v2', 'class': <class 'magnum.drivers.swarm_fedora_atomic_v2.driver.Driver'>}}

so it's that 'unset' that I'm wondering about.

I'm sorry I forgot to update this. It would appear that there is a problem with the copy paste, perhaps an invisible character. I got this kind of working. Though it opened another question. Is there some way to feed openstack a file full of options to run, rather than pasting in a command?

this works:

openstack coe cluster template create paws-k8s23 --image magnum-fedora-coreos-34  --external-network wan-transport-eqiad --fixed-network lan-flat-cloudinstances2b --fixed-subnet cloud-instances2-b-eqiad --dns-nameserver 8.8.8.8 --network-driver flannel --docker-storage-driver overlay2 --docker-volume-size 50 --master-flavor g3.cores2.ram4.disk20 --flavor g3.cores8.ram32.disk20 --coe kubernetes --labels kube_tag=v1.23.15-rancher1-linux-amd64,hyperkube_prefix=docker.io/rancher/,cloud_provider_enabled=true --floating-ip-disabled

So the issue was the image name, probably you copied it from codfw1dev where it has a slightly different name? Apparently the error message was an oblique way of telling you that it couldn't find the image you requested.

I'm sorry I forgot to update this. It would appear that there is a problem with the copy paste, perhaps an invisible character. I got this kind of working. Though it opened another question. Is there some way to feed openstack a file full of options to run, rather than pasting in a command?

I don't know of a way to pass in a file, typically I would just make a little shell script to do things.