Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...


Cloud OSS - Hyper-V Service Manager

How to Create Guest OS (Linux) Templates in Hyper-V

 

Table of Contents

Table of Contents
maxLevel2
minLevel2
indent10px
stylenone


 

...


This section provides information that will assist you in creating Linux based guest OS templates in Microsoft Hyper-V, that will be used by Interworks Cloud interworks.cloud OSS Service Manager during VM provisioning.

...

5) Navigate to the CentOS .ISO image that you have previously uploaded to SCVMM Server and click on Open.                      Image Removed

Image Added

Fig 5. Adding .ISO image to the Library

...

10) The ISO image should now appear in the folder selected in step 7.

Image RemovedImage Added

Fig 10. Viewing the ISO image Library Share

...

14) Type in the Virtual machine name, choose Generation 1 and click on Next.

Image RemovedImage Added

Fig 14. VM name and generation 

...

Fig 17. Setting CPU resources


Image RemovedImage Added

Fig 18. Setting Memory resources


Image RemovedImage Added

Fig 19. Setting Hard Disk resources

...

18) In Virtual DVD Drive choose "Existing ISO image" and browse for the uploaded .ISO image on the Library Share.

Image RemovedImage Added

Fig 20. Mounting the .ISO image                                                                                                                                                                                                                                                                                                                                                                       

...

19) Select the .ISO Image to be inserted in the Virtual DVD Drive and click on OK.

Image RemovedImage Added

                                     Fig 21. Selecting .ISO image                                                                                    


Image RemovedImage Added

Fig 22. The .ISO image is selected

...

20) Select Network Adapter 1 and click Remove. In the appearing window, click on Yes

Image RemovedImage Added

Fig 23. Remove Network Adapter 1                                                                          


Image RemovedImage Added

Fig 24. Removing Network Adapter

...

21) Click on New -> Legacy Network Adapter to add a Legacy Network Adapter to the VM template.

 Image RemovedImage Added

Fig 25. Adding a Legacy Network Adapter
 

...

22) Select Connect to a VM Network and then click on Browse.

Image RemovedImage Added

Fig 26. Connect Legacy Network Adapter to a VM Network

...

23) Select a VM Network and click on OK.

Image RemovedImage Added

Fig 27. Selecting VM Network

...

24) Once you finish with Hardware Configuration, click on Next.

Image RemovedImage Added

Fig 28. Finishing Hardware Configuration

...

25) In the Select Destination tab, click on Next.

Image RemovedImage Added

Fig 29. Select Destination Tab

...

 

27) In the Configure Settings tab, click on Next.

Fig 31. Choosing storage location



28) In the Add Properties tab, choose CentOS Linux 6 (64 bit) on the OS drop-down list and click on Next.

Image RemovedImage Added

Fig 32. Choosing an Operating System



29) Finally, click on Create in the Summary tab.

Image RemovedImage Added

Fig 33. Settings confirmation and VM creation



30) Wait until the VM creation is completed and close the Jobs window.

Image RemovedImage Added

Fig 34. VM creation in progress



31) As soon as the VM is created, it will be listed in SCVMM console as belonging to a Hyper-V Cluster and/or a Hyper-V node.

Image RemovedImage Added

Fig 35. New VM listed



32) Click on Power On to start the Virtual Machine. Notice that the status of the VM changes to "Starting" and then "Running".

Image RemovedImage Added   

Fig 36. Start the New VM


Image RemovedImage Added 

Fig 37. VM is starting


 Image RemovedImage Added

Fig 38. VM is running                                                                                                  



33) Click on Connect or View->Connect via Console in order to connect to the console.

 Image RemovedImage Added

Fig 39. Connect to VM via Console

 

 

34) Choose to "Install or upgrade an existing system" and press Enter.

Image RemovedImage Added

Fig 40. CentOS initial installation screen

...

35) Choose whether to test or skip testing the media before installation and click on "Next" in the screen that follows.

Image RemovedImage Added

