<commit_before>---
title: virt-sysprep
authors: shaharh
wiki_title: Features/virt-sysprep
wiki_revision_count: 9
wiki_last_updated: 2015-11-02
feature_name: Virtual Sysprep
feature_modules: engine,vdsm
feature_status: Design
---

# Virt-Sysprep

### Summary

This feature will enable user to run [virt-sysprep](http://libguestfs.org/virt-sysprep.1.html) on Virtual Machine. virt-sysprep enable user to set and rested OS feature such as reset host name and network address and ssh keys as well as copy files, inject ssh keys to a given user, run scripts, run on next boot and more.

This feature will include

*   Automatic reset network, ssh etc on cloning VM
*   Automatic reset network, ssh etc on import VM
*   Virt-Sysprep page that will have extend operations such as: injecting ssh keys, running scripts etc.

Note that currently virt-sysprep support Linux only guest and only tested on major distributions.

### Owner

*   Name: [ <NAME>](User:Shaharh)
*   Email: <<EMAIL>>

### Detailed Design

=

#### vdsm

add a virt-sysprep module with general interface for running virt-sysprep utility.

*   api will get full drive path of the VM to manipulate
*   api will accept key-value object for setting virt-sysprep actions and a dictionary parameter for operations

action (injecting data) {'user-password': {'<PASSWORD>' : {'<PASSWORD>'}, 'hostname': 'mynewvm'} operations (enable/disable opetions): ['delete-ssh-keys', 'dhcp-client']

#### engine

*   Clone VM:

automatic erase the following:

\*# dhcp-client-state

\*# net-hostname

\*# net-hwaddr

\*# ssh-hostkeys

\*# udev-persistent-net

*   Virt-Sysprep Tab:
    1.  run a startup script
    2.  set hostname
    3.  set user password
    4.  set root password
    5.  remove user account
    6.  inject ssh public key for user
    7.  set timezone

<!-- -->

*   UI desing:

TBD.

### Current status

*   engine: Design
*   vdsm: Design
<commit_msg>engine<commit_after>---
title: virt-sysprep
authors: shaharh
wiki_title: Features/virt-sysprep
wiki_revision_count: 9
wiki_last_updated: 2015-11-02
feature_name: Virtual Sysprep
feature_modules: engine,vdsm
feature_status: Design
---

# Virt-Sysprep

### Summary

This feature will enable user to run [virt-sysprep](http://libguestfs.org/virt-sysprep.1.html) on Virtual Machine. virt-sysprep enable user to set and rested OS feature such as reset host name and network address and ssh keys as well as copy files, inject ssh keys to a given user, run scripts, run on next boot and more.

This feature will include

*   Automatic reset network, ssh etc on cloning VM
*   Automatic reset network, ssh etc on import VM
*   Virt-Sysprep page that will have extend operations such as: injecting ssh keys, running scripts etc.

Note that currently virt-sysprep support Linux only guest and only tested on major distributions.

### Owner

*   Name: [ <NAME>](User:Shaharh)
*   Email: <<EMAIL>>

### Detailed Design

=

#### vdsm

add a virt-sysprep module with general interface for running virt-sysprep utility.

*   api will get full drive path of the VM to manipulate
*   api will accept key-value object for setting virt-sysprep actions and a dictionary parameter for operations

action (injecting data) {'user-password': {'<PASSWORD>' : {'<PASSWORD>'}, 'hostname': 'mynewvm'} operations (enable/disable opetions): ['delete-ssh-keys', 'dhcp-client']

#### engine

All the engines operations are stateless and do not need database persistence.

*   Clone VM:

automatic erase the following:

\*# dhcp-client-state

\*# net-hostname

\*# net-hwaddr

\*# ssh-hostkeys

\*# udev-persistent-net

*   Virt-Sysprep Tab:
    1.  run a startup script
    2.  set hostname
    3.  set user password
    4.  set root password
    5.  remove user account
    6.  inject ssh public key for user
    7.  set timezone

<!-- -->

*   UI desing:

TBD.

### Current status

*   engine: Design
*   vdsm: Design

{'fraction_non_alphanumeric': 0.09607993850883935, 'fraction_numerical': 0.008711247758134769, 'mean_word_length': 3.6754491017964073, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2630366', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1188, 'n_words': 474}