我想使用Gitlab-Runner创建一个虚拟机映像(Centos7)。 Gitlab-Runner在Openshift集群中运行,不幸的是,该集群不支持vmx。
cat / proc / cpuinfo返回处理器标志:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 ida arat pku ospke
在实验中,我在docker容器中安装了packer和qemu。在我的gitlab-ci.yml文件中,我尝试使用此容器来构建虚拟机映像。
当我使用命令
packer build -debug -force --only=qemu centos7.json
我收到错误
Starting builder qemu
packer-builder-qemu plugin: Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image page: /usr/bin/qemu-img
packer-builder-qemu plugin: stderr:
packer-builder-qemu plugin: Error asking for input: no available tty
packer-builder-qemu plugin: Found available port: 8392 on IP: 0.0.0.0
packer-builder-qemu plugin: Looking for available communicator (SSH, WinRM, etc) port between 2222 and 4444
packer-builder-qemu plugin: Found available port: 2950 on IP: 127.0.0.1
packer-builder-qemu plugin: Qemu --version output: QEMU emulator version 4.0.1
packer-builder-qemu plugin: Qemu version: 4.0.1
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5909
qemu: The VM will be run headless, without a GUI. If you want to
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5909
packer-builder-qemu plugin: Started Qemu. Pid: 112
packer-builder-qemu plugin: Qemu stderr: Could not access KVM kernel module: No such file or directory
packer-builder-qemu plugin: Qemu stderr: qemu-system-x86_64: failed to initialize KVM: No such file or directory
我认为问题在于Openshift集群的处理器不支持vmx。不幸的是,我无法从Openshift集群更改处理器设置。
您知道在这种群集上是否还有另一种构建虚拟机映像的方法吗? 我想构建一个qcow2映像(Centos-7,其中包含预配置的网络和软件设置)