Cloud OSS - Hyper-V Service Manager | How to Create Guest OS (Linux) Templates in Hyper-V |
---|
...
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
...
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
...
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
...
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.
...
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. |
...
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
...
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):
...
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
...
- 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
...
- 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
...
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
...
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.
...
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.
...