File: virt-sysprep.1

package info (click to toggle)
libguestfs 1%3A1.18.1-1%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,156 kB
  • sloc: ansic: 282,408; ml: 22,707; sh: 16,121; perl: 5,946; java: 5,047; cs: 4,329; makefile: 3,191; haskell: 2,564; erlang: 1,510; python: 1,502; xml: 509; ruby: 217; pascal: 142; cpp: 11
file content (719 lines) | stat: -rw-r--r-- 30,041 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.el \{\
.    de IX
..
.\}
.\" ========================================================================
.\"
.IX Title "virt-sysprep 1"
.TH virt-sysprep 1 "2012-06-01" "libguestfs-1.18.1" "Virtualization Support"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "НАЗВА"
.IX Header "НАЗВА"
virt-sysprep \- Reset or unconfigure a virtual machine so clones can be made
.SH "КОРОТКИЙ ОПИС"
.IX Header "КОРОТКИЙ ОПИС"
.Vb 1
\& virt\-sysprep [\-\-параметри] \-d назва_домену
\&
\& virt\-sysprep [\-\-options] \-a disk.img [\-a disk.img ...]
.Ve
.SH "ОПИС"
.IX Header "ОПИС"
Virt-sysprep \*(L"resets\*(R" or \*(L"unconfigures\*(R" a virtual machine so that clones can
be made from it.  Steps in this process include removing \s-1SSH\s0 host keys,
removing persistent network \s-1MAC\s0 configuration, and removing user accounts.
Each step can be enabled or disabled as required.
.PP
Virt-sysprep modifies the guest or disk image \fIin place\fR.  The guest must
be shut down.  If you want to preserve the existing contents of the guest,
you \fImust copy or clone the disk first\fR.  See \*(L"\s-1COPYING\s0 \s-1AND\s0 \s-1CLONING\s0\*(R"
below.
.PP
You do \fInot\fR need to run virt-sysprep as root.  In fact we'd generally
recommend that you don't.  The time you might want to run it as root is when
you need root in order to access the disk image, but even in this case it
would be better to change the permissions on the disk image to be writable
as the non-root user running virt-sysprep.
.PP
\&\*(L"Sysprep\*(R" stands for \*(L"system preparation\*(R" tool.  The name comes from the
Microsoft program \f(CW\*(C`sysprep.exe\*(C'\fR which is used to unconfigure Windows
machines in preparation for cloning them.  Having said that, virt-sysprep
does \fInot\fR currently work on Microsoft Windows guests.  We plan to support
Windows sysprepping in a future version, and we already have code to do it.
.SH "ПАРАМЕТРИ"
.IX Header "ПАРАМЕТРИ"
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
Показати коротку довідку.
.IP "\fB\-a\fR файл" 4
.IX Item "-a файл"
.PD 0
.IP "\fB\-\-add\fR файл" 4
.IX Item "--add файл"
.PD
Додати \fIфайл\fR, який має бути образом диска з віртуальної машини.
.Sp
The format of the disk image is auto-detected.  To override this and force a
particular format use the \fI\-\-format\fR option.
.IP "\fB\-c\fR адреса" 4
.IX Item "-c адреса"
.PD 0
.IP "\fB\-\-connect\fR адреса" 4
.IX Item "--connect адреса"
.PD
If using libvirt, connect to the given \fI\s-1URI\s0\fR.  If omitted, then we connect
to the default libvirt hypervisor.
.Sp
If you specify guest block devices directly (\fI\-a\fR), then libvirt is not
used at all.
.IP "\fB\-d\fR гість" 4
.IX Item "-d гість"
.PD 0
.IP "\fB\-\-domain\fR гість" 4
.IX Item "--domain гість"
.PD
Add all the disks from the named libvirt guest.  Domain UUIDs can be used
instead of names.
.IP "\fB\-n\fR" 4
.IX Item "-n"
.PD 0
.IP "\fB\-\-dry\-run\fR" 4
.IX Item "--dry-run"
.PD
Perform a read-only \*(L"dry run\*(R" on the guest.  This runs the sysprep
operation, but throws away any changes to the disk at the end.
.IP "\fB\-\-enable\fR operations" 4
.IX Item "--enable operations"
Choose which sysprep operations to perform.  Give a comma-separated list of
operations, for example:
.Sp
.Vb 1
\& \-\-enable ssh\-hostkeys,udev\-persistent\-net
.Ve
.Sp
would enable \s-1ONLY\s0 \f(CW\*(C`ssh\-hostkeys\*(C'\fR and \f(CW\*(C`udev\-persistent\-net\*(C'\fR operations.
.Sp
If the \fI\-\-enable\fR option is not given, then we default to trying most
sysprep operations (see \fI\-\-list\-operations\fR to show which are enabled).
.Sp
Regardless of the \fI\-\-enable\fR option, sysprep operations are skipped for
some guest types.
.Sp
Use \fI\-\-list\-operations\fR to list operations supported by a particular
version of virt-sysprep.
.Sp
See \*(L"\s-1OPERATIONS\s0\*(R" below for a list and an explanation of each operation.
.IP "\fB\-\-format\fR raw|qcow2|.." 4
.IX Item "--format raw|qcow2|.."
.PD 0
.IP "\fB\-\-format\fR auto" 4
.IX Item "--format auto"
.PD
The default for the \fI\-a\fR option is to auto-detect the format of the disk
image.  Using this forces the disk format for \fI\-a\fR options which follow on
the command line.  Using \fI\-\-format auto\fR switches back to auto-detection
for subsequent \fI\-a\fR options.
.Sp
Приклад:
.Sp
.Vb 1
\& virt\-sysprep \-\-format raw \-a disk.img
.Ve
.Sp
forces raw format (no auto-detection) for \f(CW\*(C`disk.img\*(C'\fR.
.Sp
.Vb 1
\& virt\-sysprep \-\-format raw \-a disk.img \-\-format auto \-a another.img
.Ve
.Sp
forces raw format (no auto-detection) for \f(CW\*(C`disk.img\*(C'\fR and reverts to
auto-detection for \f(CW\*(C`another.img\*(C'\fR.
.Sp
If you have untrusted raw-format guest disk images, you should use this
option to specify the disk format.  This avoids a possible security problem
with malicious guests (\s-1CVE\-2010\-3851\s0).
.IP "\fB\-\-list\-operations\fR" 4
.IX Item "--list-operations"
List the operations supported by the virt-sysprep program.
.Sp
These are listed one per line, with one or more single-space-separated
fields, eg:
.Sp
.Vb 6
\& $ virt\-sysprep \-\-list\-operations
\& bash\-history * Remove the bash history in the guest
\& cron\-spool * Remove user at\-jobs and cron\-jobs
\& dhcp\-client\-state * Remove DHCP client leases
\& dhcp\-server\-state * Remove DHCP server leases
\& [etc]
.Ve
.Sp
The first field is the operation name, which can be supplied to
\&\fI\-\-enable\fR.  The second field is a \f(CW\*(C`*\*(C'\fR character if the operation is
enabled by default or blank if not.  Subsequent fields on the same line are
the description of the operation.
.Sp
Before libguestfs 1.17.33 only the first (operation name) field was shown
and all operations were enabled by default.
.IP "\fB\-q\fR" 4
.IX Item "-q"
.PD 0
.IP "\fB\-\-quiet\fR" 4
.IX Item "--quiet"
.PD
Не виводити повідомлень до журналу.
.Sp
To enable detailed logging of individual file operations, use \fI\-x\fR.
.IP "\fB\-\-selinux\-relabel\fR" 4
.IX Item "--selinux-relabel"
.PD 0
.IP "\fB\-\-no\-selinux\-relabel\fR" 4
.IX Item "--no-selinux-relabel"
.PD
\&\fI\-\-selinux\-relabel\fR forces SELinux relabelling next time the guest boots.
\&\fI\-\-no\-selinux\-relabel\fR disables relabelling.
.Sp
The default is to try to detect if SELinux relabelling is required.  See
\&\*(L"\s-1SELINUX\s0 \s-1RELABELLING\s0\*(R" below for more details.
.IP "\fB\-v\fR" 4
.IX Item "-v"
.PD 0
.IP "\fB\-\-verbose\fR" 4
.IX Item "--verbose"
.PD
Увімкнути докладний показ повідомлень з метою діагностики.
.IP "\fB\-V\fR" 4
.IX Item "-V"
.PD 0
.IP "\fB\-\-version\fR" 4
.IX Item "--version"
.PD
Показати дані щодо версії і завершити роботу.
.IP "\fB\-x\fR" 4
.IX Item "-x"
Увімкнути трасування викликів програмного інтерфейсу libguestfs.
.ie n .IP "\fB\-\-hostname\fR hostname (see ""hostname"" below)" 4
.el .IP "\fB\-\-hostname\fR hostname (see \f(CWhostname\fR below)" 4
.IX Item "--hostname hostname (see hostname below)"
Змінити назву вузла. Якщо не вказано, використовувати типове
\&\f(CW\*(C`localhost.localdomain\*(C'\fR.
.ie n .IP "\fB\-\-script\fR script (see ""script"" below)" 4
.el .IP "\fB\-\-script\fR script (see \f(CWscript\fR below)" 4
.IX Item "--script script (see script below)"
Run the named \f(CW\*(C`script\*(C'\fR (a shell script or program) against the guest.  The
script can be any program on the host.  The script's current directory will
be the guest's root directory.
.Sp
\&\fBNote:\fR If the script is not on the \f(CW$PATH\fR, then you must give the full
absolute path to the script.
.ie n .IP "\fB\-\-scriptdir\fR scriptdir (see ""script"" below)" 4
.el .IP "\fB\-\-scriptdir\fR scriptdir (see \f(CWscript\fR below)" 4
.IX Item "--scriptdir scriptdir (see script below)"
The mount point (an empty directory on the host) used when the \f(CW\*(C`script\*(C'\fR
operation is enabled and one or more scripts are specified using \fI\-\-script\fR
parameter(s).
.Sp
\&\fBNote:\fR \f(CW\*(C`scriptdir\*(C'\fR \fBmust\fR be an absolute path.
.Sp
If \fI\-\-scriptdir\fR is not specified then a temporary mountpoint will be
created.
.SH "ДІЇ"
.IX Header "ДІЇ"
If the \fI\-\-enable\fR option is \fInot\fR given, then most sysprep operations are
enabled.
.PP
Use \f(CW\*(C`virt\-sysprep \-\-list\-operations\*(C'\fR to list all operations for your
virt-sysprep binary.  The ones which are enabled by default are marked with
a \f(CW\*(C`*\*(C'\fR character.  Regardless of the \fI\-\-enable\fR option, sysprep operations
are skipped for some guest types.
.PP
Operations can be individually enabled using the \fI\-\-enable\fR option.  Use a
comma-separated list, for example:
.PP
.Vb 1
\& virt\-sysprep \-\-enable=ssh\-hostkeys,udev\-persistent\-net [тощо]
.Ve
.PP
Future versions of virt-sysprep may add more operations.  If you are using
virt-sysprep and want predictable behaviour, specify only the operations
that you want to have enabled.
.PP
\&\f(CW\*(C`*\*(C'\fR = enabled by default when no \fI\-\-enable\fR option is given.
.SS "\fBbash-history\fP *"
.IX Subsection "bash-history *"
Вилучити журнал команд bash у гостьовій системі.
.PP
Remove the bash history of user \*(L"root\*(R" and any other users who have a
\&\f(CW\*(C`.bash_history\*(C'\fR file in their home directory.
.SS "\fBblkid-tab\fP *"
.IX Subsection "blkid-tab *"
Remove blkid tab in the guest.
.SS "\fBca-certificates\fP"
.IX Subsection "ca-certificates"
Remove \s-1CA\s0 certificates in the guest.
.SS "\fBcron-spool\fP *"
.IX Subsection "cron-spool *"
Вилучити завдання at та cron користувачів.
.SS "\fBdhcp-client-state\fP *"
.IX Subsection "dhcp-client-state *"
Вилучити надані клієнтські адреси \s-1DHCP\s0.
.SS "\fBdhcp-server-state\fP *"
.IX Subsection "dhcp-server-state *"
Вилучити надані серверні адреси \s-1DHCP\s0.
.SS "\fBdovecot-data\fP *"
.IX Subsection "dovecot-data *"
Вилучити дані Dovecot (поштового сервера).
.SS "\fBflag-reconfiguration\fP"
.IX Subsection "flag-reconfiguration"
Позначити систему для зміни налаштувань.
.PP
Зауважте, що це може потребувати втручання користувача під час завантаження
гостьової системи.
.SS "\fBhostname\fP *"
.IX Subsection "hostname *"
Змінити назву вузла гостьової системи.
.PP
Ця дія змінює назву вузла гостьової системи на значення, вказане
за допомогою параметра \fI\-\-hostname\fR.
.PP
Якщо параметр \fI\-\-hostname\fR не буде вказано, назву вузла буде змінено на
\&\f(CW\*(C`localhost.localdomain\*(C'\fR.
.SS "\fBkerberos-data\fP"
.IX Subsection "kerberos-data"
Remove Kerberos data in the guest.
.SS "\fBlogfiles\fP *"
.IX Subsection "logfiles *"
Вилучити з гостьової системи багато файлів журналів.
.PP
У Linux вилучено такі файли:
.PP
.Vb 10
\& /root/anaconda\-ks.cfg
\& /root/install.log
\& /root/install.log.syslog
\& /var/account/pacct
\& /var/cache/gdm/*
\& /var/lib/AccountService/users/*
\& /var/lib/fprint/*
\& /var/lib/logrotate.status
\& /var/log/*.log*
\& /var/log/BackupPC/LOG
\& /var/log/audit/*
\& /var/log/btmp*
\& /var/log/ceph/*.log
\& /var/log/chrony/*.log
\& /var/log/cron*
\& /var/log/cups/*_log
\& /var/log/dmesg*
\& /var/log/glusterfs/*glusterd.vol.log
\& /var/log/glusterfs/glusterfs.log
\& /var/log/httpd/*log
\& /var/log/jetty/jetty\-console.log
\& /var/log/lastlog*
\& /var/log/libvirt/libvirtd.log
\& /var/log/libvirt/lxc/*.log
\& /var/log/libvirt/qemu/*.log
\& /var/log/libvirt/uml/*.log
\& /var/log/mail/*
\& /var/log/maillog*
\& /var/log/messages*
\& /var/log/ppp/connect\-errors
\& /var/log/secure*
\& /var/log/setroubleshoot/*.log
\& /var/log/spooler*
\& /var/log/squid/*.log
\& /var/log/tallylog*
\& /var/log/wtmp*
\& /var/named/data/named.run
.Ve
.SS "\fBmail-spool\fP *"
.IX Subsection "mail-spool *"
Вилучити поштове повідомлення з локального каталогу поштового буфера.
.SS "\fBnet-hwaddr\fP *"
.IX Subsection "net-hwaddr *"
Вилучити налаштування \s-1HWADDR\s0 (апаратної адреси \s-1MAC\s0).
.PP
Для Fedora і Red Hat Enterprise Linux це вилучається з файлів \f(CW\*(C`ifcfg\-*\*(C'\fR.
.SS "\fBpackage-manager-cache\fP *"
.IX Subsection "package-manager-cache *"
Вилучити кеш керування пакунками.
.SS "\fBpam-data\fP *"
.IX Subsection "pam-data *"
Remove the \s-1PAM\s0 data in the guest.
.SS "\fBrandom-seed\fP *"
.IX Subsection "random-seed *"
Створити породжувач випадкових чисел для гостьової системи.
.PP
Записати випадкові байти з основної системи до файла породжувача
псевдовипадкових чисел у гостьовій системі.
.PP
Див. \*(L"\s-1RANDOM\s0 \s-1SEED\s0\*(R" нижче.
.SS "\fBrhn-systemid\fP *"
.IX Subsection "rhn-systemid *"
Вилучити ідентифікатор системи у \s-1RHN\s0.
.SS "\fBsamba-db-log\fP *"
.IX Subsection "samba-db-log *"
Вилучити бази даних та файли журналів Samba.
.SS "\fBscript\fP *"
.IX Subsection "script *"
Запустити довільні скрипти дій над гостьовою системою.
.PP
The \f(CW\*(C`script\*(C'\fR module lets you run arbitrary shell scripts or programs
against the guest.
.PP
Note this feature requires \s-1FUSE\s0 support.  You may have to enable this in
your host, for example by adding the current user to the \f(CW\*(C`fuse\*(C'\fR group, or
by loading a kernel module.
.PP
Use one or more \fI\-\-script\fR parameters to specify scripts or programs that
will be run against the guest.
.PP
The script or program is run with its current directory being the guest's
root directory, so relative paths should be used.  For example: \f(CW\*(C`rm
etc/resolv.conf\*(C'\fR in the script would remove a Linux guest's \s-1DNS\s0
configuration file, but \f(CW\*(C`rm /etc/resolv.conf\*(C'\fR would (try to) remove the
host's file.
.PP
Normally a temporary mount point for the guest is used, but you can choose a
specific one by using the \fI\-\-scriptdir\fR parameter.
.SS "\fBsmolt-uuid\fP *"
.IX Subsection "smolt-uuid *"
Вилучити \s-1UUID\s0 обладнання Smolt.
.SS "\fBssh-hostkeys\fP *"
.IX Subsection "ssh-hostkeys *"
Вилучити ключі вузла \s-1SSH\s0 у гостьовій системі.
.PP
Ключі вузла \s-1SSH\s0 повторно створюються (незалежно) під час наступного
завантаження гостьової системи.
.PP
Якщо після клонування гостьова система отримати ту саму IP\-адресу, ssh
надасть вам додаткове попередження щодо зміни ключа вузла:
.PP
.Vb 4
\& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\& @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
\& @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
\& IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
.Ve
.SS "\fBssh-userdir\fP *"
.IX Subsection "ssh-userdir *"
Вилучити каталоги «.ssh» у гостьовій системі.
.PP
Вилучити каталог \f(CW\*(C`.ssh\*(C'\fR користувача «root» та всіх інших користувачів,
домашні каталоги яких містять каталог \f(CW\*(C`.ssh\*(C'\fR.
.SS "\fBsssd-db-log\fP *"
.IX Subsection "sssd-db-log *"
Вилучити бази даних і файли журналів sssd.
.SS "\fBudev-persistent-net\fP *"
.IX Subsection "udev-persistent-net *"
Вилучити постійні правила мережі udev.
.PP
Вилучити постійні правила мережі udev, які відображають вже створену
MAC\-адресу гостьової системи на фіксований пристрій ethernet (наприклад
eth0).
.PP
Після клонування гостьової системи MAC\-адреса зазвичай змінюється. Оскільки
стару MAC\-адресу вже пов’язано зі старою назвою (наприклад eth0), це
означає, що нову MAC\-адресу буде пов’язано з новою назвою (наприклад eth1),
а це зазвичай є небажаним. За допомогою вилучення постійних правил мережі
udev цьому можна запобігти.
.SS "\fBuser-account\fP"
.IX Subsection "user-account"
Вилучити облікові записи користувачів у гостьовій системі.
.PP
Вилучити всі облікові записи користувачів та відповідні домашні
каталоги. Обліковий запис «root» вилучено не буде.
.SS "\fButmp\fP *"
.IX Subsection "utmp *"
Вилучити файл utmp.
.PP
У цьому файлі зберігаються записи щодо входу користувачів до машини. У
сучасних дистрибутивах Linux ці записи зберігаються на диску у пам’яті, тому
не є частиною віртуальної машини на диску, але ці дані зберігаються на диску
у старіших версіях дистрибутивів.
.SS "\fByum-uuid\fP *"
.IX Subsection "yum-uuid *"
Вилучити \s-1UUID\s0 yum.
.PP
Yum створить новий \s-1UUID\s0 під час наступного запуску, коли виявить, що
початковий \s-1UUID\s0 було вилучено.
.SH "КОПІЮВАННЯ ТА КЛОНУВАННЯ"
.IX Header "КОПІЮВАННЯ ТА КЛОНУВАННЯ"
Virt-sysprep can be used as part of a process of cloning guests, or to
prepare a template from which guests can be cloned.  There are many
different ways to achieve this using the virt tools, and this section is
just an introduction.
.PP
A virtual machine (when switched off) consists of two parts:
.IP "\fIналаштування\fR" 4
.IX Item "налаштування"
The configuration or description of the guest.  eg. The libvirt \s-1XML\s0 (see
\&\f(CW\*(C`virsh dumpxml\*(C'\fR), the running configuration of the guest, or another
external format like \s-1OVF\s0.
.Sp
Some configuration items that might need to be changed:
.RS 4
.IP "\(bu" 4
назва
.IP "\(bu" 4
\&\s-1UUID\s0
.IP "\(bu" 4
шлях до блокових пристроїв
.IP "\(bu" 4
MAC\-адреса мережевої картки
.RE
.RS 4
.RE
.IP "\fIблокові пристрої\fR" 4
.IX Item "блокові пристрої"
One or more hard disk images, themselves containing files, directories,
applications, kernels, configuration, etc.
.Sp
Some things inside the block devices that might need to be changed:
.RS 4
.IP "\(bu" 4
hostname and other net configuration
.IP "\(bu" 4
\&\s-1UUID\s0
.IP "\(bu" 4
\&\s-1SSH\s0 host keys
.IP "\(bu" 4
Windows unique security \s-1ID\s0 (\s-1SID\s0)
.IP "\(bu" 4
Puppet registration
.RE
.RS 4
.RE
.SS "КОПІЮВАННЯ БЛОКОВОГО ПРИСТРОЮ"
.IX Subsection "КОПІЮВАННЯ БЛОКОВОГО ПРИСТРОЮ"
Starting with an original guest, you probably wish to copy the guest block
device and its configuration to make a template.  Then once you are happy
with the template, you will want to make many clones from it.
.PP
.Vb 7
\&                        virt\-sysprep
\&                             |
\&                             v
\& original guest \-\-\-\-\-\-\-\-> template \-\-\-\-\-\-\-\-\-\->
\&                                      \e\-\-\-\-\-\-> cloned
\&                                       \e\-\-\-\-\-> guests
\&                                        \e\-\-\-\->
.Ve
.PP
You can, of course, just copy the block device on the host using \fIcp\fR\|(1) or
\&\fIdd\fR\|(1).
.PP
.Vb 5
\&                   dd                 dd
\& original guest \-\-\-\-\-\-\-\-> template \-\-\-\-\-\-\-\-\-\->
\&                                      \e\-\-\-\-\-\-> cloned
\&                                       \e\-\-\-\-\-> guests
\&                                        \e\-\-\-\->
.Ve
.PP
There are some smarter (and faster) ways too:
.IP "\(bu" 4

.Sp
.Vb 5
\&                          snapshot
\&                template \-\-\-\-\-\-\-\-\-\->
\&                            \e\-\-\-\-\-\-> cloned
\&                             \e\-\-\-\-\-> guests
\&                              \e\-\-\-\->
.Ve
.Sp
Use the block device as a backing file and create a snapshot on top for each
guest.  The advantage is that you don't need to copy the block device (very
fast) and only changes are stored (less storage required).
.Sp
Note that writing to the backing file once you have created guests on top of
it is not possible: you will corrupt the guests.
.Sp
Tools that can do this include: \fIqemu\-img\fR\|(1) (with the \fIcreate \-f qcow2
\&\-o backing_file\fR option), \fIlvcreate\fR\|(8) (\fI\-\-snapshot\fR option).  Some
filesystems (such as btrfs) and most Network Attached Storage devices can
also create cheap snapshots from files or LUNs.
.IP "\(bu" 4
Get your \s-1NAS\s0 to snapshot and/or duplicate the \s-1LUN\s0.
.IP "\(bu" 4
Prepare your template using \fIvirt\-sparsify\fR\|(1).  See below.
.SS "VIRT-CLONE"
.IX Subsection "VIRT-CLONE"
A separate tool, \fIvirt\-clone\fR\|(1), can be used to duplicate the block device
and/or modify the external libvirt configuration of a guest.  It will reset
the name, \s-1UUID\s0 and \s-1MAC\s0 address of the guest in the libvirt \s-1XML\s0.
.PP
\&\fIvirt\-clone\fR\|(1) does not use libguestfs and cannot look inside the disk
image.  This was the original motivation to write virt-sysprep.
.SS "\s-1SPARSIFY\s0"
.IX Subsection "SPARSIFY"
.Vb 2
\&              virt\-sparsify
\& original guest \-\-\-\-\-\-\-\-> template
.Ve
.PP
\&\fIvirt\-sparsify\fR\|(1) can be used to make the cloning template smaller, making
it easier to compress and/or faster to copy.
.PP
Notice that since virt-sparsify also copies the image, you can use it to
make the initial copy (instead of \f(CW\*(C`dd\*(C'\fR).
.SS "ЗМІНА РОЗМІРІВ"
.IX Subsection "ЗМІНА РОЗМІРІВ"
.Vb 5
\&                         virt\-resize
\&                template \-\-\-\-\-\-\-\-\-\->
\&                            \e\-\-\-\-\-\-> cloned
\&                             \e\-\-\-\-\-> guests
\&                              \e\-\-\-\->
.Ve
.PP
If you want to give people cloned guests, but let them pick the size of the
guest themselves (eg. depending on how much they are prepared to pay for
disk space), then instead of copying the template, you can run
\&\fIvirt\-resize\fR\|(1).  Virt-resize performs a copy and resize, and thus is
ideal for cloning guests from a template.
.SH "БЕЗПЕКА"
.IX Header "БЕЗПЕКА"
Although virt-sysprep removes some sensitive information from the guest, it
does not pretend to remove all of it.  You should examine the \*(L"\s-1OPERATIONS\s0\*(R"
above and the guest afterwards.
.PP
Sensitive files are simply removed.  The data they contained may still exist
on the disk, easily recovered with a hex editor or undelete tool.  Use
\&\fIvirt\-sparsify\fR\|(1) as one way to remove this content.  See also the
\&\fIscrub\fR\|(1) command to get rid of deleted content in directory entries and
inodes.
.SS "БАЗА ВИПАДКОВОСТІ"
.IX Subsection "БАЗА ВИПАДКОВОСТІ"
\&\fI(Цей розділ стосується лише гостьових систем Linux)\fR
.PP
The virt-sysprep \f(CW\*(C`random\-seed\*(C'\fR operation writes a few bytes of randomness
from the host into the guest's random seed file.
.PP
If this is just done once and the guest is cloned from the same template,
then each guest will start with the same entropy, and things like \s-1SSH\s0 host
keys and \s-1TCP\s0 sequence numbers may be predictable.
.PP
Therefore you should arrange to add more randomness \fIafter\fR cloning from a
template too, which can be done by just enabling the \f(CW\*(C`random\-seed\*(C'\fR
operation:
.PP
.Vb 2
\& cp template.img newguest.img
\& virt\-sysprep \-\-enable random\-seed \-a newguest.img
.Ve
.SS "ПОВТОРНЕ ВСТАНОВЛЕННЯ МІТОК \s-1SELINUX\s0"
.IX Subsection "ПОВТОРНЕ ВСТАНОВЛЕННЯ МІТОК SELINUX"
\&\fI(Цей розділ стосується лише гостьових систем Linux, у яких
використовується лише SELinux)\fR
.PP
If any new files are created by virt-sysprep, then virt-sysprep touches
\&\f(CW\*(C`/.autorelabel\*(C'\fR so that these will be correctly labelled by SELinux the
next time the guest is booted.  This process interrupts boot and can take
some time.
.PP
You can force relabelling for all guests by supplying the
\&\fI\-\-selinux\-relabel\fR option.
.PP
You can disable relabelling entirely by supplying the
\&\fI\-\-no\-selinux\-relabel\fR option.
.SH "ЕКРАНУВАННЯ СИМВОЛІВ У ОБОЛОНЦІ"
.IX Header "ЕКРАНУВАННЯ СИМВОЛІВ У ОБОЛОНЦІ"
Libvirt guest names can contain arbitrary characters, some of which have
meaning to the shell such as \f(CW\*(C`#\*(C'\fR and space.  You may need to quote or
escape these characters on the command line.  See the shell manual page
\&\fIsh\fR\|(1) for details.
.SH "СТАН ВИХОДУ"
.IX Header "СТАН ВИХОДУ"
This program returns 0 on success, or 1 if there was an error.
.SH "ТАКОЖ ПЕРЕГЛЯНЬТЕ"
.IX Header "ТАКОЖ ПЕРЕГЛЯНЬТЕ"
\&\fIguestfs\fR\|(3), \fIguestfish\fR\|(1), \fIvirt\-clone\fR\|(1), \fIvirt\-rescue\fR\|(1),
\&\fIvirt\-resize\fR\|(1), \fIvirt\-sparsify\fR\|(1), \fIvirsh\fR\|(1), \fIlvcreate\fR\|(8),
\&\fIqemu\-img\fR\|(1), \fIscrub\fR\|(1), <http://libguestfs.org/>,
<http://libvirt.org/>.
.SH "АВТОРИ"
.IX Header "АВТОРИ"
Richard W.M. Jones <http://people.redhat.com/~rjones/>
.PP
Wanlong Gao, Fujitsu Ltd.
.SH "АВТОРСЬКІ ПРАВА"
.IX Header "АВТОРСЬКІ ПРАВА"
Copyright (C) 2011\-2012 Red Hat Inc.
.PP
Copyright (C) 2012 Fujitsu Ltd.
.PP
Ця програма є вільним програмним забезпеченням; ви можете поширювати та/або
змінювати її за умов дотримання \s-1GNU\s0 General Public License  утому вигляді,
що оприлюднений Free Software Foundation; версії 2 цієї Ліцензії, або (якщо
забажаєте) будь\-якої випущеної пізніше.
.PP
Ця програма поширюється у сподіванні, що вона буде корисною, але БЕЗ
БУДЬ\-ЯКИХ ГАРАНТІЙНИХ ЗОБОВ’ЯЗАНЬ; навіть без очевидної гарантії
ПРАЦЕЗДАТНОСТІ або ПРИДАТНОСТІ ДЛЯ ВИКОРИСТАННЯ З ПЕВНОЮ МЕТОЮ. Докладніше
про це можна дізнатися з \s-1GNU\s0 General Public License.
.PP
Ви маєте отримати копію \s-1GNU\s0 General Public License разом з цією програмою;
якщо це не так, повідомте про факт за адресою Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA\s0 02110\-1301, \s-1USA\s0.