Abh*_*nav 4 installation kickstart vmware-esxi centos6
我试图为 CentOS 6.4 进行 kickstart 安装,但它总是向我显示重新初始化 HDD 的警告,因为它说可能包含无效的分区表或虚拟磁盘。我在下面添加的是我正在尝试使用的 kickstart 文件的快照
# System bootloader configuration
bootloader --append="crashkernel=auto rhgb quiet" --location=mbr --driveorder="sda"
autopart
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel --drives=sda
part /boot --fstype ext4 --size=300
part / --fstype="ext4" --grow --size=1 --asprimary
Run Code Online (Sandbox Code Playgroud)
即使我已经创建了分区来尝试作为解决方法,但没有办法。任何想法如何使此警告消失。我正在尝试通过运行 ESXI 主机(具有 5.5 版本)的 Packer-tools 来执行此操作。下面是我正在使用的 JSON 模板
# cat base-packer.json
{
"builders": [
{
"vm_name": "Centos6.5",
"type": "vmware-iso",
"iso_url": "http://127.0.0.1:8000/CentOS-6.5-x86_64-minimal.iso",
"iso_checksum": "0d9dc37b5dd4befa1c440d2174e88a87",
"iso_checksum_type": "md5",
"disk_size": "20480",
"disk_type_id": "thin",
"http_directory": "~/packertemplatebuilding",
"remote_host": "191.168.42.3",
"remote_datastore": "52dfe32b-a996d262-9b46-2c4138a85a23/Centos6.5",
"remote_username": "root",
"remote_password": "rootpass",
"remote_type": "esx5",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "250s",
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"headless": "false",
"boot_command": [
"<tab> text ks=http://148.147.206.152:8000/ks_new.cfg<enter><wait>"
],
"boot_wait": "20s",
"vmx_data": {
"ethernet0.virtualDev": "vmxnet3",
"ethernet0.networkName": "VM Network",
"ethernet0.addressType": "generated",
"ethernet0.present": "TRUE",
"ethernet1.virtualDev": "vmxnet3",
"ethernet1.networkName": "VM Network 2",
"ethernet1.addressType": "generated",
"ethernet1.present": "TRUE",
"ide0:0.fileName": "disk.vmdk",
"ide0:0.present": "TRUE",
"ide0:0.redo": "",
"scsi0:0.present": "FALSE",
"memsize": "2048",
"numvcpus": "2",
"cpuid.coresPerSocket": "1"
}
}
],
"provisioners": [
{
"type": "shell",
"script": "ssh-commands.sh"
}
]
}
Run Code Online (Sandbox Code Playgroud)
下面是我得到的错误的快照。
PS 我使用的图像是来自 CentOS 6.4 的自定义旋转。但我不认为 kickstart 配置应该对此产生影响。
如果您在 EL6 kickstart 中收到类似于以下内容的错误消息,则需要将其添加zerombr
到 kickstart 命令集中。
你也应该有这个:
zerombr
clearpart --all --initlabel
Run Code Online (Sandbox Code Playgroud)
从文档:
zerombr:如果指定 zerombr,则初始化磁盘上发现的任何无效分区表。这会破坏分区表无效的磁盘的所有内容。在具有先前初始化磁盘的系统上执行无人值守安装时需要此命令。
编辑:
我刚刚在一个运行在 vSphere 5.5 平台上的新 CentOS EL6.5 虚拟机上尝试了这个......以下连续工作了 3 次没有问题,包括在相同的磁盘上重新安装:
zerombr
clearpart --all --initlabel
part /boot --fstype ext4 --size=300
part /usr --fstype ext4 --size=10240 --asprimary
part / --fstype ext4 --size=20480 --asprimary
part /var --fstype ext4 --size=6144
part swap --size=8192
part /tmp --fstype ext4 --size=2048
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2892 次 |
最近记录: |