261
266
Connect the virtual serial console for the guest.
263
=item B<create> I<FILE>
268
=item B<create> I<FILE> optional I<--console> I<--paused>
265
270
Create a domain from an XML <file>. An easy way to create the XML
266
271
<file> is to use the B<dumpxml> command to obtain the definition of a
272
pre-existing guest. The domain will be paused if the I<--paused> option
273
is used and supported by the driver; otherwise it will be running.
274
If I<--console> is requested, attach to the console after creation.
271
virsh dumpxml <domain-id> > domain.xml
273
virsh create < domain.xml
278
virsh dumpxml <domain-id> > domain.xml
280
virsh create < domain.xml
275
282
=item B<define> I<FILE>
277
Define a domain from an XML <file>. The domain definitions is registered
284
Define a domain from an XML <file>. The domain definition is registered
280
287
=item B<destroy> I<domain-id>
519
529
Attach a device to the domain, using a device definition in an XML file.
520
530
See the documentation to learn about libvirt XML format for a device.
531
For cdrom and floppy devices, this command only replaces the media within
532
the single existing device; consider using B<update-device> for this usage.
522
534
=item B<attach-disk> I<domain-id> I<source> I<target> optional I<--driver driver> I<--subdriver subdriver> I<--type type> I<--mode mode>
524
536
Attach a new disk device to the domain.
525
537
I<source> and I<target> are paths for the files and devices.
526
538
I<driver> can be I<file>, I<tap> or I<phy> depending on the kind of access.
527
I<type> can indicate I<cdrom> or I<floppy> as alternative to the disk default.
539
I<type> can indicate I<cdrom> or I<floppy> as alternative to the disk default,
540
although this use only replaces the media within the existing virtual cdrom or
541
floppy device; consider using B<update-device> for this usage instead.
528
542
I<mode> can specify the two specific mode I<readonly> or I<shareable>.
530
544
=item B<attach-interface> I<domain-id> I<type> I<source> optional I<--target target> I<--mac mac> I<--script script>
749
772
Returns the UUID of the named I<pool>.
776
=head1 VOLUME COMMANDS
778
=item B<vol-create> I<pool-or-uuid> I<FILE>
780
Create a volume from an XML <file>.
781
I<pool-or-uuid> is the name or UUID of the storage pool to create the volume in.
782
I<FILE> is the XML <file> with the volume definition. An easy way to create the
783
XML <file> is to use the B<vol-dumpxml> command to obtain the definition of a
788
virsh vol-dumpxml --pool storagepool1 appvolume1 > newvolume.xml
790
virsh vol-create differentstoragepool newvolume.xml
792
=item B<vol-create-from> I<pool-or-uuid> I<FILE> [optional I<--inputpool>
793
I<pool-or-uuid>] I<vol-name-or-key-or-path>
795
Create a volume, using another volume as input.
796
I<pool-or-uuid> is the name or UUID of the storage pool to create the volume in.
797
I<FILE> is the XML <file> with the volume definition.
798
I<--inputpool> I<pool-or-uuid> is the name or uuid of the storage pool the
800
I<vol-name-or-key-or-path> is the name or key or path of the source volume.
802
=item B<vol-create-as> I<pool-or-uuid> I<name> I<capacity> optional
803
I<--allocation> I<size> I<--format> I<string> I<--backing-vol>
804
I<vol-name-or-key-or-path> I<--backing-vol-format> I<string>
806
Create a volume from a set of arguments.
807
I<pool-or-uuid> is the name or UUID of the storage pool to create the volume
809
I<name> is the name of the new volume.
810
I<capacity> is the size of the volume to be created, with optional k, M, G, or
812
I<--allocation> I<size> is the initial size to be allocated in the volume, with
813
optional k, M, G, or T suffix.
814
I<--format> I<string> is used in file based storage pools to specify the volume
815
file format to use; raw, bochs, qcow, qcow2, vmdk.
816
I<--backing-vol> I<vol-name-or-key-or-path> is the source backing
817
volume to be used if taking a snapshot of an existing volume.
818
I<--backing-vol-format> I<string> is the format of the snapshot backing volume;
819
raw, bochs, qcow, qcow2, vmdk, host_device.
821
=item B<vol-clone> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path> I<name>
823
Clone an existing volume. Less powerful, but easier to type, version of
825
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool to create the volume in.
826
I<vol-name-or-key-or-path> is the name or key or path of the source volume.
827
I<name> is the name of the new volume.
829
=item B<vol-delete> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
831
Delete a given volume.
832
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
833
I<vol-name-or-key-or-path> is the name or key or path of the volume to delete.
835
=item B<vol-wipe> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
837
Wipe a volume, ensure data previously on the volume is not accessible to future reads.
838
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
839
I<vol-name-or-key-or-path> is the name or key or path of the volume to wipe.
841
=item B<vol-dumpxml> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
843
Output the volume information as an XML dump to stdout.
844
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
845
I<vol-name-or-key-or-path> is the name or key or path of the volume to output the XML of.
847
=item B<vol-info> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
849
Returns basic information about the given storage volume.
850
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
851
I<vol-name-or-key-or-path> is the name or key or path of the volume to return information for.
853
=item B<vol-list> I<--pool> I<pool-or-uuid>
855
Return the list of volumes in the given storage pool.
856
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool.
858
=item B<vol-pool> [optional I<--uuid>] I<vol-key-or-path>
860
Return the pool name or UUID for a given volume. By default, the pool name is
861
returned. If the I<--uuid> option is given, the pool UUID is returned instead.
862
I<vol-key-or-path> is the key or path of the volume to return the pool
865
=item B<vol-path> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key>
867
Return the path for a given volume.
868
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
869
I<vol-name-or-key> is the name or key of the volume to return the path for.
871
=item B<vol-name> I<vol-key-or-path>
873
Return the name for a given volume.
874
I<vol-key-or-path> is the key or path of the volume to return the name for.
876
=item B<vol-key> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-path>
878
Return the volume key for a given volume.
879
I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
880
I<vol-name-or-path> is the name or path of the volume to return the volume key for.
751
884
=head1 SECRET COMMMANDS
753
886
The following commands manipulate "secrets" (e.g. passwords, passphrases and