I deploy some VM's instances in my cloud infrastructure with bash script:
#!/bin/bash
instance_name="vm"
# create instance
yc compute instance create \
--name $instance_name \
--hostname reddit-app \
--memory=2 \
...
I need to add timestamp to instance's name in format vm-DD-MM_YYYY-H-M-S
.
For debug I tried to set value instance_name=$(date +%d-%m-%Y_%H-%M-%S)
but got the error:
ERROR: rpc error: code = InvalidArgument desc = Request validation error: Name: invalid resource name
Any help would be appreciated.