How to set startup root folder for a Perforce cloud VM (Enhanced Studio Pack)?

46 Views Asked by At

I have a Perforce server set up on a cloud VM with the Perforce Enhanced Studio Pack, set up according to the official Perforce tutorial. It uses AWS CloudFormation to set up an EC2 instance and separate EBS volumes for depots, logs, and journal.

By default, when the VM starts up, it runs the p4d server in the /p4/1/root/ root folder. However, my depot is at /hxdepots/p4/1/root/. That path is located on an EBS volume, mounted at /hxdepots/, which is large, resizable, easy to back up, while the default root is located on the internal filesystem of the VM, which has none of those features.

Because of this, every time the VM has to be restarted, I have to manually kill the server, and restart it in a different root folder. Is there a way to avoid this, and set the default root folder of the auto-starting server to the needed location?

I assume there's an environment variable, or some configuration file?

1

There are 1 best solutions below

2
Jase On

On the enhanced studio pack the folder /p4/1/root is a symlink to /hxmetadata/p4/1/db1 The same is true with most all of the folders inside /p4/ such as /p4/1/logs symlinking to /hxlogs/p4/1/logs volume.

If you run ls -la /p4/1/ you should see that many of those folders are symlinks.

One important thing about the snapshots and backups, though. When backing up a Helix Core server, there are two things that need to be backed up: a checkpoint file and the depot files (note, this is not the database itself but a checkpoint of the database).

In the case of the ESP, the depot files are stored in /p4/1/depots which is symlinked to /hxdepots/p4/1/depots and daily checkpoints are created in /p4/1/checkpoints which is symlinked to /hxdepots/p4/1/checkpoints. This means an AWS snapshot of the /hxdepots volume will contain everything you need to restore from backup.

The /hxlogs volume is also set to have daily snapshots on AWS because that is helpful with diagnosing problems, should the worst happen.

Hope that helps!