When creating a VM attached to a load balancer, cert server puts a certificate into the folder /vm/inhost_name/cert by executing `sudo host/bin/setup-cert-server put-certificate inhost_name` During that call, before writing the certs, it first creates the cert folder using `mkdir_p` (as the root user). If /vm/inhost_name didn't exist yet at that point, the folder /vm/inhost_name was created like this: ``` ll inhost_name total 12 drwxr-xr-x 3 root root 4096 May 9 12:52 ./ drwxr-xr-x 7 root root 4096 May 9 12:52 ../ drwxr-xr-x 2 root root 4096 May 9 12:52 cert/ ``` This is what subsequently happens to VM provisioning in that case: * create_unix_user: succeeds but gives this warning ``` adduser: Warning: The home directory `/vm/inhost_name' does not belong to the user you are currently creating. ``` * prep: Fails with `tee: /vm/inhost_name/prep.json: Permission denied` As a fix, we use `mkdir` instead of `mkdir_p` and just ignore the error indicating that the folder already exists. That way, it won't create the /vm/inhost_name folder. Putting the certificate should succeed after `create_unix_user` has created /vm/inhost_name.
3.0 KiB
3.0 KiB