aws / eks-anywhere

Run Amazon EKS on your own infrastructure 🚀
https://anywhere.eks.amazonaws.com
Apache License 2.0
1.97k stars 286 forks source link

Image builder not working for EKS_anywhere on Nutanix #5124

Closed prajaysingh closed 1 year ago

prajaysingh commented 1 year ago

What happened: Trying to build the nutanix node image but getting errored out

What you expected to happen: it should pass without any issue How to reproduce it (as minimally and precisely as possible): Following the steps on the doc (https://anywhere.eks.amazonaws.com/docs/reference/artifacts/#build-nutanix-node-images), the ansible process is not able to complete successfully and getting exited out on the error: nutanix: output will be in this color.

==> nutanix: Creating Packer Builder virtual machine... nutanix: Virtual machine ubuntu-2004-kube-v1.25.6 created nutanix: Found IP for virtual machine: 192.168.17.241 ==> nutanix: Using SSH communicator to connect: 192.168.17.241 ==> nutanix: Waiting for SSH to become available... ==> nutanix: Connected to SSH! ==> nutanix: Provisioning with Ansible... nutanix: Setting up proxy adapter for Ansible.... ==> nutanix: Executing Ansible: ansible-playbook -e packer_buildname="nutanix" -e packer_type=nutanix --ssh-extra-args '-o IdentitiesOnly=yes' --extra-vars containerd_url=https://github.com/containerd/containerd/releases/download/v1.6.2/cri-containerd-cni-1.6.2-linux-amd64.tar.gz containerd_sha256=91f1087d556ecfb1f148743c8ee78213cd19e07c22787dae07fe6b9314bec121 etcd_http_source=https://distro.eks.amazonaws.com/kubernetes-1-25/releases/7/artifacts/etcd/v3.5.6/etcd-linux-amd64-v3.5.6.tar.gz etcd_version=v3.5.6 etcd_sha256=9bebd6f253f3b4e4e13ea0dc7ea82f22cc0040c3213eb3e461ac43b984625a3e etcdadm_http_source=https://anywhere-assets.eks.amazonaws.com/releases/bundles/28/artifacts/etcdadm/5b496a72af3d80d64a16a650c85ce9a5882bc014/etcdadm-linux-amd64.tar.gz etcdadm_version=v0.1.5 pause_image=public.ecr.aws/eks-distro/kubernetes/pause:v1.25.6-eks-1-25-7 containerd_additional_settings= containerd_cri_socket=/var/run/containerd/containerd.sock containerd_version=1.6.2 crictl_url=https://anywhere-assets.eks.amazonaws.com/releases/bundles/28/artifacts/cri-tools/v1.24.2/cri-tools-linux-amd64.tar.gz crictl_sha256=1c07b1d0d9556c3a797c308a71980d07ecbfc3d9fa3630849b455c5afe11246b crictl_source_type=http custom_role_names="" firstboot_custom_roles_pre="" firstboot_custom_roles_post="" node_custom_roles_pre="" node_custom_roles_post="" disable_public_repos=false extra_debs="nfs-common xfsprogs" extra_repos="" extra_rpms="" http_proxy= https_proxy= kubeadm_template=etc/kubeadm.yml kubernetes_cni_http_source=https://distro.eks.amazonaws.com/kubernetes-1-25/releases/7/artifacts/plugins kubernetes_cni_http_checksum=sha256:aab163548cd265e9954f17c7de627d7386637026d629a33dc91a68108b37c867 kubernetes_http_source=https://distro.eks.amazonaws.com/kubernetes-1-25/releases/7/artifacts/kubernetes kubernetes_container_registry=public.ecr.aws/eks-distro kubernetes_rpm_repo=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 kubernetes_rpm_gpg_key="https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" kubernetes_rpm_gpg_check=True kubernetes_deb_repo="https://apt.kubernetes.io/ kubernetes-xenial" kubernetes_deb_gpg_key=https://packages.cloud.google.com/apt/doc/apt-key.gpg kubernetes_cni_deb_version= kubernetes_cni_rpm_version= kubernetes_cni_semver=v1.1.1 kubernetes_cni_source_type=http kubernetes_semver=v1.25.6 kubernetes_source_type=http kubernetes_load_additional_imgs=true kubernetes_deb_version=1.23.10-00 kubernetes_rpm_version=1.23.10-0 no_proxy= pip_conf_file= python_path= redhat_epel_rpm=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm epel_rpm_gpg_key= reenable_public_repos=true remove_extra_repos=false systemd_prefix=/usr/lib/systemd sysusr_prefix=/usr sysusrlocal_prefix=/usr/local load_additional_components=true additional_registry_images=false additional_registry_images_list= additional_url_images=true additional_url_images_list=https://distro.eks.amazonaws.com/kubernetes-1-24/releases/11/artifacts/kubernetes/v1.24.10/bin/linux/amd64/pause.tar additional_executables=false additional_executables_list= additional_executables_destination_path= build_target=virt --extra-vars ansible_python_interpreter=/usr/bin/python3 -e ansible_ssh_private_key_file=/tmp/ansible-key3826213725 -i /tmp/packer-provisioner-ansible810911605 /home/image-/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-/image-/images/capi/ansible/node.yml nutanix: nutanix: PLAY [all] ***** nutanix: nutanix: TASK [Gathering Facts] * nutanix: ok: [default] nutanix: [WARNING]: Collection community.general does not support Ansible version 2.10.8 nutanix: nutanix: TASK [setup : Put templated sources.list in place] * nutanix: changed: [default] nutanix: nutanix: TASK [setup : Put templated apt.conf.d/90proxy in place when defined] ** nutanix: changed: [default] nutanix: FAILED - RETRYING: perform a dist-upgrade (5 retries left). nutanix: FAILED - RETRYING: perform a dist-upgrade (4 retries left). nutanix: FAILED - RETRYING: perform a dist-upgrade (3 retries left). nutanix: FAILED - RETRYING: perform a dist-upgrade (2 retries left). nutanix: FAILED - RETRYING: perform a dist-upgrade (1 retries left). nutanix: nutanix: TASK [setup : perform a dist-upgrade] ** nutanix: fatal: [default]: FAILED! => {"attempts": 5, "changed": false, "msg": "Failed to update apt cache: unknown reason"} nutanix: nutanix: PLAY RECAP ***** nutanix: default : ok=3 changed=2 unreachable=0 failed=1 skipped=81 rescued=0 ignored=0 nutanix: ==> nutanix: Provisioning step had errors: Running the cleanup provisioner, if present... ==> nutanix: Task cancelled, virtual machine is not deleted Build 'nutanix' errored after 50 minutes 44 seconds: Error executing Ansible: Non-zero exit status: exit status 2 ==> Wait completed after 50 minutes 44 seconds

==> Some builds didn't complete successfully and had errors: --> nutanix: Error executing Ansible: Non-zero exit status: exit status 2

==> Builds finished but no artifacts were created. make[1]: [Makefile:472: build-nutanix-ubuntu-2004] Error 1 make[1]: Leaving directory '/home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder/image-builder/images/capi' make: [Makefile:303: local-build-nutanix-ubuntu-2004] Error 2 make: Leaving directory '/home/image-builder/eks-anywhere-build-tooling/projects/kubernetes-sigs/image-builder' 2023/02/28 01:46:16 Error executing image-builder for nutanix hypervisor: failed to run command: exit status 2

Anything else we need to know?:

Environment: I made sure my image builder machine meets this requirement as mentioned on doc (https://anywhere.eks.amazonaws.com/docs/reference/artifacts/#prerequisites). AMI name: ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230208

prajaysingh commented 1 year ago

This issue can be closed. The reason for this error was the VM was not reachable to internet. The subnet I created for the target VM on Nutanix to work was public subnet. We need to associate private subnet as this is only routable to internet