[Vsphere-ISO - Centos 8] I am stuck in login stage when running Packer

8 views
Skip to first unread message

Vũ Bùi Quang

unread,
Sep 1, 2021, 12:52:49 AMSep 1
to Packer
I am running packer for building Centos 8 VM. After it install package, lang, localtion. I am stuck in this stage:

1Ta0A.png

I will attack files below, and paste code here in case you don't want to open files. I'm sorry, it's quite long. I don't know how to shorten it. 

I have no clue for this case. I didn't get error response or any. If you have any idea or solution. Please let me know.

Thank you so much.

This is packer files
```
{​​​​​​​​
"builders": [
    {​​​​​​​​
"CPUs": "{​​​​​​​​{​​​​​​​​user `vm-cpu-num`}​​​​​​​​}​​​​​​​​",
"RAM": "{​​​​​​​​{​​​​​​​​user `vm-mem-size`}​​​​​​​​}​​​​​​​​",
"RAM_reserve_all": false,
"boot_command": ["up", "e", "<down><down><end><wait>", "text ks=http://{​​​​​​​​{​​​​​​​​ .HTTPIP }​​​​​​​​}​​​​​​​​:{​​​​​​​​{​​​​​​​​ .HTTPPort }​​​​​​​​}​​​​​​​​/ks.cfg", "<enter><wait><leftCtrlOn>x<leftCtrlOff>"],
"ip_wait_timeout": "30m",
"boot_order": "disk,cdrom",
"boot_wait": "10s",
"cluster": "{​​​​​​​​{​​​​​​​​user `vsphere-cluster`}​​​​​​​​}​​​​​​​​",
"host": "10.88.77.9",
"convert_to_template": true,
"datacenter": "{​​​​​​​​{​​​​​​​​user `vsphere-datacenter`}​​​​​​​​}​​​​​​​​",
"folder": "Lin-DevInt",
"datastore": "{​​​​​​​​{​​​​​​​​user `vsphere-datastore`}​​​​​​​​}​​​​​​​​",
"disk_controller_type": "pvscsi",
"cdrom_type": "sata",
"http_port_min"    : "8081",
"http_port_max"   : "8090",
"http_directory"   : "http",
"shutdown_command" : "echo '0203' | sudo -S -E shutdown -P now",
"shutdown_timeout" : "300s",
"guest_os_type": "centos8_64Guest",
"insecure_connection": "true",
"firmware": "efi-secure",
"iso_paths": [
"{​​​​​​​​{​​​​​​​​user `iso_url`}​​​​​​​​}​​​​​​​​"
      ],
"network_adapters": [
        {​​​​​​​​
"network": "{​​​​​​​​{​​​​​​​​user `vsphere-network`}​​​​​​​​}​​​​​​​​",
"network_card": "vmxnet3"
        }​​​​​​​​
      ],
"notes": "Build via Packer",
"password": "{​​​​​​​​{​​​​​​​​user `vsphere-password`}​​​​​​​​}​​​​​​​​",
"ssh_password": "packer",
"ssh_username": "root",
"storage": [
        {​​​​​​​​
"disk_size": "{​​​​​​​​{​​​​​​​​user `vm-disk-size`}​​​​​​​​}​​​​​​​​",
"disk_thin_provisioned": true
        }​​​​​​​​
      ],
"type": "vsphere-iso",
"username": "{​​​​​​​​{​​​​​​​​user `vsphere-user`}​​​​​​​​}​​​​​​​​",
"vcenter_server": "{​​​​​​​​{​​​​​​​​user `vsphere-server`}​​​​​​​​}​​​​​​​​",
"vm_name": "{​​​​​​​​{​​​​​​​​user `vm-name`}​​​​​​​​}​​​​​​​​"
    }​​​​​​​​
  ],
"variables": {​​​​​​​​
"iso_url": "[SDC_ContentLibrary] contentlib-f7eac288-b201-40e6-a277-e463ec593650/2e929d06-6981-4f45-ad87-8e72d211e3fa/CentOS-8.3.2011-x86_64-minimal_16e7c44a-00c6-469c-8786-2879b08061e6.iso",
"vm-cpu-num": "3",
"vm-disk-size": "16384",
"vm-mem-size": "4000",
"vm-name": "my-vm-name.com",
"vsphere-cluster": "mycluster",
"vsphere-host": "11.11.11.11",
"vsphere-datacenter": "my-datacenter",
"vsphere-datastore": "my-datastore",
"vsphere-network": "my-network",
"vsphere-password": "mypass",
"vsphere-server": "my-server",
"vsphere-user": "user"
  }​​​​​​​​
}​​​​​​​​
```

This is ks.cfg files:
```
install
cdrom
lang en_US.UTF-8
keyboard es
network --bootproto=dhcp --device=link --activate
network --hostname=centos8.localdomain
rootpw $1$+xLTvuVv$vAMwt4RuJqO3qp9nLQj1U0 --iscrypted
selinux --enforcing
skipx
timezone Europe/Paris --isUtc
user --groups=wheel --name=packer --password=$6$Jaa5U0EwAPMMp3.5$m29yTwr0q9ZJVJGMXvOnm9q2z13ldUFTjB1sxPHvaiW4upMSwQ50181wl7SjHjh.BTH7FGHx37wrX..SM0Bqq. --iscrypted --gecos="packer"
bootloader --location=mbr --append="crashkernel=auto"
zerombr
clearpart --all --initlabel
autopart --type=lvm
reboot
 
%packages --ignoremissing
@^minimal-environment
-iwl*firmware
%end
 
%post --log=/root/ks-post.log
dnf install -y open-vm-tools
dhclient -v
%end
```

centos_vsphere.json
ks.cfg
Reply all
Reply to author
Forward
0 new messages