IBM / ibmi-cloudinit

Porting open source cloudinit to IBM i
GNU General Public License v3.0
5 stars 3 forks source link

IBM Cloud does not support `cloud-init` scripts with`runcmd` #2

Open timothydilbert opened 1 month ago

timothydilbert commented 1 month ago

When provisioning a new IBMi PowerVSI under a PowerVC workspace, and entering a cloud-init script containing runcmd, the VSI request fails with a 403 error: Response not successful: Received status code 403.

See example script below aimed at enabling SSH access for QSECOFR:

#cloud-config

users:
  - name: qsecofr
    ssh_authorized_keys:
      - ssh-rsa AAAAB3N...Much.longer. key.TrX7B
runcmd:
  - sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /QOpenSys/etc/ssh/sshd_config
  - sed -i 's/^#PublicKeyAuthentication.*/PublicKeyAuthentication yes/' /QOpenSys/etc/ssh/sshd_config
  - system 'ENDTCPSVR SERVER(*SSHD)'
  - system 'STRTCPSVR SERVER(*SSHD)'
  - system 'CHGUSRPRF USRPRF(QSECOFR) STATUS(*ENABLED)'
  - system 'ENDTCPSVR SERVER(*SSHD)'
  - system 'STRTCPSVR SERVER(*SSHD)'

Feels safe to assume that IBM Cloud would be the primary place to utilise cloud-init. And if it does not support runcmd, then it belittles the usefulness.

raeyacld commented 2 weeks ago

sorry for the late response. can you share /var/log/clooud-init.log?