1vdiskadm(1M)            System Administration Commands            vdiskadm(1M)
2
3
4

NAME

6       vdiskadm - create and manage virtual disks
7

SYNOPSIS

9       vdiskadm create -s size [-t type[:opt],[opt]
10            [-c comment] vdname
11
12
13       vdiskadm destroy [-r] vdname|snapshot
14
15
16       vdiskadm snapshot vdname@snapname
17
18
19       vdiskadm rollback [-r] snapshot
20
21
22       vdiskadm clone [-c comment] vdname|snapshot clone_vdname
23
24
25       vdiskadm move vdname dir
26
27
28       vdiskadm rename vdname|snapshot vdname|snapshot
29
30
31       vdiskadm list [-fp]vdname
32
33
34       vdiskadm verify vdname
35
36
37       vdiskadm prop-get [-l] -p property vdname
38
39
40       vdiskadm prop-set  -p property=value vdname
41
42
43       vdiskadm prop-add  -p property=value vdname
44
45
46       vdiskadm prop-del  -p property vdname
47
48
49       vdiskadm import [-fnpqm] [-x type] -d file|zvol|dsk
50            [-t type[:opt]] vdname
51
52
53       vdiskadm export -x type[:opt] -d file|zvol|dsk vdname
54
55
56       vdiskadm convert [-t type[:opt]] vdname
57
58
59       vdiskadm translate [-i type[:opt]] -I input_file -x type[:opt]
60            -d output_file
61
62
63       vdiskadm help [command]
64
65

DESCRIPTION

67       The vdiskadm command manages virtual disks within dom0. In the SYNOPSIS
68       above, vdname is the pathname of the virtual disk;  it  has  a  maximum
69       length of MAXPATHLEN (1024 bytes).
70
71
72       vdiskadm  is  implemented  as a set of subcommands, many with their own
73       options and operands. These subcommands are  described  under  "Subcom‐
74       mands," below.
75
76
77       The following subsections describe concepts related to virtual disks.
78
79   Snapshots
80       A snapshot is a read-only copy of a virtual disk. Snapshots can be cre‐
81       ated extremely quickly and initially  consume  little  space.  As  data
82       within the active virtual disk changes, the snapshot consumes more data
83       than would otherwise be shared with the active virtual disk.
84
85   Clones
86       A clone is a writable copy of a virtual disk. The default type of clone
87       is  a merged (that is, coalesced) copy of the original virtual disk. An
88       example of a merged clone occurs when a virtual disk  is  comprised  of
89       several  snapshots;  a subsequent clone operation results in a new vir‐
90       tual disk containing no snapshots. A clone will be of the same type  as
91       the original virtual disk (that is, vmdk:fixed). When a merged clone is
92       created there is no linkage back to the original virtual disk or to any
93       of  its  snapshots.  This lack of linkage allows the merged clone to be
94       moved to another physical machine.
95
96   Numeric Values
97       The values of numeric properties can be specified using  human-readable
98       suffixes,  such  as k, KB, M, Gb, and so forth, up to Z for zettabyte).
99       The  following are all valid (and equal) specifications:
100
101         1536M  1.5g  1.50GB
102
103
104
105   Types of Virtual Disks
106       The following types and options of virtual disks are supported:
107
108           o      vmdk:fixed
109
110           o      vmdk:sparse
111
112           o      vdi:fixed
113
114           o      vdi:sparse
115
116           o      vhd:fixed
117
118           o      vhd:sparse
119
120           o      raw:fixed
121
122
123       where vmdk is the native VMware format, vdi is  the  native  VirtualBox
124       format,  vhd  is  the native Microsoft format, and raw describes a file
125       that looks like a raw disk. A raw disk is always  in  fixed  format  so
126       that option can be explicitly set or implicitly understood.
127
128
129       If  the type is not specified, the default value is vmdk. If the option
130       is not specified, the default value is fixed for type  raw  and  sparse
131       for types vmdk, vdi, and vhd.
132
133   Native and User-defined Properties
134       Properties  are divided into two types, native and user defined. Native
135       properties either export internal statistics or control vdiskadm behav‐
136       ior.  In  addition, native properties are either editable or read-only.
137       User-defined properties are arbitrary strings that have  no  effect  on
138       vdiskadm  behavior. You can use them to annotate virtual disks in a way
139       that is meaningful in your  environment.  User-defined  property  names
140       must  contain  a  colon  (:) character, to distinguish them from native
141       properties.
142
143
144       Properties are associated only with the virtual disk and not with indi‐
145       vidual snapshots.
146
147
148       Every  virtual  disk has a set of native properties that export statis‐
149       tics about the virtual disk, as well as control various behaviors.
150
151
152       The following are the native properties for a virtual disk:
153
154       cdrom
155
156           Boolean property that is true if the virtual disk is a CDROM.
157
158
159       removable
160
161           Boolean property that is true if the virtual disk  is  a  removable
162           media.
163
164
165       readonly
166
167           Boolean  property  that  is  true if the virtual disk is read-only.
168           This property is read-only.
169
170
171       sectors
172
173           Numeric property containing the number of disk sectors in the given
174           virtual disk. This property is read-only.
175
176
177       name
178
179           String property that is the name of the virtual disk. This property
180           is read-only.
181
182
183       max-size
184
185           Numeric property containing the maximum size of the virtual disk in
186           bytes. This property is read-only.
187
188
189       effective-size
190
191           Numeric property containing the effective size of the virtual disk,
192           in bytes. The effective size includes  the size of  the  data  file
193           and  all snapshots. The effective size can exceed the maximum size.
194           This property is read-only.
195
196
197       creation-time
198
199           String property containing the date and time that the virtual  disk
200           was created. This property is read-only.
201
202
203       creation-time-epoch
204
205           Numeric  property  describing the creation-time property in seconds
206           since the epoch (seconds since 00:00:00 UTC, Jan.  1,  1970).  This
207           property is read-only.
208
209
210       modification-time
211
212           String  property  containing the date and time of last modification
213           to virtual disk. This property is read-only.
214
215
216       modification-time-epoch
217
218           Numeric property describing the modification-time property in  sec‐
219           onds  since  the  epoch (seconds since 00:00:00 UTC, Jan. 1, 1970).
220           This property is read-only.
221
222
223       description
224
225           String property that contains the comment given  when  the  virtual
226           disk was created or cloned. This property is read-only.
227
228
229       type
230
231           String  property that contains the type of virtual disk: vmdk, vhd,
232           vdi, or raw. This property is read-only.
233
234
235       sparse
236
237           Boolean property that is true if the virtual disk is in sparse for‐
238           mat. This property is read-only.
239
240
241       owner
242
243           String  property  that  contains  the user name of the owner of the
244           virtual disk. This property is editable.
245
246

