saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

salt-cloud vmware provisioning offline minion bootstrap hangs when internet not reachable. #61294

Open julianfirminger-united opened 2 years ago

julianfirminger-united commented 2 years ago

Description of Issue

When provisioning to target networks that have no internet access, it seems the bootstrap sh still tries to reach external mirrors. Or so it seems. (gleaned from our fw logs). Note that the source OS template is up to date and epel-release is installed and up to date.

[ ~]# cat /etc/salt/cloud.maps.d/somemap.map
somemap:
  HOSTNAME.local:
    devices:
      network:
        'Network adapter 1':
          ip: [REDACTED]
          name: '[REDACTED]'
          gateway: ['[REDACTED]']
          subnet_mask: [REDACTED]
    minion:
      master: [REDACTED]
      startup_states: sls
      sls_list:
        - linux.scripts.update-hostname

[ ~]# cat /etc/salt/cloud.profiles.d/profile.conf
vmware-template:
  deploy: True
  provider: [REDACTED]
  datacenter: [REDACTED]
  clonefrom: 'CentOS76-MIN-1810-20190517-30G'
  devices:
    network:
      'Network adapter 1':
        switch_type: standard
  domain: [REDACTED]
  dns_servers:
    - [REDACTED]
    - [REDACTED]
  ssh_username: [REDACTED]
  password: [REDACTED]
  customization: True
  minion:
    master: [REDACTED]
    mine_functions:
      network.ip_addrs: []
    startup_states: sls
    sls_list:
      - linux.scripts.update-hostname
  grains:
    baselines:
      - [REDACTED]

somemap:
  host: [REDACTED]
  cluster: [REDACTED]
  datacenter: [REDACTED]
  datastore: [REDACTED]
  extends: vmware-template
  folder: [REDACTED]
  num_cpus: 8
  cores_per_socket: 4
  memory: 8GB
  grains:
    roles:
      - [REDACTED]
    business_unit: [REDACTED]

[ ~]# salt-cloud -m /etc/salt/cloud.maps.d/somemap.map -y -l debug --script-args "-I -R saltrepo.local/fullrepo"

...(lots of output)

 *  INFO: Running version: 2021.09.17
 *  INFO: Executed by:
 *  INFO: Command line: '/tmp/.saltcloud-f7486894-3904-4b74-8744-a7327dcf29d5/deploy.sh -c /tmp/.saltcloud-f7486894-3904-4b74-8744-a7327dcf29d5 -I -R saltrepo.local/fullrepo'
 *  WARN: Detected -R option. No other repositories will be configured when -R is used. Setting -r option to True.

 *  INFO: System Information:
 *  INFO:   CPU:          GenuineIntel
 *  INFO:   CPU Arch:     x86_64
 *  INFO:   OS Name:      Linux
 *  INFO:   OS Version:   3.10.0-957.12.2.el7.x86_64
 *  INFO:   Distribution: CentOS 7.6

 *  INFO: Installing minion
 *  INFO: Found function install_centos_stable_deps
 *  INFO: Found function config_salt
 *  INFO: Found function preseed_master
 *  INFO: Found function install_centos_stable
 *  INFO: Found function install_centos_st[DEBUG   ]  *  INFO: Running version: 2021.09.17
 *  INFO: Executed by:
 *  INFO: Command line: '/tmp/.saltcloud-f7486894-3904-4b74-8744-a7327dcf29d5/deploy.sh -c /tmp/.saltcloud-f7486894-3904-4b74-8744-a7327dcf29d5 -I -R saltrepo.local/salt/fullrepo'
 *  WARN: Detected -R option. No other repositories will be configured when -R is used. Setting -r option to True.

 *  INFO: System Information:
 *  INFO:   CPU:          GenuineIntel
 *  INFO:   CPU Arch:     x86_64
 *  INFO:   OS Name:      Linux
 *  INFO:   OS Version:   3.10.0-957.12.2.el7.x86_64
 *  INFO:   Distribution: CentOS 7.6

 *  INFO: Installing minion
 *  INFO: Found function install_centos_stable_deps
 *  INFO: Found function config_salt
 *  INFO: Found function preseed_master
 *  INFO: Found function install_centos_stable
 *  INFO: Found function install_centos_st
able_post
 *  INFO: Found function install_centos_restart_daemons
 *  INFO: Found function daemons_running
 *  INFO: Found function install_centos_check_services
 *  INFO: Running install_centos_stable_deps()
 *  WARN: Detected -r or -R option while installing Salt packages for Python 3.
 *  WARN: Python 3 packages for older Salt releases requires the EPEL repository to be installed.
 *  WARN: Installing the EPEL repository automatically is disabled when using the -r or -R options.
[DEBUG   ] able_post
 *  INFO: Found function install_centos_restart_daemons
 *  INFO: Found function daemons_running
 *  INFO: Found function install_centos_check_services
 *  INFO: Running install_centos_stable_deps()
 *  WARN: Detected -r or -R option while installing Salt packages for Python 3.
 *  WARN: Python 3 packages for older Salt releases requires the EPEL repository to be installed.
 *  WARN: Installing the EPEL repository automatically is disabled when using the -r or -R options.

...(hangs)
---

[ ~]# salt --versions-report
Salt Version:
          Salt: 3004

Dependency Versions:
          cffi: Not Installed
      cherrypy: unknown
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Nov 16 2020, 16:55:22)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.1.4

System Versions:
          dist: centos 7 Core
        locale: UTF-8
       machine: x86_64
       release: 3.10.0-1160.45.1.el7.x86_64
        system: Linux
       version: CentOS Linux 7 Core
welcome[bot] commented 2 years ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!