https://github.com/bcambl/vmclone
A virtual machine cloning script written in python
https://github.com/bcambl/vmclone
Last synced: 3 months ago
JSON representation
A virtual machine cloning script written in python
- Host: GitHub
- URL: https://github.com/bcambl/vmclone
- Owner: bcambl
- License: bsd-3-clause
- Created: 2014-08-16T00:36:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-13T02:04:04.000Z (over 11 years ago)
- Last Synced: 2025-02-27T11:28:47.337Z (over 1 year ago)
- Language: Python
- Size: 297 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# vmclone.py
This is a script that I use for creating multiple virtual machines clones.
Create a minimal CentOS VM and clone this project to your /root directory. Now
shutdown the VM and clone. Once the new clone has booted, execute the script to
change the hostname and IP addresses.
Assumptions:
-----------
- Linux distribution is CentOS/RHEL 6/7 (script may require tweaks for others)
#### The following files will be modified:
/etc/hosts - PRIMARY IP, BACKUP IP, HOSTNAME, DOMAIN
/etc/sysconfig/network - HOSTNAME
/etc/sysconfig/network-scripts/ifcfg- - IP, NETMASK, GATEWAY, MAC, UUID
/etc/ntp.conf - NTP SERVERS (ntp servers specified in settings)
/ect/resolv.conf - NAMESERVERS (nameservers specified in settings)
#### Un-Identify Host for Cloning
You will be prompted whether you would like to un-identify the server and
shutdown. This will remove the following files:
/etc/udev/rules.d/70-persistent-net.rules (CentOS 6)
/etc/ssh/ssh_host_*
This will allow the system to re-generate the files upon next (re)boot.
##### Usage Notes
```
# sudo ./vmclone.py
```
**Available parameters:**
*none* - Display current interface names and associated MAC addresses
*check* - Tests Nameservers and NTP servers outlined in settings (no files written)
*clone* - Prompts for new Hostname and IP information, Checks available nameservers
and ntp servers, writes configuration files, and prompts for un-identify/shutdown.
*The script requires root or sudo to execute.*
*Comment out the 'development' variables and uncomment the 'production' variables
in the settings.py file*