0

Currently we are using a VMware ESXi system to host some RHEL 7.2 virtual machines and we are installing our product onto them for testing purposes. The problem we have is that the process to generate those virtual machines, or better said, to install our product on them, is manual and requires human intervention in the middle of the process.

The installation is based on two iso files: the first one is a RHEL 7.2 iso with a custom kickstart file, but after the OS gets installed, we need to swap the iso and use the second iso file to install other dependencies that we can't include in the first iso for legal reasons (or at least that's what I've been told).

This process becomes obviously tedious when you have to provide several virtual machines to different developers, and makes it impossible to automate the process and avoid any user interaction.

That being said, I've searched for different solutions like Cobbler, Spacewalk, Puppet, FAI... and I'd like to know which tool would be best for the task that I describe so I could automate the process.

jbarren
  • 3
  • 2
  • Does the other ISO include RPM files? Can't you just install them from a custom repo you reference in the kickstart? – Sven Jul 12 '16 at 10:41
  • Why not merge the data on the two ISO's into a single one? – HBruijn Jul 12 '16 at 10:46
  • @Sven The first ISO includes RPM files required by the installation, and the second one includes an Informix installer and a couple of RPMs that install our product. – jbarren Jul 12 '16 at 11:58
  • @HBruijn Apparently we are not allowed to distribute both ISOS into one for some legal reasons. – jbarren Jul 12 '16 at 12:01

1 Answers1

0

Use PowerCLI to automate this process. This isn't a trivial project, but it is extremely flexible and can lay the foundation for future VM automation. The workflow would look something like this

  1. Deploy a template with the RHEL 7.2 mounted and Power on
  2. Wait for deploy to finish (this might need to be a powershell loop with a sleep() call and a test to determine if the setup is complete, perhaps if a log in is successful.
  3. Change the mounted ISO
  4. Remote Powershell into the VM to complete the setup.

I will expand on Step 3, since it is most related to your question.

#Setup for your Environment
$vcenter = "yourVcenterServer"
$vmame = "yourVMName"
$pathOnDatastoreToIso = "/path/to/iso/on/datastore.iso"

#Change Mounted Iso
Connect-VIServer $vcenter
$diskDriveForYourVM = get-cdDrive -vm $vmname
$diskDriveForYourVM | set-cdDrive -StartConnected:$true -Connected:$true -IsoPath $pathOnDatastoreToIso
Eric
  • 554
  • 1
  • 5
  • 15