← Back to team overview

cloud-init team mailing list archive

Kernel parameters ip or network-config

 

Hello guys,

I've a problem with deploying a Cloud-init Debian Instance. I dont have
an Openstack and I prefer to deploy via virt-install and kernel
parameters. Everything works well, only the ip= or network-config stack
is going wrong. I've read in the manual it's possible to make it with
base64 encodig or with yaml parameters in one line. But I cant write it
in one line. Here is my example code:


#my network settings i wish to deploy via kernel parameters
version: 1
config:
  - type: physical
    name: ens2
    mac_address: "52:54:00:c5:dd:54"
    subnets:
      - type: static
        address: 10.30.0.227/17
        gateway: 10.30.0.1
        dns_nameservers:
          - 10.30.128.11

#in base64:
dmVyc2lvbjogMQpjb25maWc6CiAgLSB0eXBlOiBwaHlzaWNhbAogICAgbmFtZTogZW5zMgogICAgbWFjX2FkZHJlc3M6ICI1Mjo1NDowMDpjNTpkZDo1NCIKICAgIHN1Ym5ldHM6CiAgICAgIC0gdHlwZTogc3RhdGljCiAgICAgICAgYWRkcmVzczogMTAuMzAuMC4yMjcvMTcKICAgICAgICBnYXRld2F5OiAxMC4zMC4wLjEKICAgICAgICBkbnNfbmFtZXNlcnZlcnM6CiAgICAgICAgICAtIDEwLjMwLjEyOC4xMQ

#my vrit-install example (everything else works well like s=.... h=...
and so on)


# with ip=
virt-install --name test-martin2 \
  --ram 512 \
  --disk /zpool/vms/debian-9.5.7-20181103-openstack-amd64.raw \
  --network bridge=VLAN.1,mac="52:54:00:c5:dd:54" \
  --boot
kernel=/tmp/vmlinuz-4.9.0-8-amd64,initrd=/tmp/initrd.img-4.9.0-8-amd64,kernel_args="console=ttyS0
root=UUID=ab2532f3-0120-46ec-8bf1-8997bf08ad9b
ds=nocloud-net;s=http://10.30.0.229/;h=test-martin;ip=dmVyc2lvbjogMQpjb25maWc6CiAgLSB0eXBlOiBwaHlzaWNhbAogICAgbmFtZTogZW5zMgogICAgbWFjX2FkZHJlc3M6ICI1Mjo1NDowMDpjNTpkZDo1NCIKICAgIHN1Ym5ldHM6CiAgICAgIC0gdHlwZTogc3RhdGljCiAgICAgICAgYWRkcmVzczogMTAuMzAuMC4yMjcvMTcKICAgICAgICBnYXRld2F5OiAxMC4zMC4wLjEKICAgICAgICBkbnNfbmFtZXNlcnZlcnM6CiAgICAgICAgICAtIDEwLjMwLjEyOC4xMQ==";
\
  --serial=pty \
  --nographics


# with network-config
  virt-install --name test-martin2 \
  --ram 512 \
  --disk /zpool/vms/debian-9.5.7-20181103-openstack-amd64.raw \
  --network bridge=VLAN.1,mac="52:54:00:c5:dd:54" \
  --boot
kernel=/tmp/vmlinuz-4.9.0-8-amd64,initrd=/tmp/initrd.img-4.9.0-8-amd64,kernel_args="console=ttyS0
root=UUID=ab2532f3-0120-46ec-8bf1-8997bf08ad9b
ds=nocloud-net;s=http://10.30.0.229/;h=test-martin;network-config=dmVyc2lvbjogMQpjb25maWc6CiAgLSB0eXBlOiBwaHlzaWNhbAogICAgbmFtZTogZW5zMgogICAgbWFjX2FkZHJlc3M6ICI1Mjo1NDowMDpjNTpkZDo1NCIKICAgIHN1Ym5ldHM6CiAgICAgIC0gdHlwZTogc3RhdGljCiAgICAgICAgYWRkcmVzczogMTAuMzAuMC4yMjcvMTcKICAgICAgICBnYXRld2F5OiAxMC4zMC4wLjEKICAgICAgICBkbnNfbmFtZXNlcnZlcnM6CiAgICAgICAgICAtIDEwLjMwLjEyOC4xMQ==";
\
  --serial=pty \
  --nographics

Link to manual
https://cloudinit.readthedocs.io/en/latest/topics/network-config.html


best regards
Martin