我一直在尝试使用packer中的vmware-iso
构建器来生成基本的Centos 7图像,我可以构建其他图像(使用vmware-vmx
)。不幸的是,在尝试查找要连接的开放VNC端口时,构建仍然失败。
我已经按照各种指南和现有问题进行了操作,因此我使用的是最新版本的packer(0.12.2),并且我在防火墙上打开了5900-6000端口。时不时地,构建设法找到一个端口并且完成得很好,但是我尝试过的任何东西都不能一直发生这种情况。
看起来VNC检查在写入VMX配置之前发生,因此在vmx_data
部分中指定值没有任何影响。
我在Windows 10上运行了打包程序,在打包器的docker容器内,以及在Centos 7 vm上运行,结果没有区别。
这是我用于构建的配置:
{
"description": "A bare centos server.",
"min_packer_version": "0.10.0",
"builders": [
{
"type": "vmware-iso",
"guest_os_type": "centos-64",
"headless": false,
"remote_type": "esx5",
"remote_host": "{{ user `vmware_host` }}",
"remote_username": "{{ user `vmware_user` }}",
"remote_password": "{{ user `vmware_pass` }}",
"remote_datastore": "{{ user `vmware_data` }}",
"vmx_data": {
"ethernet0.networkName": "{{ user `vmware_conn` }}",
"ethernet0.present": "TRUE",
"ethernet0.startConnected": "TRUE",
"ethernet0.virtualDev": "e1000",
"ethernet0.addressType": "generated",
"ethernet0.wakeOnPcktRcv": "FALSE",
"ethernet0.uptCompatibility": "TRUE"
},
"vmx_data_post": {
"ethernet0.virtualDev": "vmxnet3"
},
"disk_size": 16384,
"floppy_files": [
"{{ pwd }}/files/centos-kickstart.cfg"
],
"iso_url": "file:///{{ pwd }}/CentOS-7-x86_64-Minimal-1611.iso",
"iso_checksum": "27bd866242ee058b7a5754e83d8ee8403e216b93d130d800852a96f41c34d86a",
"iso_checksum_type": "sha256",
"boot_wait": "5s",
"boot_command": [
"<tab> text ks=hd:fd0:/centos-kickstart.cfg<enter><wait>"
],
"ssh_wait_timeout": "10m",
"ssh_username": "root",
"ssh_password": "packer",
"shutdown_command": "shutdown -hP now",
"shutdown_timeout": "3m"
}
]
}
以下是构建过程的(有条理截断的)日志:
> docker run -it -e PACKER_LOG=1 -v $(pwd):/opt/ -w /opt/ hashicorp/packer:light build -var-file=env.json packer.json
2017/02/02 02:06:40 [INFO] Packer version: 0.12.2
2017/02/02 02:06:40 Packer Target OS/Arch: linux amd64
2017/02/02 02:06:40 Built with Go Version: go1.7.4
2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 Using internal plugin for azure-arm
2017/02/02 02:06:40 Using internal plugin for file
2017/02/02 02:06:40 Using internal plugin for null
2017/02/02 02:06:40 Using internal plugin for openstack
2017/02/02 02:06:40 Using internal plugin for parallels-pvm
2017/02/02 02:06:40 Using internal plugin for qemu
2017/02/02 02:06:40 Using internal plugin for vmware-vmx
2017/02/02 02:06:40 Using internal plugin for amazon-chroot
2017/02/02 02:06:40 Using internal plugin for amazon-ebs
2017/02/02 02:06:40 Using internal plugin for digitalocean
2017/02/02 02:06:40 Using internal plugin for oneandone
2017/02/02 02:06:40 Using internal plugin for profitbricks
2017/02/02 02:06:40 Using internal plugin for triton
2017/02/02 02:06:40 Using internal plugin for virtualbox-ovf
2017/02/02 02:06:40 Using internal plugin for amazon-ebsvolume
2017/02/02 02:06:40 Using internal plugin for amazon-instance
2017/02/02 02:06:40 Using internal plugin for cloudstack
2017/02/02 02:06:40 Using internal plugin for googlecompute
2017/02/02 02:06:40 Using internal plugin for hyperv-iso
2017/02/02 02:06:40 Using internal plugin for vmware-iso
2017/02/02 02:06:40 Using internal plugin for docker
2017/02/02 02:06:40 Using internal plugin for parallels-iso
2017/02/02 02:06:40 Using internal plugin for virtualbox-iso
2017/02/02 02:06:40 Using internal plugin for powershell
2017/02/02 02:06:40 Using internal plugin for salt-masterless
2017/02/02 02:06:40 Using internal plugin for ansible-local
2017/02/02 02:06:40 Using internal plugin for chef-solo
2017/02/02 02:06:40 Using internal plugin for converge
2017/02/02 02:06:40 Using internal plugin for shell
2017/02/02 02:06:40 Using internal plugin for windows-restart
2017/02/02 02:06:40 Using internal plugin for ansible
2017/02/02 02:06:40 Using internal plugin for puppet-server
2017/02/02 02:06:40 Using internal plugin for windows-shell
2017/02/02 02:06:40 Using internal plugin for chef-client
2017/02/02 02:06:40 Using internal plugin for file
2017/02/02 02:06:40 Using internal plugin for puppet-masterless
2017/02/02 02:06:40 Using internal plugin for shell-local
2017/02/02 02:06:40 Using internal plugin for checksum
2017/02/02 02:06:40 Using internal plugin for docker-tag
2017/02/02 02:06:40 Using internal plugin for googlecompute-export
2017/02/02 02:06:40 Using internal plugin for vagrant
2017/02/02 02:06:40 Using internal plugin for atlas
2017/02/02 02:06:40 Using internal plugin for compress
2017/02/02 02:06:40 Using internal plugin for docker-import
2017/02/02 02:06:40 Using internal plugin for docker-push
2017/02/02 02:06:40 Using internal plugin for artifice
2017/02/02 02:06:40 Using internal plugin for manifest
2017/02/02 02:06:40 Using internal plugin for shell-local
2017/02/02 02:06:40 Using internal plugin for vsphere
2017/02/02 02:06:40 Using internal plugin for amazon-import
2017/02/02 02:06:40 Using internal plugin for docker-save
2017/02/02 02:06:40 Using internal plugin for vagrant-cloud
2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 Attempting to open config file: /root/.packerconfig
2017/02/02 02:06:40 [WARN] Config file doesn't exist: /root/.packerconfig
2017/02/02 02:06:40 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[azure-arm:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm amazon-chroot:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot triton:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton cloudstack:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack googlecompute:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute file:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file null:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null openstack:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack parallels-pvm:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm vmware-vmx:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx amazon-ebsvolume:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume vmware-iso:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso virtualbox-iso:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso qemu:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu digitalocean:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean profitbricks:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks amazon-instance:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance parallels-iso:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso amazon-ebs:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs oneandone:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone virtualbox-ovf:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf hyperv-iso:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso docker:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker] PostProcessors:map[vagrant-cloud:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud googlecompute-export:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export docker-save:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save manifest:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest docker-push:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push artifice:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice atlas:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas compress:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress docker-import:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import shell-local:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local checksum:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum vagrant:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant amazon-import:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import docker-tag:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag vsphere:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere] Provisioners:map[powershell:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell chef-solo:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo windows-restart:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart shell-local:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local salt-masterless:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless ansible-local:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local puppet-server:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server file:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file puppet-masterless:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless converge:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge shell:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell windows-shell:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell ansible:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible chef-client:/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client]}
2017/02/02 02:06:40 Setting cache directory: /opt/packer_cache
2017/02/02 02:06:40 Loading builder: vmware-iso
2017/02/02 02:06:40 Plugin could not be found. Checking same directory as executable.
2017/02/02 02:06:40 Current exe path: /bin/packer
2017/02/02 02:06:40 Creating plugin client for path: /bin/packer
2017/02/02 02:06:40 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-builder-vmware-iso"}
2017/02/02 02:06:40 Waiting for RPC address for: /bin/packer
2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 [INFO] Packer version: 0.12.2
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Packer Target OS/Arch: linux amd64
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Built with Go Version: go1.7.4
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Attempting to open config file: /root/.packerconfig
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 [WARN] Config file doesn't exist: /root/.packerconfig
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Setting cache directory: /opt/packer_cache
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 args: []string{"packer-builder-vmware-iso"}
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Plugin minimum port: 10000
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Plugin maximum port: 25000
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Plugin address: unix /tmp/packer-plugin313198337
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Waiting for connection...
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Serving a plugin connection...
2017/02/02 02:06:40 Loading provisioner: shell
2017/02/02 02:06:40 Plugin could not be found. Checking same directory as executable.
2017/02/02 02:06:40 Current exe path: /bin/packer
2017/02/02 02:06:40 Creating plugin client for path: /bin/packer
2017/02/02 02:06:40 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2017/02/02 02:06:40 Waiting for RPC address for: /bin/packer
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 [INFO] Packer version: 0.12.2
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Packer Target OS/Arch: linux amd64
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Built with Go Version: go1.7.4
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Attempting to open config file: /root/.packerconfig
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 [WARN] Config file doesn't exist: /root/.packerconfig
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Setting cache directory: /opt/packer_cache
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Detected home directory from env var: /root
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 args: []string{"packer-provisioner-shell"}
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Plugin minimum port: 10000
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Plugin maximum port: 25000
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Plugin address: unix /tmp/packer-plugin616462938
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Waiting for connection...
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Serving a plugin connection...
2017/02/02 02:06:40 ui: [1;32mvmware-iso output will be in this color.[0m
2017/02/02 02:06:40 ui:
2017/02/02 02:06:40 Build debug mode: false
2017/02/02 02:06:40 Force build: false
2017/02/02 02:06:40 On error:
2017/02/02 02:06:40 Preparing build: vmware-iso
[1;32mvmware-iso output will be in this color.[0m
2017/02/02 02:06:40 Waiting on builds to complete...
2017/02/02 02:06:40 Starting build run: vmware-iso
2017/02/02 02:06:40 Running builder: vmware-iso
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 reconnecting to TCP connection for SSH
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 handshaking with SSH
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Keyboard interactive challenge:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 -- User:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 -- Instructions:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 -- Question 1: Password:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Keyboard interactive challenge:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 -- User:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 -- Instructions:
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 handshake complete!
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 [INFO] no local agent socket, will not connect agent
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 opening new ssh session
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 starting remote command: esxcli --formatter csv system version get
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 Connected to VMware ESXi 6.0.0 Releasebuild-4192238
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 opening new ssh session
2017/02/02 02:06:40 packer: 2017/02/02 02:06:40 starting remote command: esxcli --formatter csv system settings advanced list -o /Net/GuestIPHack
2017/02/02 02:06:41 ui: [1;32m==> vmware-iso: Downloading or copying ISO[0m
[1;32m==> vmware-iso: Downloading or copying ISO[0m
[0;32m vmware-iso: Downloading or copying: file:///opt/CentOS-7-x86_64-Minimal-1611.iso[0m
2017/02/02 02:06:41 ui: [0;32m vmware-iso: Downloading or copying: file:///opt/CentOS-7-x86_64-Minimal-1611.iso[0m
2017/02/02 02:06:41 packer: 2017/02/02 02:06:41 Acquiring lock to download: file:///opt/CentOS-7-x86_64-Minimal-1611.iso
2017/02/02 02:06:41 packer: 2017/02/02 02:06:41 Parsed URL: &url.URL{Scheme:"file", Opaque:"", User:(*url.Userinfo)(nil), Host:"", Path:"/opt/CentOS-7-x86_64-Minimal-1611.iso", RawPath:"", ForceQuery:false, RawQuery:"", Fragment:""}
2017/02/02 02:06:41 packer: 2017/02/02 02:06:41 [DEBUG] Using local file: /opt/CentOS-7-x86_64-Minimal-1611.iso
2017/02/02 02:06:41 packer: 2017/02/02 02:06:41 Verifying checksum of /opt/CentOS-7-x86_64-Minimal-1611.iso
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 opening new ssh session
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 starting remote command: test -e /vmfs/volumes/Local_SSD/output-vmware-iso
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Remote command exited with '1': test -e /vmfs/volumes/Local_SSD/output-vmware-iso
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 opening new ssh session
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 starting remote command: mkdir -p /vmfs/volumes/Local_SSD/output-vmware-iso
2017/02/02 02:06:48 ui: [1;32m==> vmware-iso: Creating floppy disk...[0m
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Floppy path: /tmp/packer258977900
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Initializing block device backed by temporary file
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Formatting the block device with a FAT filesystem...
[1;32m==> vmware-iso: Creating floppy disk...[0m
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Initializing FAT filesystem on block device
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Reading the root directory from the filesystem
2017/02/02 02:06:48 ui: [0;32m vmware-iso: Copying files flatly from floppy_files[0m
[0;32m vmware-iso: Copying files flatly from floppy_files[0m
2017/02/02 02:06:48 ui: [0;32m vmware-iso: Copying file: /opt/files/centos-kickstart.cfg[0m
[0;32m vmware-iso: Copying file: /opt/files/centos-kickstart.cfg[0m
2017/02/02 02:06:48 ui: [0;32m vmware-iso: Done copying files from floppy_files[0m
2017/02/02 02:06:48 ui: [0;32m vmware-iso: Collecting paths from floppy_dirs[0m
2017/02/02 02:06:48 ui: [0;32m vmware-iso: Resulting paths from floppy_dirs : [][0m
[0;32m vmware-iso: Done copying files from floppy_files[0m
2017/02/02 02:06:48 ui: [0;32m vmware-iso: Done copying paths from floppy_dirs[0m
[0;32m vmware-iso: Collecting paths from floppy_dirs[0m
2017/02/02 02:06:48 ui: [1;32m==> vmware-iso: Uploading Floppy to remote machine...[0m
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Remote uploading: /tmp/packer258977900
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 opening new ssh session
[0;32m vmware-iso: Resulting paths from floppy_dirs : [][0m
[0;32m vmware-iso: Done copying paths from floppy_dirs[0m
[1;32m==> vmware-iso: Uploading Floppy to remote machine...[0m
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 starting remote command: mkdir -p /vmfs/volumes/Local_SSD/packer_cache
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Verifying checksum of /vmfs/volumes/Local_SSD/packer_cache/packer258977900
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 opening new ssh session
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 starting remote command: sha256sum -c
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Remote command exited with '1': sha256sum -c
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 opening new ssh session
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Starting remote scp process: scp -vt /vmfs/volumes/Local_SSD/packer_cache
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Started SCP session, beginning transfers...
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Copying input data into temporary file so we can read the length
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 [DEBUG] scp: Uploading packer258977900: perms=C0644 size=1474560
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 SCP session complete, closing stdin pipe.
2017/02/02 02:06:48 packer: 2017/02/02 02:06:48 Waiting for SSH session to complete.
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 scp stderr (length 36): Sink: C0644 1474560 packer258977900
[1;32m==> vmware-iso: Uploading ISO to remote machine...[0m
2017/02/02 02:06:49 ui: [1;32m==> vmware-iso: Uploading ISO to remote machine...[0m
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 Remote uploading: /opt/CentOS-7-x86_64-Minimal-1611.iso
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 opening new ssh session
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 starting remote command: mkdir -p /vmfs/volumes/Local_SSD/packer_cache
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 Verifying checksum of /vmfs/volumes/Local_SSD/packer_cache/CentOS-7-x86_64-Minimal-1611.iso
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 opening new ssh session
2017/02/02 02:06:49 packer: 2017/02/02 02:06:49 starting remote command: sha256sum -c
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Initial checksum matched, no upload needed.
2017/02/02 02:07:00 ui: [1;32m==> vmware-iso: Creating virtual machine disk[0m
[1;32m==> vmware-iso: Creating virtual machine disk[0m
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 opening new ssh session
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 starting remote command: vmkfstools -c 16384M -d zeroedthick -a lsilogic /vmfs/volumes/Local_SSD/output-vmware-iso/disk.vmdk
2017/02/02 02:07:00 ui: [1;32m==> vmware-iso: Building and writing VMX file[0m
[1;32m==> vmware-iso: Building and writing VMX file[0m
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Writing VMX to: /tmp/packer-vmx282708606/packer-vmware-iso.vmx
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.uptCompatibility' = 'TRUE'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.networkName' = 'VM Network'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.present' = 'TRUE'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.startConnected' = 'TRUE'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.virtualDev' = 'e1000'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.addressType' = 'generated'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Setting VMX: 'ethernet0.wakeOnPcktRcv' = 'FALSE'
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Floppy path present, setting in VMX
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Writing VMX to: /tmp/packer-vmx282708606/packer-vmware-iso.vmx
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Suppressing messages in VMX
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Looking for available port between 5900 and 6000
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 opening new ssh session
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 starting remote command: esxcli --formatter csv network ip connection list
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::5989, port 5989 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address ::1:8889, port 8889 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address fe80:2::6600:6aff:fe88:adfe:427, port 427 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address 192.168.110.124:427, port 427 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address 0.0.0.0:443, port 443 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::443, port 443 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address 0.0.0.0:80, port 80 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::80, port 80 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::22, port 22 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address 0.0.0.0:22, port 22 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::902, port 902 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address 0.0.0.0:902, port 902 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::8000, port 8000 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::8300, port 8300 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address :::8100, port 8100 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 ESXi listening on address ::1:2233, port 2233 unavailable for VNC
2017/02/02 02:07:00 packer: 2017/02/02 02:07:00 Trying address: 192.168.110.124:5900...
2017/02/02 02:07:01 packer: 2017/02/02 02:07:01 Timeout connecting to: 192.168.110.124:5900 (check firewall rules)
...等
2017/02/02 02:08:29 packer: 2017/02/02 02:08:29 Trying address: 192.168.110.124:5988...
2017/02/02 02:08:30 packer: 2017/02/02 02:08:30 Timeout connecting to: 192.168.110.124:5988 (check firewall rules)
2017/02/02 02:08:30 packer: 2017/02/02 02:08:30 Port 5989 in use
2017/02/02 02:08:30 packer: 2017/02/02 02:08:30 Trying address: 192.168.110.124:5990...
2017/02/02 02:08:31 packer: 2017/02/02 02:08:31 Timeout connecting to: 192.168.110.124:5990 (check firewall rules)
...等
2017/02/02 02:08:39 packer: 2017/02/02 02:08:39 Trying address: 192.168.110.124:5999...
2017/02/02 02:08:40 packer: 2017/02/02 02:08:40 Timeout connecting to: 192.168.110.124:5999 (check firewall rules)
2017/02/02 02:08:40 packer: 2017/02/02 02:08:40 Trying address: 192.168.110.124:6000...
[1;31m==> vmware-iso: Unable to find available VNC port between 5900 and 6000[0m
2017/02/02 02:08:41 packer: 2017/02/02 02:08:41 Timeout connecting to: 192.168.110.124:6000 (check firewall rules)
2017/02/02 02:08:41 ui error: [1;31m==> vmware-iso: Unable to find available VNC port between 5900 and 6000[0m
2017/02/02 02:08:41 packer: 2017/02/02 02:08:41 Deleting floppy disk: /tmp/packer258977900
2017/02/02 02:08:41 packer: 2017/02/02 02:08:41 opening new ssh session
2017/02/02 02:08:41 packer: 2017/02/02 02:08:41 starting remote command: test -e /vmfs/volumes/Local_SSD/output-vmware-iso
2017/02/02 02:08:41 ui: [1;32m==> vmware-iso: Deleting output directory...[0m
[1;32m==> vmware-iso: Deleting output directory...[0m
2017/02/02 02:08:41 packer: 2017/02/02 02:08:41 opening new ssh session
2017/02/02 02:08:41 packer: 2017/02/02 02:08:41 starting remote command: rm -rf /vmfs/volumes/Local_SSD/output-vmware-iso
2017/02/02 02:08:41 ui error: [1;31mBuild 'vmware-iso' errored: Unable to find available VNC port between 5900 and 6000[0m
2017/02/02 02:08:41 Builds completed. Waiting on interrupt barrier...
2017/02/02 02:08:41 machine readable: error-count []string{"1"}
2017/02/02 02:08:41 ui error:
==> Some builds didn't complete successfully and had errors:
2017/02/02 02:08:41 machine readable: vmware-iso,error []string{"Unable to find available VNC port between 5900 and 6000"}
2017/02/02 02:08:41 ui error: --> vmware-iso: Unable to find available VNC port between 5900 and 6000
2017/02/02 02:08:41 ui:
==> Builds finished but no artifacts were created.
2017/02/02 02:08:41 waiting for all plugin processes to complete...
[1;31mBuild 'vmware-iso' errored: Unable to find available VNC port between 5900 and 6000[0m
==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Unable to find available VNC port between 5900 and 6000
==> Builds finished but no artifacts were created.
2017/02/02 02:08:41 /bin/packer: plugin process exited
2017/02/02 02:08:41 /bin/packer: plugin process exited
相关问题:
答案 0 :(得分:0)
更新到最新的源码已经解决了@ rickard-von-essen提到的拉动请求中解决的问题。
为了将来的启发,从源代码构建最新的打包器:
docker run -it --rm --entrypoint /bin/sh -v $(pwd):/opt/ -w /opt/ hashicorp/packer:full
注意:您只需将$(pwd)
替换为本地项目目录即可。/go/src/github.com/mitchellh/packer
并运行以下一系列命令:
git pull
apk add make
make deps generate dev
/opt/
,现在您可以运行您的打包程序命令。您可以在另一个Dockerfile或打包程序构建中轻松自动执行此过程,以获得最前沿的docker镜像。