SUB-COMMANDS

248       The vdiskadm subcommands and their arguments are described in the  fol‐
249       lowing subsections.
250
251   vdiskadm create
252         vdiskadm create -s size [-t type[:opt],[opt]]
253              [-c comment] vdname
254
255
256
257
258       Creates  a  new  virtual disk of the specified size and at the location
259       specified by vdname. If vdname includes a path to the virtual disk, the
260       directories  that follow from that path will be created during creation
261       of the virtual disk. This subcommand has the options listed below.
262
263       -t type[:opt],[opt]]
264
265           Specifies the type of virtual disk to be created. The default  type
266           is  vmdk.  For vmdk and vdi types the default option is sparse. For
267           type raw the default option is fixed.
268
269
270       -c comment
271
272           Comment that can be attached to virtual disk.
273
274
275   vdiskadm destroy
276         vdiskadm destroy [-r] vdname|snapshot
277
278
279
280
281       Destroys the specified  virtual  disk  or  snapshot.  By  default,  the
282       destroy  operation  fails  if the specified virtual disk contains snap‐
283       shots. This subcommand has the option listed below.
284
285       -r
286
287           Recursively destroys the  virtual  disk,  including  all  snapshots
288           associated with the virtual disk.
289
290
291   vdiskadm snapshot
292         vdiskadm snapshot vdname@snapname
293
294
295
296
297       Creates  a  snapshot  of  the virtual disk with the specified snapname.
298       This subcommand has no options.
299
300   vdiskadm rollback
301         vdiskadm rollback [-r] snapshot
302
303
304
305
306       Roll back the virtual disk to a previous snapshot. When a virtual  disk
307       is  rolled  back,  all data that has changed since the snapshot is dis‐
308       carded, and the virtual disk reverts to the state at the  time  of  the
309       snapshot.  By  default,  the command refuses to roll back to a snapshot
310       other than the most recent one. In order  to  roll  back  further,  all
311       intermediate  snapshots  must be destroyed by specifying the -r option.
312       This subcommand has the option listed below.
313
314       -r
315
316           Recursively destroy any snapshots more recent than the  one  speci‐
317           fied.
318
319
320   vdiskadm clone
321         vdiskadm [-c comment] vdname|snapshot clone_vdname
322
323
324
325
326       Creates a clone of the specified snapshot or virtual disk. The clone is
327       created with the type and option and the size of the virtual disk being
328       cloned.  If clone_vdname includes a path the directories that flow from
329       that path will be created during creation of the cloned  virtual  disk.
330       By  default,  a  merged clone image is created. This subcommand has the
331       option listed below.
332
333       -c comment
334
335           Comment that can be attached to cloned virtual disk.
336
337
338   vdiskadm move
339         vdiskadm move vdname dir
340
341
342
343
344       Moves a specified virtual disk into the specified directory.  The  vir‐
345       tual  disk  maintains the same name. The new directory must exist. This
346       subcommand has no options.
347
348   vdiskadm rename
349         vdiskadm rename vdname|snapshot vdname|snapshot
350
351
352
353
354       Renames a virtual disk or snapshot. This subcommand has no options.
355
356   vdiskadm list
357         vdiskadm list [-fp]vdname
358
359
360
361
362       Lists a specified virtual disk and its snapshots. This  subcommand  has
363       the options listed below.
364
365       -f
366
367           Gives  a  list  of all files associated with the virtual disk. This
368           list includes the store file and the extents.
369
370
371       -p
372
373           Lists the files in an easily parsable format, prefixing  the  files
374           with a label of file:, snapshot:, or store.
375
376
377   vdiskadm verify
378         vdiskadm verify vdname
379
380
381
382
383       Returns  an error if the virtual disk cannot be recognized or opened by
384       Solaris xVM. This subcommand has no options.
385
386   vdiskadm prop-get
387         vdiskadm prop-get [-l] -p property vdname
388
389
390
391
392       Returns the value of the property for the  specified  virtual  disk.  A
393       property  value  of all displays all native and user-defined properties
394       for the virtual disk. This subcommand has the options listed below.
395
396       -l
397
398           Gives additional property information, such as the writeable status
399           of property.
400
401
402       -p property
403
404           Specifies  the property being queried and displays the value of the
405           property. For the property all, the name of the property, a  colon,
406           and a space are displayed before the value of the property.
407
408
409   vdiskadm prop-set
410         vdiskadm prop-set -p property=value vdname
411
412
413
414
415       Sets  the  value  of  the  specified property for the specified virtual
416       disk. property can be a native or a user-defined property, but must  be
417       writable.  Can be used to change the value of a property added with the
418       prop-add subcommand. This subcommand has the option listed below.
419
420       -p property=value
421
422           Specifies the property being set.
423
424
425   vdiskadm prop-add
426         vdiskadm -p property=value vdname
427
428
429
430
431       Adds the user-defined property with the specified value to  the  speci‐
432       fied virtual disk. Returns an error if the property already exists. The
433       user-defined property name must contain a  colon  character  (:).  This
434       subcommand has the option listed below.
435
436       -p property=value
437
438           Specifies the property being added.
439
440
441   vdiskadm prop-del
442         vdiskadm prop-del -p property vdname
443
444
445
446
447       Deletes  a  user-defined property from the specified virtual disk. This
448       subcommand has the option listed below.
449
450       -p property
451
452           Specifies the property being deleted.
453
454
455   vdiskadm import
456         vdiskadm import [-fnpqm] [-x type] -d file|zvol|dsk \
457         [-t type[:opt]] vdname
458
459
460
461
462       Creates a new virtual disk using data from a file or block device.  The
463       file  may be in vdi, vhd, vmdk, or raw format. A block device is always
464       assumed to be in raw format. This subcommand has the following options.
465
466       -f
467
468           Returns a list of files that will be used in the import process.
469
470
471       -n
472
473           Show output from import without actually running the import.
474
475
476       -p
477
478           Displays files in an easily parsable format.
479
480
481       -q
482
483           Run in quiet mode giving no output.
484
485
486       -m
487
488           Move the imported file to virtual disk without copying the data.
489
490
491       -x type
492
493           Specifies the type of virtual disk data being imported. If vdiskadm
494           is unable to detect the imported file type, -x must be specified.
495
496
497       -d file|zvol|dsk
498
499           File or block device containing data to be imported.
500
501
502       -t type[:opt]
503
504           Specifies  the  type  of  virtual disk to be created on import. The
505           default type is vmdk. For vmdk, vdi, and vhd types the default  opt
506           is sparse. For type raw the default opt is fixed.
507
508
509   vdiskadm export
510         vdiskadm export -x type[:opt] -d file|zvol|dsk vdname
511
512
513
514
515       Exports  data  from a virtual disk to a file or block device. This sub‐
516       command has the following options.
517
518       -x type[:opt]
519
520           Specifies the type of virtual disk data being exported.
521
522
523       -d file|zvol|dsk
524
525           File or block device receiving data being exported.
526
527
528   vdiskadm convert
529         vdiskadm convert [-t type[:opt]] vdname
530
531
532
533
534       Converts a virtual disk into a different type virtual disk.  This  sub‐
535       command has the following option.
536
537       -t type[:opt]
538
539           Specifies  the  type of virtual disk to be created upon conversion.
540           The default type is vmdk. For vmdk, vdi, and vhd types the  default
541           opt is sparse. For type raw the default opt is fixed.
542
543
544   vdiskadm translate
545         vdiskadm translate [-i type[:opt]] -I input_file \
546         -x type[:opt] -d output_file
547
548
549
550
551       Translate  data from one virtual disk data type to another without cre‐
552       ating a virtual disk. This subcommand has the following options.
553
554       -i type[:opt]
555
556           Specifies the input type of virtual disk data being translated.  If
557           vdiskadm is unable to detect the input file type, -i must be speci‐
558           fied.
559
560
561       -I input_file
562
563           File or block device containing data being translated.
564
565
566       -x type[:opt]
567
568           Specifies the output type of virtual disk  data  being  translated.
569           For  vmdk,  vdi,  and vhd types the default opt is sparse. For type
570           raw the default opt is fixed.
571
572
573       -d output_file
574
575           File or block device receiving data being  translated.  output_file
576           must not exist. The file will be created during translation.
577
578
579   vdiskadm help
580         vdiskadm help [command]
581
582
583
584
585       Displays  a  general  or command-specific help message. This subcommand
586       has only the command name optional argument.
587