Fig 41. Install media test dialogue box

...

36) In the Welcome to CentOS page, click on Next.

Image RemovedImage Added

Fig 42. Welcome to CentOS page

...

37) Choose your preferred Language and Keyboard layout. Once you choose, click on Next.

Image RemovedImage Added 

Fig 43. Preferred language                                                                                   


Image RemovedImage Added

Fig 44. Preferred keyboard layout



38) In the Type of Devices page, select "Basic Storage Devices" and click on Next. In the pop-up window, click on "Yes, discard any data".

Image RemovedImage Added 

Fig 45. Installation devices                                                                                     


Image RemovedImage Added

Fig 46. Storage Device Warning

...

39) Enter the FQDN (Fully Qualified Domain Name) you want to use for this Virtual Machine.

Image RemovedImage Added

Fig 47. Virtual Machine Template FQDN

...

40) Click on the "Configure Network" button and edit the "System eth0" network interface. Configure the IPv4 settings so that you can access the template later on. 


Note
iconfalse

Configure the IPv4 settings of your choice in the highlighted fields, as shown in the example below.

Image RemovedImage Added 

Fig 48. Network configuration                                                                              


Image RemovedImage Added

Fig 49. System etho network settings



41) Select the appropriate time zone and click on "Next". In the following screen set a "Root" password.

Image RemovedImage Added 

Fig 50. Time settings                                                                                         


Image RemovedImage Added

Fig 51. Setting root password



42) In the following screen select "Use All Space" and click on "Next". In the pop-up window, click on "Write changes to disk".

Image RemovedImage Added 

Fig 52. Partitioning                                                                                            


Image RemovedImage Added

Fig 53. Write changes to disk



43) Choose installation type (Since this is going to be a server template, we choose the "Basic Server" option). The installation process will begin once we click on "Next".

Image RemovedImage Added

Fig 54. Installation type                                                                                      


Image RemovedImage Added

Fig 55. Starting installation process

...

44) When the installation process is over, click on "Reboot".

Image RemovedImage Added

Fig 56. Rebooting upon successful installation

 

 

 

4. Preparing the Virtual Machine for Template

...


45) After the Reboot process is completed successfully, shutdown the Virtual Machine by logging in as root with the password you entered during the installation and run the following command:

  • shutdown –h now

Image RemovedImage Added

Fig 57. Shutting down the Virtual Machine

...

46) While the Virtual Machine is turned off, go to VMM console, right click on the VM and click on Properties.

Image RemovedImage Added

Fig 58. Setting VM's Properties



47) Go to Hardware Configuration, click on the "Legacy Network Adapter" and then click on Remove in order to remove it. In the pop-up window click on Yes.

Image RemovedImage Added

Fig 59. Removing Legacy Network Adapter

...

48) Click on New->Network Adapter in order to add a "Standard Network Adapter". Click on the Adapter and select Connect to a VM Network, then click on OK.

Image RemovedImage Added

Fig 60. Adding a Standard Network Adapter                                                                        


Image RemovedImage Added

Fig 61. Connect to a VM Network

...

49) Turn the Virtual Machine on and login as root. By default CentOS and Oracle Linux do not enable the network adapter on startup. If you run the command "ifconfig" you will only find the loopback adapter listed.

Image RemovedImage Added

Fig 62. Running ifconfig


50) Also, by default the first adapter will be eth0. However, if we attempt to enable it by using the "ifconfig eth0 up" command we will receive a "no such device" error message as shown in the figure below:

Image RemovedImage Added

Fig 63. Attempting to bring etho interface up

 

Note
iconfalse

This is because eth0 is assigned to the legacy adapter we just removed. In order to fix this we need to clear the existing adapter rules, and update the configuration file for eth0.

...

We should receive a screen similar to the one below:

Image RemovedImage Added

Fig 64. Updating config file for eth0

...

52) From the config file, remove the line that starts with HWADDR and set the value for BOOTPROTO=static. Press Ctrl-X + Y + Enter, in order to exit and save your changes.

