@@ -72,6 +72,7 @@ sets the size as the number of gigabytes the volume will consume.`
72
72
Default : 1 ,
73
73
Description : "Number of volumes to create" ,
74
74
},
75
+ flag .VMSizeFlags ,
75
76
)
76
77
77
78
flag .Add (cmd , flag .JSONOutput ())
@@ -125,14 +126,20 @@ func runCreate(ctx context.Context) error {
125
126
snapshotID = api .StringPointer (flag .GetString (ctx , "snapshot-id" ))
126
127
}
127
128
129
+ computeRequirements , err := flag .GetMachineGuest (ctx , nil )
130
+ if err != nil {
131
+ return err
132
+ }
133
+
128
134
input := api.CreateVolumeRequest {
129
- Name : volumeName ,
130
- Region : region .Code ,
131
- SizeGb : api .Pointer (flag .GetInt (ctx , "size" )),
132
- Encrypted : api .Pointer (! flag .GetBool (ctx , "no-encryption" )),
133
- RequireUniqueZone : api .Pointer (flag .GetBool (ctx , "require-unique-zone" )),
134
- SnapshotID : snapshotID ,
135
- HostDedicationId : flag .GetString (ctx , "host-dedication-id" ),
135
+ Name : volumeName ,
136
+ Region : region .Code ,
137
+ SizeGb : api .Pointer (flag .GetInt (ctx , "size" )),
138
+ Encrypted : api .Pointer (! flag .GetBool (ctx , "no-encryption" )),
139
+ RequireUniqueZone : api .Pointer (flag .GetBool (ctx , "require-unique-zone" )),
140
+ SnapshotID : snapshotID ,
141
+ HostDedicationId : flag .GetString (ctx , "host-dedication-id" ),
142
+ ComputeRequirements : computeRequirements ,
136
143
}
137
144
out := iostreams .FromContext (ctx ).Out
138
145
for i := 0 ; i < count ; i ++ {
@@ -154,7 +161,7 @@ func runCreate(ctx context.Context) error {
154
161
}
155
162
156
163
func confirmVolumeCreate (ctx context.Context , appName string ) (bool , error ) {
157
- var volumeName = flag .FirstArg (ctx )
164
+ volumeName : = flag .FirstArg (ctx )
158
165
159
166
// If the Yes flag has been supplied we skip the warning entirely, so no
160
167
// need to query for the set of volumes
0 commit comments