diff --git a/cmd/instance/instance.go b/cmd/instance/instance.go index 7c26d31a..68902c5e 100644 --- a/cmd/instance/instance.go +++ b/cmd/instance/instance.go @@ -54,6 +54,7 @@ func init() { instanceCreateCmd.Flags().StringVarP(&firewall, "firewall", "l", "", "the instance's firewall you can use the Name or the ID") instanceCreateCmd.Flags().StringVarP(&tags, "tags", "g", "", "the instance's tags") instanceCreateCmd.Flags().StringVarP(&privateIPv4, "private_ipv4", "", "", "Private IPv4 address") + instanceCreateCmd.Flags().StringVarP(&reservedIPv4, "reservedip", "", "", "Reserved IPv4 address") instanceCreateCmd.Flags().StringVarP(&tags, "region", "e", "", "the region code identifier to have your instance built in") instanceCreateCmd.Flags().StringVar(&script, "script", "", "path to a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization") instanceCreateCmd.Flags().BoolVar(&skipShebangCheck, "skip-shebang-check", false, "skip the shebang line check when passing a user init script") diff --git a/cmd/instance/instance_create.go b/cmd/instance/instance_create.go index 632961d0..fce5cb48 100644 --- a/cmd/instance/instance_create.go +++ b/cmd/instance/instance_create.go @@ -18,7 +18,7 @@ import ( ) var wait bool -var hostnameCreate, size, diskimage, publicip, initialuser, sshkey, tags, network, privateIPv4, firewall string +var hostnameCreate, size, diskimage, publicip, initialuser, sshkey, tags, network, privateIPv4, reservedIPv4, firewall string var script string var skipShebangCheck bool @@ -139,10 +139,16 @@ If you wish to use a custom format, the available fields are: } } + // Set public ipv4 if provided if publicip != "" { config.PublicIPRequired = publicip } + // Set reserved ip if provided + if reservedIPv4 != "" { + config.ReservedIPv4 = reservedIPv4 + } + // Set private_ipv4 if provided if privateIPv4 != "" { config.PrivateIPv4 = privateIPv4