Image RemovedImage Added

Fig 65. Updated config file                                                                                    


Image RemovedImage Added

Fig 66. Updated config file is saved

...

  • rm /etc/udev/rules.d/70-persistent-net.rules –f
  • shutdown –r now

Image RemovedImage Added

Fig 67. Removing Network Rules and Rebooting the VM

...

54) After rebooting, run the "ifconfig" command to verify that the network is set to eth0 and an IP address is configured.

Image RemovedImage Added

Fig 68. Verifying eth0 proper state and configuration

...


Image RemovedImage Added

Fig 69a. Adding backup essentials to the VM

...

  • cd LIS-backupessentials-4e3121f/hv/hv-rhel6.5/rpm/
  • chmod +x install.sh
  • ./install.sh
  • Reboot


Image RemovedImage Added

Fig 69b. Adding backup essentials to the VM

...

When the "Is this ok" question pops up, type "y" and press Enter.

Image RemovedImage Added

Fig 70a. Installing KVP                                                                                  


Image RemovedImage Added

Fig 70b. Installation of KVP is complete                


Accordingly install libvirt, which is the API for managing platform virtualization, by running the following command (when the "Is this ok" question pops up, type "y" and press Enter):

  • yum install libvirt

Image RemovedImage Added

Fig 70c. Installation of libvirt is complete

...


57) Download the Hard disk extend scripts on your Workstation from here. Unrar the file and extract the scripts to a destination of your preference.

Image RemovedImage Added

Fig 71. Downloading the Hard disk extend scripts

...

58) Run the WinSCP or any other SCP client tool. Browse to the destination where you saved rc.local file on your Workstation. Select the file and click on Upload.

Image RemovedImage Added

Fig 72a. Open WinSCP                                                                                        


Image RemovedImage Added

Fig 72b. Uploading rc.local file

...

59) Copy and overwrite the rc.local file from the CloudWorks-Linux-ExtendScripts folder to the /etc/ directory on the Linux Operating System. At the Upload pop-up window, type "/etc/" in the remote directory field and click on OK. On the Confirm pop up window click on Yes.

Image RemovedImage Added

Fig 73a. Copying rc.local                                                                                              


Image RemovedImage Added

Fig 73b. Overwriting rc.local                                          

...

60) Grant executable permissions to the new rc.local file by running the following command:

  • chmod +x /etc/rc.local

Image RemovedImage Added

Fig 74. Granting executable permissions to rc.local

...

  • chmod +x /etc/rc.d/init.d/disk_extend_script1.sh
  • chmod +x /etc/rc.d/init.d/disk_extend_script2.sh

Image RemovedImage Added  

Fig 75a. Upload the disk extend scripts                                                         


Image RemovedImage Added

Fig 75b. Copying the disk extend files to /etc/rc.d/init.d/


Image RemovedImage Added

Fig 75c. Granting executable permissions to the disk extend scripts

...


62) Remove the wtmp reboot counter with the following command:

  • rm –rf /var/log/wtmp

Image RemovedImage Added

Fig 76. Removing wtmp reboot coonter

...

  • cd /the/directory/you/copy/the/agent/and/the/shell/script
  • chmod +x install.sh
  • ./install.sh scvmmguestagent.1.0.2.1014.x64.tar

Image RemovedImage Added

Fig 77a. Adding SCVMM Guest Agent to VM                                                          


Image RemovedImage Added

Fig 77b. SCVMM Guest Agent successfully installed

...

  • rm /etc/udev/rules.d/70-persistent-net.rules –f

Image RemovedImage Added

Fig 78. Clearing network rules

...

 
65) Shutdown the Virtual Machine by running the following command:

  • shutdown –h now

Image RemovedImage Added

Fig 79. Shutting down VM

...

66) In SCVMM console right click on the CentOS-6.5-for-Template VM and choose Create -> Clone.

 Image RemovedImage Added

Fig 80. Creating a clone VM