EXAMPLES

589       Example 1 Creating a vmdk Sparse File
590
591
592       The following command creates a virtual disk named disk1 of size  8  GB
593       in the directory /guests/disks.
594
595
596         # vdiskadm create -s 8g -t vmdk:sparse /guests/disks/disk1
597
598
599
600       Example 2 Creating a Snapshot
601
602
603       The following command creates a snapshot of the virtual disk located at
604       /guests/disks/disk1. The snapshot is named install.
605
606
607         # vdiskadm snapshot /guests/disks/disk1@install
608
609
610
611       Example 3 Creating and Destroying Snapshots
612
613
614       The following commands create two snapshots, named install and bfu,  of
615       the  virtual  disk  located  at  /guests/disks/disk1. The third command
616       destroys the newly created snapshot install.
617
618
619         # vdiskadm snapshot /guests/disks/disk1@install
620         # vdiskadm snapshot /guests/disks/disk1@bfu
621         # vdiskadm destroy /guests/disks/disk1@install
622
623
624
625       Example 4 Rolling Back a Virtual Disk
626
627
628       The following command reverts the contents of the virtual disk  to  the
629       snapshot named install, deleting all intermediate snapshots.
630
631
632         # vdiskadm rollback -r /guests/disks/disk1@install
633
634
635
636       Example 5 Listing a Virtual Disk and Snapshots
637
638
639       The  following command lists all of the images associated with the vir‐
640       tual disk /guests/disks/disk1.
641
642
643         # vdiskadm list /guests/disks/disk1
644         disk1@install
645         disk1@bfu
646         disk1
647
648
649
650       Example 6 Creating a Clone
651
652
653       The following command creates a new virtual disk that  is  a  coalesced
654       copy  of  the virtual disk /guests/disks/disk1. The clone is created in
655       the same format (that is, vmdk:sparse) as the original virtual disk.
656
657
658         # vdiskadm clone /guests/disks/disk1 /guests/clone/clone_disk1
659
660
661
662       Example 7 Adding a User-defined Property
663
664
665       The following command adds a user-defined property to the virtual  disk
666       and  assigns  it  the specified value. This property name was chosen to
667       represent the source and requirements of this virtual disk  data  using
668       the required colon to delineate the fields.
669
670
671         # vdiskadm prop-add -p com.sun:required-nic=2 /guests/disks/disk1
672
673
674
675       Example 8 Importing Existing vmdk Format File
676
677
678       The following command takes an existing vmdk format file and imports it
679       to a virtual disk.
680
681
682         # vdiskadm import -d /downloads/appliance.vmdk /guests/import/disk1
683
684
685
686       Example 9 Importing vmdk File and Converting to vhd
687
688
689       The following command takes an existing  vmdk  format  file  and,  upon
690       import, converts it to a vhd-type virtual disk.
691
692
693         # vdiskadm import -d /downloads/appliance.vmdk -t vhd \
694         /guests/import/disk1
695
696
697
698       Example 10 Importing Data from zvol
699
700
701       The  following  command imports virtual disk data from a zvol and, upon
702       import, converts it to a vmdk:fixed type virtual disk.
703
704
705         # vdiskadm import -d /dev/zvol/dsk/pool1/disk1 -t vmdk:fixed \
706         /guests/import/disk1
707
708
709
710       Example 11 Exporting Data to Block Device
711
712
713       The following command takes an existing virtual disk and, upon  export,
714       converts it to a disk slice, of raw type.
715
716
717         # vdiskadm export -d /dev/dsk/c0t1d0s3 -x raw /guests/disks/disk1
718
719
720
721       Example 12 Converting Virtual Disk Type
722
723
724       The  following  command  takes an existing virtual disk and converts it
725       (in place) to a different format type.
726
727
728         # vdiskadm convert -t vdi:fixed /guests/disks/disk1
729
730
731
732       Example 13 Translating Data from One Type to Another
733
734
735       The following command translates data from a virtual disk  format  file
736       to raw data written to a zvol without creating a virtual disk.
737
738
739         # vdiskadm translate -I /downloads/appliance.vmdk -x raw \
740         -d /dev/zvol/dsk/pool1/disk1
741
742
743

ATTRIBUTES

745       See attributes(5) for descriptions of the following attributes:
746
747
748
749
750       ┌─────────────────────────────┬─────────────────────────────┐
751       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
752       ├─────────────────────────────┼─────────────────────────────┤
753       │Availability                 │SUNWvdisk                    │
754       ├─────────────────────────────┼─────────────────────────────┤
755       │Interface Stability          │Uncommitted                  │
756       └─────────────────────────────┴─────────────────────────────┘
757

SEE ALSO

759       virsh(1M), virt-install(1M), attributes(5), xVM(5)
760
761
762
763SunOS 5.11                        2 Apr 2009                      vdiskadm(1M)
Impressum