rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.44k stars 657 forks source link

RancherOS packer tempalte for vsphere: ros-sysinit:error: failed [2/4] start project: Error: No such image: os_open-vm-tools #3018

Open brokencode64 opened 4 years ago

brokencode64 commented 4 years ago

Hello! I've been trying create a vmware template for rancheros using packer but upon trying create an image from the vm I get the following error:

error:ros-sysinit:error: failed [2/4] start project: Error: No such image: os_open-vm-tools

The new vm "guest tools" show up as "not running" on the new vm. If I login into the VM it is clear the image does exist, and the service is "enabled" but the system-docker container for open-vm-tools is not running and will not start. It does not throw any errors.

Packer Version: 1.6 ESXI Version: 7.0.0 Vcenter Version: 7.0.0 RancherOS Version: 1.5.6 vmware-iso

Packer Template (in yaml)

builders:
- type: vsphere-iso  vm_name: "{{user `vm-name`}}"
  username: "{{user `vsphere-user`}}"
  vcenter_server: "{{user `vsphere-server`}}"
  insecure_connection: true
  convert_to_template: true
  datacenter: "{{user `vsphere-datacenter`}}"
  guest_os_type: "{{user `guest-os-type`}}" 
  host: "{{user `host-ip`}}"
  http_directory: http_directory
  iso_checksum: "{{user `iso-checksum-type`}}:{{user `iso-checksum`}}"
  iso_urls: "{{user `iso-url`}}"  network_adapters:
  - network: "{{user `vsphere-network`}}"
    network_card: "{{user `network-card`}}"  
  password: "{{user `vsphere-password`}}"
  ram: "{{user `vm-memory`}}"
  ram_reserve_all: false
  resource_pool: "{{user `resource-pool`}}" 
  ssh_private_key_file: "{{user `ssh-private-key`}}"
  ssh_timeout: "{{user `ssh-timeout`}}"
  ssh_username: "{{user `ssh-username`}}"  
  storage:
  - disk_size: "{{user `vm-disk-size`}}"
    disk_thin_provisioned: true  
  boot_order: disk,cdrom
  boot_command:
  - "<wait10><wait10><wait10><wait5>"
  - sudo ros install -c http://{{ .HTTPIP }}:{{ .HTTPPort }}/rancher/server/server_config.yaml
    -d /dev/sda --append 'rancher.password=rancher'
  - "<enter>y<enter><wait10>y<enter>"  
shutdown_command: echo 'poweroff' > shutdown.sh; echo 'rancher'|sudo -S sh 'shutdown.sh'

Cloud-init file

---
ssh_authorized_keys:
  - "ssh-rsa . . ."
hostname: unassigned-rancher
rancher:
  data_sources:
    - cdrom
  preload_wait: true
  services:
    open-vm-tools:
      enabled: true
  network:
    dns:
      nameservers:
      - 10.10.0.1
  ntp_servers:
  - 0.europe.pool.ntp.org
  - 1.europe.pool.ntp.org