我在centos (7.4)上运行自托管ovirt引擎(4.2)。
我正在尝试部署带有ipaddr和dns的普通测试vm,以检查ssh连接。然而,ansible playbook (下面的代码片段)运行时没有错误,但当我尝试查看vm状态时,我没有看到ipaddr,因此无法ping或ssh到新vm。
- name: Add vanilla vm
ovirt_vms:
auth: "{{ ovirt_auth }}"
name: test01
cluster: Default
state: running
memory: 2GiB
cpu_cores: 8
operating_system: rhel_7x64
high_availability: true
high_availability_priority: 50 # Available from Ansible 2.5
cloud_init:
nic_boot_protocol: static
nic_ip_address: 10.34.60.86
nic_netmask: 255.255.252.0
nic_gateway: 10.34.63.254
nic_name: eth1
nic_on_boot: true
host_name: test01.ovirt.dw
custom_script: |
write_files:
- content: |
Hello, world!
path: /tmp/greeting.txt
permissions: '0644'
user_name: root
root_password: super_password
nics:
- name: vnet0
network: ovirtmgmt
profile: ovirtmgmt
interface: virtio是不是遗漏了什么,或者需要在这些上面传递一些东西?
发布于 2018-08-07 16:42:52
根据您的脚本,您没有使用任何模板,所以默认情况下,它是从没有安装任何操作系统的Blank模板创建的。您必须首先创建一些安装了操作系统的模板,并从该模板创建虚拟机。
还请注意,只有在虚拟机上安装了来宾代理时,才会报告虚拟机的IP地址,因此最好将其预先安装在模板中。下面介绍如何安装来宾代理:
https://www.ovirt.org/documentation/how-to/guest-agent/install-the-guest-agent-in-centos/
https://stackoverflow.com/questions/50602752
复制相似问题