Skip to content

Commit 475e284

Browse files
authored
Merge pull request #61905 from apinnick/CNV-28700-update-ip-yaml
CNV -28700: Update YAMLs and mention default VM route
2 parents bf741d1 + 1b00fe0 commit 475e284

File tree

2 files changed

+39
-30
lines changed

2 files changed

+39
-30
lines changed

modules/virt-configuring-ip-for-new-vm-cloud-init.adoc

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,60 @@
66
[id="virt-configuring-ip-for-new-vm-cloud-init_{context}"]
77
= Configuring an IP address for a new virtual machine using cloud-init
88

9-
You can use cloud-init to configure an IP address when you create a virtual machine. The IP address can be dynamically or statically provisioned.
9+
You can use cloud-init to configure the IP address of a secondary NIC when you create a virtual machine (VM). The IP address can be dynamically or statically provisioned.
10+
11+
[NOTE]
12+
====
13+
If the VM is connected to the pod network, the pod network interface is the default route unless you update it.
14+
====
15+
16+
.Prerequisites
17+
18+
* The virtual machine is connected to a secondary network.
19+
* You have a DHCP server available on the secondary network to configure a dynamic IP for the virtual machine.
1020
1121
.Procedure
1222

13-
* Create a virtual machine configuration and include the cloud-init network details in the `spec.volumes.cloudInitNoCloud.networkData` field of the virtual machine configuration:
23+
* Edit the `spec.template.spec.volumes.cloudInitNoCloud.networkData` stanza of the virtual machine configuration:
1424
15-
.. To configure a dynamic IP, specify the interface name and the `dhcp4` boolean:
25+
** To configure a dynamic IP address, specify the interface name and enable DHCP:
1626
+
1727
[source,yaml]
1828
----
1929
kind: VirtualMachine
2030
spec:
2131
# ...
22-
volumes:
23-
- cloudInitNoCloud:
24-
networkData: |
25-
version: 2
26-
ethernets:
27-
eth1: <1>
28-
dhcp4: true <2>
32+
template:
33+
# ...
34+
spec:
35+
volumes:
36+
- cloudInitNoCloud:
37+
networkData: |
38+
version: 2
39+
ethernets:
40+
eth1: <1>
41+
dhcp4: true
2942
----
30-
<1> The interface name.
31-
<2> Uses DHCP to provision an IPv4 address.
43+
<1> Specify the interface name.
3244

33-
.. To configure a static IP, specify the interface name and the IP address:
45+
** To configure a static IP, specify the interface name and the IP address:
3446
+
3547
[source,yaml]
3648
----
3749
kind: VirtualMachine
3850
spec:
3951
# ...
40-
volumes:
41-
- cloudInitNoCloud:
42-
networkData: |
43-
version: 2
44-
ethernets:
45-
eth1: <1>
46-
addresses:
47-
- 10.10.10.14/24 <2>
52+
template:
53+
# ...
54+
spec:
55+
volumes:
56+
- cloudInitNoCloud:
57+
networkData: |
58+
version: 2
59+
ethernets:
60+
eth1: <1>
61+
addresses:
62+
- 10.10.10.14/24 <2>
4863
----
49-
<1> The interface name.
50-
<2> The static IP address for the virtual machine.
64+
<1> Specify the interface name.
65+
<2> Specify the static IP address.

virt/virtual_machines/vm_networking/virt-configuring-ip-for-vms.adoc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
You can configure either dynamically or statically provisioned IP addresses for virtual machines.
10-
11-
.Prerequisites
12-
13-
* The virtual machine must connect to an xref:../../../virt/virtual_machines/vm_networking/virt-attaching-vm-multiple-networks.adoc#virt-attaching-vm-multiple-networks[external network].
14-
15-
* You must have a DHCP server available on the additional network to configure a dynamic IP for the virtual machine.
9+
You can configure static and dynamic IP addresses for virtual machines.
1610

1711
include::modules/virt-configuring-ip-for-new-vm-cloud-init.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)