Revision c0e4a2c3

b/man/gnt-backup.sgml
151 151
      </para>
152 152

  
153 153
      <para>
154
        The minimum disk specification is therefore <userinput>--disk
155
        0:size=20G</userinput>, and a three-disk instance can be
156
        specified as <userinput>--disk 0:size=20G --disk 1:size=4G
157
        --disk 2:size=100G</userinput>.
154
        Alternatively, a single-disk instance can be created via the
155
        <option>-s</option> option which takes a single argument,
156
        the size of the disk. This is similar to the Ganeti 1.2
157
        version (but will only create one disk).
158
      </para>
159

  
160
      <para>
161
        The minimum disk specification is therefore
162
        <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
163
          20G</userinput> when using the <option>-s</option> option),
164
        and a three-disk instance can be specified as
165
        <userinput>--disk 0:size=20G --disk 1:size=4G --disk
166
          2:size=100G</userinput>.
158 167
      </para>
159 168

  
160 169
      <para>
b/man/gnt-instance.sgml
65 65
        <cmdsynopsis>
66 66
          <command>add</command>
67 67
          <sbr>
68
          <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
68
          <arg choice="req">-t<group choice="req">
69
              <arg>diskless</arg>
70
              <arg>file</arg>
71
              <arg>plain</arg>
72
              <arg>drbd</arg>
73
            </group></arg>
74
          <sbr>
75

  
76
          <group choice="req">
77
            <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
78
            <arg>-s <replaceable>SIZE</replaceable></arg>
79
          </group>
69 80
          <sbr>
70 81
          <group>
71 82
            <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
......
85 96
            </group></arg>
86 97
          <sbr>
87 98

  
88
          <arg choice="req">-t<group choice="req">
89
              <arg>diskless</arg>
90
              <arg>file</arg>
91
              <arg>plain</arg>
92
              <arg>drbd</arg>
93
            </group></arg>
94
          <sbr>
95

  
96 99
          <group choice="req">
97 100
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
98 101
            <arg>--iallocator <replaceable>name</replaceable></arg>
......
128 131
        </para>
129 132

  
130 133
        <para>
134
          Alternatively, a single-disk instance can be created via the
135
          <option>-s</option> option which takes a single argument,
136
          the size of the disk. This is similar to the Ganeti 1.2
137
          version (but will only create one disk).
138
        </para>
139

  
140
        <para>
131 141
          The minimum disk specification is therefore
132
          <userinput>--disk 0:size=20G</userinput>, and a three-disk
133
          instance can be specified as <userinput>--disk 0:size=20G
134
            --disk 1:size=4G --disk 2:size=100G</userinput>.
142
          <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
143
          20G</userinput> when using the <option>-s</option> option),
144
          and a three-disk instance can be specified as
145
          <userinput>--disk 0:size=20G --disk 1:size=4G --disk
146
          2:size=100G</userinput>.
135 147
        </para>
136 148

  
137 149
        <para>
b/scripts/gnt-backup
113 113
    nics = [{}]
114 114

  
115 115
  if opts.disk_template == constants.DT_DISKLESS:
116
    if opts.disks:
116
    if opts.disks or opts.sd_size is not None:
117 117
      raise errors.OpPrereqError("Diskless instance but disk"
118 118
                                 " information passed")
119 119
    disks = []
120 120
  else:
121
    if not opts.disks:
121
    if not opts.disks and not opts.sd_size:
122 122
      raise errors.OpPrereqError("No disk information specified")
123
    if opts.disks and opts.sd_size is not None:
124
      raise errors.OpPrereqError("Please use either the '--disk' or"
125
                                 " '-s' option")
126
    if opts.sd_size is not None:
127
      opts.disks = [(0, {"size": opts.sd_size})]
123 128
    try:
124 129
      disk_max = max(int(didx[0])+1 for didx in opts.disks)
125 130
    except ValueError, err:
......
137 142
      disks[didx] = ddict
138 143

  
139 144
  utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_TYPES)
140
  utils.ForceDictType(opts.hvparams, constants.HVS_PARAMETER_TYPES)
145
  utils.ForceDictType(hvparams, constants.HVS_PARAMETER_TYPES)
141 146

  
142 147
  op = opcodes.OpCreateInstance(instance_name=instance,
143 148
                                disk_template=opts.disk_template,
......
194 199
             default=[], dest="disks",
195 200
             action="append",
196 201
             type="identkeyval"),
202
  cli_option("-s", "--os-size", dest="sd_size", help="Disk size for a"
203
             " single-disk configuration, when not using the --disk option,"
204
             " in MiB unless a suffix is used",
205
             default=None, type="unit", metavar="<size>"),
197 206
  ikv_option("--net", help="NIC information",
198 207
             default=[], dest="nics",
199 208
             action="append",
b/scripts/gnt-instance
332 332
    nics = [{}]
333 333

  
334 334
  if opts.disk_template == constants.DT_DISKLESS:
335
    if opts.disks:
335
    if opts.disks or opts.sd_size is not None:
336 336
      raise errors.OpPrereqError("Diskless instance but disk"
337 337
                                 " information passed")
338 338
    disks = []
339 339
  else:
340
    if not opts.disks:
340
    if not opts.disks and not opts.sd_size:
341 341
      raise errors.OpPrereqError("No disk information specified")
342
    if opts.disks and opts.sd_size is not None:
343
      raise errors.OpPrereqError("Please use either the '--disk' or"
344
                                 " '-s' option")
345
    if opts.sd_size is not None:
346
      opts.disks = [(0, {"size": opts.sd_size})]
342 347
    try:
343 348
      disk_max = max(int(didx[0])+1 for didx in opts.disks)
344 349
    except ValueError, err:
......
1276 1281
  make_option("-t", "--disk-template", dest="disk_template",
1277 1282
              help="Custom disk setup (diskless, file, plain or drbd)",
1278 1283
              default=None, metavar="TEMPL"),
1284
  cli_option("-s", "--os-size", dest="sd_size", help="Disk size for a"
1285
             " single-disk configuration, when not using the --disk option,"
1286
             " in MiB unless a suffix is used",
1287
             default=None, type="unit", metavar="<size>"),
1279 1288
  ikv_option("--disk", help="Disk information",
1280 1289
             default=[], dest="disks",
1281 1290
             action="append",

Also available in: Unified diff