Abstract | U ovom završnom radu kreirao sam skriptu za kreiranje, brisanje i vraćanje virtualnih mašina u prijašnje stanje. Glavna motivacija za uzimanje ovakve teme bila mi je osobno zanimanje u području skriptiranja, od prvog puta kada sam se upoznao sa skriptiranjem želio sam naučiti kako pisati i razumjeti što skripta radi. Uz to, spoznaja da je korištenje skripti nešto što svaka ozbiljna IT organizacija koristi još dodatno me motiviralo da kreiram skriptu. Za potrebe pisanja skripte koristio sam PowerShell, odnosno PowerShell ISE, i PowerCLI, dodatni modul VMware-a koji mi je omogućio da pomoću njega upravljam virtualnim mašinama kreiranim na VMware hipervizoru kroz PowerShell. PowerShell je Microsoftov novi, poboljšani naredbeni redak koji se koristi u svrhu automatizacije zadataka i upravljanja konfiguracijama. Objektno je orijentiran, što znači da koristi objekte unutar svojeg koda koji su poznatiji pod imenom komandleti. PowerShell također ima ugrađen i skriptni dio, nazvan PowerShell ISE. Unutar njega, moguće je kreirati i testirati skripte te ga dodatno nadograditi novim modulima koji proširuju njegovu funkciju. Instalacija PowerShell-a nije bila potrebna jer je on već predinstaliran na svakom novom Windows operativnom sustavu.
Uz PowerShell, koristio sam i VMware-ovu virtualizacijsku tehnologiju pomoću koje sam kreirao virtualne mašine nad kojima sam testirao svoju skriptu. Ti VMware-ovi proizvodi uključuju Workstation Pro, vSphere ESXi hipervizor i PowerCLI. Workstation Pro i ESXi u osnovi vrše istu ulogu virtualizacije, no ESXi nije moguće instalirati na sustavu koji ima operativni sustav, dok Workstation Pro jest, ali PowerCLI se jedino može koristiti za ESXi zbog čega sam morao koristiti oba proizvoda kako bih virtualizirao ESXi unutar Workstation Pro-a i time omogućio da se ESXi pokreće na mom računalu. Kasnije sam unutar ESXi-a kreirao nove virtualne mašine koje su se koristile za potrebe testiranja skripte.
Pisanje same skripte provođeno je unutar PowerShell ISE. Sama skripta kroz tekstualno sučelje korisniku prikazuje glavni meni sa svim opcijama koje skripta nudi. Te opcije uključuju kreiranje potpuno novih virtualnih mašina ili kloniranja korištenjem linked klonova, brisanje ili vraćanje tih istih mašina u prijašnje stanje. Skripta je testirana i uspješno obavlja sve svoje funkcije, a ušteda vremena koju ostvaruje u odnosu na ručno obavljanje prije navedenih funkcija opravdava korisnost korištenja skripti. |
Abstract (english) | In my thesis I made a script which creates, deletes and reverts virtual machines in their previous state. My main motivation for taking this kind of topic was my personal interest in the field of scripting, since the first time I got introduced to scripting I wanted to learn how to write and understand what a script does. In addition to that, realization that every serious IT organization uses scripts motivated me further to create a script. For the purpose of writing my script I used PowerShell, PowerShell ISE and PowerCLI, an additional VMware module which allowed me to manage virtual machines created inside the VMware hypervisor through PowerShell. PowerShell is Microsoft's new and improved command prompt which is used for the purpose of automating tasks and managing configurations. It is object oriented, which means that it uses objects inside its code which are more familiar under the name of commandlets. PowerShell also has an integrated scripting part, called PowerShell ISE. With it, it's possible to create and test scripts aswell as additionaly upgrading it with new modules which extend its functionality. Installation of PowerShell was not needed since it's already preinstalled on every new Windows operating system.
Alongside PowerShell, I used VMware's virtualization technology to create virtual machines which were used to test my scripts. These VMware products include Workstation Pro, vSphere ESXi hypervisor and PowerCLI. Workstation Pro and ESXi essentially do the same job, but ESXi requires to be installed on a OS free system, while Workstation Pro can be installed as a software, but PowerCLI can only be used for ESXi and for that reason I had to use both products to virtualize ESXi inside Workstation Pro and enable myself to run ESXi on my computer. Later on, I created new virtual machines inside ESXi to which were used for testing purposes for my script.
Writing of the script was done with PowerShell ISE. The script iteself through a text interface present the user a main menu with all the options that script offers. These options include creating completely new virtual machines or cloning them using linked clones, deleting or reverting those virtual machines in their previous state. The script has been tested and it successfully does its functions and the time save it achieves compared to the manual process of the beforementioned functions justifies its usefulness for using scripts. |