Skip to content

Commit 07d63f2

Browse files
Added --local flag for vs create to force use of local disks. Fixed #852
1 parent 87bd33e commit 07d63f2

3 files changed

Lines changed: 63 additions & 216 deletions

File tree

plugin/commands/virtual/create.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type CreateCommand struct {
2828
Dedicated bool
2929
Private bool
3030
San bool
31+
Local bool
3132
Test bool
3233
Transient bool
3334
Force bool
@@ -91,6 +92,7 @@ EXAMPLE:
9192
cobraCmd.Flags().BoolVar(&thisCmd.Dedicated, "dedicated", false, T("Create a dedicated Virtual Server (Private Node)"))
9293
cobraCmd.Flags().BoolVar(&thisCmd.Private, "private", false, T("Forces the virtual server to only have access the private network"))
9394
cobraCmd.Flags().BoolVar(&thisCmd.San, "san", false, T("Use SAN storage instead of local disk"))
95+
cobraCmd.Flags().BoolVar(&thisCmd.Local, "local", false, T("Use local disk storage."))
9496
cobraCmd.Flags().BoolVar(&thisCmd.Test, "test", false, T("Do not actually create the virtual server"))
9597
cobraCmd.Flags().BoolVar(&thisCmd.Transient, "transient", false, T("Create a transient virtual server"))
9698
cobraCmd.Flags().BoolVarP(&thisCmd.Force, "force", "f", false, T("Force operation without confirmation"))
@@ -124,6 +126,7 @@ EXAMPLE:
124126
cobraCmd.Flags().StringVarP(&thisCmd.Template, "template", "t", "", T("A template file that defaults the command-line options"))
125127
cobraCmd.Flags().StringVarP(&thisCmd.Userdata, "userdata", "u", "", T("User defined metadata string"))
126128
cobraCmd.Flags().StringVarP(&thisCmd.Userfile, "userfile", "F", "", T("Read userdata from file"))
129+
cobraCmd.MarkFlagsMutuallyExclusive("san", "local")
127130
return thisCmd
128131
}
129132

@@ -446,6 +449,8 @@ func (cmd *CreateCommand) verifyParams() (map[string]interface{}, error) {
446449

447450
if cmd.San {
448451
params["san"] = true
452+
} else if cmd.Local {
453+
params["san"] = false
449454
}
450455

451456
if cmd.PostInstall != "" {

0 commit comments

Comments
 (0)