Skip to content

Commit 30c9857

Browse files
authored
Merge pull request #49215 from sjhala-ccs/cnv-17637
CNV-17637: Corrected clouInitNoCloud userData syntax
2 parents 7824f25 + 5d75026 commit 30c9857

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

modules/virt-accessing-vm-yaml-ssh.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ The following examples show the configurations for the VM's YAML file and the se
2020
.Example `VirtualMachine` definition
2121
[source,yaml]
2222
----
23-
...
2423
apiVersion: kubevirt.io/v1
2524
kind: VirtualMachine
2625
metadata:
@@ -62,9 +61,11 @@ spec:
6261
- name: cloudinitdisk
6362
cloudInitNoCloud:
6463
userData: |
65-
#!/bin/bash
66-
echo "fedora" | passwd fedora --stdin
67-
...
64+
#cloud-config
65+
user: fedora
66+
password: fedora
67+
chpasswd: {expire: False}
68+
# ...
6869
----
6970
<1> Name of the namespace created by the `oc create namespace` command.
7071
<2> Label used by the service to identify the virtual machine instances that are enabled for SSH traffic connections. The label can be any `key:value` pair that is added as a `label` to this YAML file and as a `selector` in the service YAML file.
@@ -90,7 +91,6 @@ $ virtctl start vm-ssh
9091
.Example `Service` definition
9192
[source,yaml]
9293
----
93-
...
9494
apiVersion: v1
9595
kind: Service
9696
metadata:
@@ -104,7 +104,7 @@ spec:
104104
selector:
105105
special: vm-ssh <4>
106106
type: NodePort
107-
...
107+
# ...
108108
----
109109
<1> Name of the SSH service.
110110
<2> Name of the namespace created by the `oc create namespace` command.

modules/virt-creating-a-service-from-a-virtual-machine.adoc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ spec:
8282
- name: cloudinitdisk
8383
cloudInitNoCloud:
8484
userData: |
85-
#!/bin/bash
86-
echo "fedora" | passwd fedora --stdin
85+
#cloud-config
86+
user: fedora
87+
password: fedora
88+
chpasswd: {expire: False}
89+
# ...
8790
----
8891
<1> Add the label `special: key` in the `spec.template.metadata.labels` section.
8992
+
@@ -206,8 +209,11 @@ spec:
206209
- name: cloudinitdisk
207210
cloudInitNoCloud:
208211
userData: |
209-
#!/bin/bash
210-
echo "fedora" | passwd fedora --stdin
212+
#cloud-config
213+
user: fedora
214+
password: fedora
215+
chpasswd: {expire: False}
216+
# ...
211217
----
212218
+
213219

modules/virt-template-vm-pxe-config.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ spec:
5555
image: kubevirt/fedora-cloud-container-disk-demo
5656
- cloudInitNoCloud:
5757
userData: |
58-
#!/bin/bash
59-
echo "fedora" | passwd fedora --stdin
58+
#cloud-config
59+
user: fedora
60+
password: fedora
61+
chpasswd: {expire: False}
6062
name: cloudinitdisk
6163
status: {}
6264
----

0 commit comments

Comments
 (0)