...

67) In the Identity tab, Specify machine name for this VM clone and click on "Next".

Image RemovedImage Added

Fig 81. Specifying clone machine name 


68) In the Configure Hardware tab click on Availability below Advanced and check the "Make this Virtual Machine High Available" option. Click on Next 

Image RemovedImage Added   

Fig 82. Turning on high availability

...

69) In the Select Destination tab, select "Place the virtual machine on a Host" and choose your host cluster or standalone server. Click on Next.

Image Removed   Image RemovedImage Added

Fig 83. Placing the VM on a host                                                                                          


Image Added

Fig 84. Selecting Host                                                                                                        

 

 

70) Set all other options to default and click on "Create" at the end of this wizard. Wait for the cloning process to be completed.

Image Removed   Image RemovedImage Added  

Fig 85a. Selecting Path                                                                                          


Image Added

Fig 85b. Selecting Network

                                                              

Image Removed   Image RemovedImage Added

Fig 85c. Adding Properties                                                                                            


Image Added

Fig 85d. Creating VM clone

 

Image RemovedImage Added

Fig 85e. Cloning process

...

71) Once the VM clone is created, right-click on it and click on Properties.

Image RemovedImage Added

Fig 86. VM Clone Properties

...

72) Go to the Hardware Configuration tab, click on the Hard Disk and copy the file location address of this VHD.

Image RemovedImage Added

Fig 87. Copy VHD location

...

73) Open File explorer and paste the Iocation of the VHD file of the Virtual Machine. Copy the VHD file.

Image RemovedImage Added

Fig 88. Copy VHD file

...

74) Go to VMM, click on Library, then right-click on the Library main folder and click on Explore.

Image RemovedImage Added

Fig 89. Explore VMM Library

...

75) Select a Library location and paste the VHD file you copied in step 73.

Image RemovedImage Added

Fig 90. Paste VHD file

...

76) Select Library in SCVMM console on the bottom left. On the upper left of the SCVMM console, right click on Templates and choose "Create VM Template".

Image RemovedImage Added

Fig 91. Creating a VM Template



77) In the Select Source tab, choose "Use an existing VM template or a virtual hard disk stored in the library" and click on Browse.

Image RemovedImage Added    

Fig 92. Selecting source for the new VM Template                                                                          

...

78)Select the VHD file you pasted in step 75. Click on OK and then click on Next

Image RemovedImage Added

Fig 93. Selecting VHD file from the Library


79) In the Identity tab, specify VM template's name, choose Generation 1 from the drop-down list and click on Next.

Image RemovedImage Added   

Fig 94. Specifying VM Template name and Generation                                                                   


80) In the Configure Hardware tab, in Cloud Capability Profile section, check Hyper-V.

Image RemovedImage Added

Fig 95. Select Cloud Capability Profile



81) Set Memory to at least 1024 MB and click on Next.

Image RemovedImage Added

Fig 96. Specify VM Template Memory


82) In the  In the Configure Operating System Settings tab, select "linux os profile" for "Guest OS profile" and select "CentOS Linux 6 (64 bit)" for "Operating system", in the dropdown menu (for Oracle Linux select "Oracle Linux 6 (64 bit)"). Click on Next.

...

select "Create new Linux operating system customization settings" from the Guest OS profile drop-down list. In the Operating System drop-down list, select "CentOS Linux 6 (64bit)" and click on Next.

Image Added

Fig 97. Specify Operating system



83) In the Select Library Server tab, select the appropriate library server and click on Next. In the Select Path tab, click on Browse to select the path on the Library Server to save the template and click on Next.

...

Application Configuration tab and in the SQL Server Configuration tab click on Next.

Image Added

   Fig 98.

...

Application Configuration                                              

...

  


Image Added

Fig 99.

...

SQL Server Configuration

 

 

84) View your "Summary" configuration settings and  In the Summary tab, click on "Create".

Image RemovedImage Added

Fig 100. Creating a VM Template

...