...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Cloud OSS - Hyper-V Service Manager | How to Create Guest OS (Linux) Templates in Hyper-V |
---|
Table of Contents
Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
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.
Fig 5. Adding .ISO image to the Library
...
10) The ISO image should now appear in the folder selected in step 7.
Fig 10. Viewing the ISO image Library Share
...
14) Type in the Virtual machine name, choose Generation 1 and click on Next.
Fig 14. VM name and generation
...
Fig 17. Setting CPU resources
Fig 18. Setting Memory resources
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.
Fig 20. Mounting the .ISO image
...
19) Select the .ISO Image to be inserted in the Virtual DVD Drive and click on OK.
Fig 21. Selecting .ISO image
Fig 22. The .ISO image is selected
...
20) Select Network Adapter 1 and click Remove. In the appearing window, click on Yes.
Fig 23. Remove Network Adapter 1
Fig 24. Removing Network Adapter
...
21) Click on New -> Legacy Network Adapter to add a Legacy Network Adapter to the VM template.
Fig 25. Adding a Legacy Network Adapter
...
22) Select Connect to a VM Network and then click on Browse.
Fig 26. Connect Legacy Network Adapter to a VM Network
...
23) Select a VM Network and click on OK.
Fig 27. Selecting VM Network
...
24) Once you finish with Hardware Configuration, click on Next.
Fig 28. Finishing Hardware Configuration
...
25) In the Select Destination tab, click on Next.
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.
Fig 32. Choosing an Operating System
29) Finally, click on Create in the Summary tab.
Fig 33. Settings confirmation and VM creation
30) Wait until the VM creation is completed and close the Jobs window.
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.
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".
Fig 36. Start the New VM
Fig 37. VM is starting
Fig 38. VM is running
33) Click on Connect or View->Connect via Console in order to connect to the console.
Fig 39. Connect to VM via Console
34) Choose to "Install or upgrade an existing system" and press Enter.
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.
Fig 41. Install media test dialogue box
...
36) In the Welcome to CentOS page, click on Next.
Fig 42. Welcome to CentOS page
...
37) Choose your preferred Language and Keyboard layout. Once you choose, click on Next.
Fig 43. Preferred language
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".
Fig 45. Installation devices
Fig 46. Storage Device Warning
...
39) Enter the FQDN (Fully Qualified Domain Name) you want to use for this Virtual Machine.
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 | ||
---|---|---|
| ||
Configure the IPv4 settings of your choice in the highlighted fields, as shown in the example below. |
Fig 48. Network configuration
Fig 49. System etho network settings
41) Select the appropriate time zone and click on "Next". In the following screen set a "Root" password.
Fig 50. Time settings
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".
Fig 52. Partitioning
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".
Fig 54. Installation type
Fig 55. Starting installation process
...
44) When the installation process is over, click on "Reboot".
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
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.
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.
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.
Fig 60. Adding a Standard Network Adapter
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.
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:
Fig 63. Attempting to bring etho interface up
Note | ||
---|---|---|
| ||
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:
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.
Fig 65. Updated config file
Fig 66. Updated config file is saved
...
- rm /etc/udev/rules.d/70-persistent-net.rules –f
- shutdown –r now
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.
Fig 68. Verifying eth0 proper state and configuration
...
- curl –L –o backupessentials.tar.gz https://github.com/LIS/backupessentials/tarball/1.0
- tar –xvzf backupessentials.tar.gz
Fig 69a. Adding backup essentials to the VM
...
- cd LIS-backupessentials-4e3121f/hv/hv-rhel6.5/rpm/
- chmod +x install.sh
- ./install.sh
- Reboot
Fig 69b. Adding backup essentials to the VM
...
When the "Is this ok" question pops up, type "y" and press Enter.
Fig 70a. Installing KVP
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
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.
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.
Fig 72a. Open WinSCP
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.
Fig 73a. Copying rc.local
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
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
Fig 75a. Upload the disk extend scripts
Fig 75b. Copying the disk extend files to /etc/rc.d/init.d/
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
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
Fig 77a. Adding SCVMM Guest Agent to VM
Fig 77b. SCVMM Guest Agent successfully installed
...
- rm /etc/udev/rules.d/70-persistent-net.rules –f
Fig 78. Clearing network rules
...
65) Shutdown the Virtual Machine by running the following command:
- shutdown –h now
Fig 79. Shutting down VM
...
66) In SCVMM console right click on the CentOS-6.5-for-Template VM and choose Create -> Clone.
Fig 80. Creating a clone VM
...
67) In the Identity tab, Specify machine name for this VM clone and click on "Next".
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
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.
Fig 83. Placing the VM on a host
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.
Fig 85a. Selecting Path
Fig 85b. Selecting Network
Fig 85c. Adding Properties
Fig 85d. Creating VM clone
Fig 85e. Cloning process
...
71) Once the VM clone is created, right-click on it and click on Properties.
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.
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.
Fig 88. Copy VHD file
...
74) Go to VMM, click on Library, then right-click on the Library main folder and click on Explore.
Fig 89. Explore VMM Library
...
75) Select a Library location and paste the VHD file you copied in step 73.
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".
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.
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.
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.
Fig 94. Specifying VM Template name and Generation
80) In the Configure Hardware tab, in Cloud Capability Profile section, check Hyper-V.
Fig 95. Select Cloud Capability Profile
81) Set Memory to at least 1024 MB and click on Next.
Fig 96. Specify VM Template Memory
...
82) In the Configure Operating System tab, 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.
Fig 97. Specify Operating system
...
83) In the Application Configuration tab and in the SQL Server Configuration tab click on Next.
Fig 98. Application Configuration
Fig 99. SQL Server Configuration
...
84) In the Summary tab, click on Create.
Fig 100. Creating a VM Template
...