Monday, March 2, 2020

How To Access Guest Console In OVM 3 Using VNC Without Using OVM Manager


Earlier releases of OVM (2.x) documented manual configuration to enable access to virtual machine consoles through VNC without using the OVM 2.x manager:

E.3 Guest Console Access
However, such configuration is not possible with Oracle VM 3.


With OVM3 this is achieved by redirecting the remote port to a local port using the ssh(1) command.
To do this, first find the id of the vm (this can be done in the Manager UI by expanding the entry for the vm, or using the "list vm" command in the CLI).

Then on the OVM Server ("ovs", aka "dom0") the vm is running on, issue the xm list command to find its ID, e.g.:
# xm list

Name                             ID Mem VCPUs State  Time(s)
0004fb00000600005454e1ab286913be 2  4096    2 -b---- 424.6
Domain-0                         0  840     8 r----- 478278.2

In this example the ID is 2.

Then find the port the vm console is listening on:
# xm list -l 2 | grep 59
(uuid 3c787270-abad-9595-8258-d27f03fd928d)
(location 127.0.0.1:5900)

In this example the vnc port for the vm is 5900.

On the system where you wish to display the console, open an ssh session to the ovm server and redirect the port to it, e.g.:
$ ssh -L 12345:localhost:5900 root@olvm-ovs00009

The "5900" port on the ovs will be redirected to port "12345" of your local desktop.

Leave this session open for the duration of the vnc session.

Then vncviewer can be used to open the vm console, e.g. from another terminal issue:
$ vncviewer localhost:12345

 On a Windows system, you can use some other SSH client, e.g. PuTTY for the re-direct.


How To Regenerate The Oracle VM Manager 3.3.x/3.4.x DB



To regenerate the Oracle VM database you'll need to have access to the /u01/app/oracle/ovm-manager-3/.configfile.  This file has the parameters of your database that will be used for the regeneration. 

For Oracle VM 3.4. x release, please consider restoring a valid backup before regenerating the database.

The process for Regenerating your database should be:
  1.      Stop the ovm services
  2.      Delete the Manager Data Base   The ovm_upgrade.sh command is used to delete the current Oracle VM database.
  3.      Generate new certificates.
  4.      Start the services
  5.      Restart the ovm service for the certificate to be applied
  6.      Repopulate the DB by discovering and refreshing the repositories
  7.      To restore the simple names  Use KM article: Restore OVM Manager "Simple Names" After a Rebuild/Reinstall (Doc ID 2129616.1)
Note: Anything in <> should be replaced with the value appropriate to your environment or filename.
1. The Oracle VM manager services need to be shutdown, to delete the OVM manager database.
#service ovmm stop

2. Delete the current OVM database.  

(Use the dbuser and password, not the ovm admin user/passowrd.)
Using ovm_upgrade.sh from /u01/app/oracle/ovm-manager-3/ovm_upgrade/binand the values from the /u01/app/oracle/ovm-manager-3/.configfile, delete the bad database
Command syntax:
# sh ovm_upgrade.sh --deletedb --dbuser=<user> --dbpass=<password> --dbhost=localhost --dbport=<database-port> --dbsid=<your sid>

Obtain the values to substitute from the /u01/app/oracle/ovm-manager-3/.config on a management node:
# cat /u01/app/oracle/ovm-manager-3/.config
DBTYPE=MySQL
DBHOST=localhost
SID=ovs             < --dbsid
LSNR=1521           < --dbport
OVSSCHEMA=ovs       < --dbuser
APEX=8080
WLSADMIN=weblogic
OVSADMIN=admin
COREPORT=54321
UUID=0004fb00000100009bfa6a96c1303e32
BUILDID=3.2.11.775
default "--dbpass" is "Welcome1" - use appropriate value for your system.
 Sample delete command based on the above sample .config file: 
#sh /u01/app/oracle/ovm-manager-3/ovm_upgrade/bin/ovm_upgrade.sh --deletedb --dbuser=ovs --dbpass=Welcome1
--dbhost=localhost --dbport=1521 --dbsid=ovs 

  3. Start the OVM services and Generate  the replacement certificate

#service ovmm start
#export MW_HOME=/u01/app/oracle/Middleware
#/u01/app/oracle/ovm-manager-3/ovm_upgrade/bin/ovmkeytool.sh setupWebLogic

4. Activate the new certificate.


#sh /u01/app/oracle/ovm-manager-3/bin/configure_client_cert_login.sh

Stop then start the OVM service apply the new certificate.

#service ovmm stop
#service ovmm start

5. Repopulate the database

1) Login, the UI should be EMPTY of  any data. The OVM servers and VMs are still up and running, the poolFS and repos already exist

2) Repopulate the database by Rediscovering the environment using the Oracle OVM Manager UI.
The OVM database is rebuilt from the existing servers in the pool, so the relationships will already be established.  The Servers and VMs are up and running, the pool filesystem the storage repositories are on the servers.
a. Discover Server(s) -> Pool/OVM Server(s) will be visible again
        If your storage is network based, validate that your servers are listed under the storage tab.
        If not "Discover server" and enter the name and IP of the storage array.


b. Refresh Repository (right click each storage, and choose refresh

c. Rediscover Server(s) -> VM's will reappear under the OVM Server(s). Non running VM's can be found under "Unassigned Virtual Machines"

Note: NFS  and iSCSI repositories need to be re-discovered independently after "re-discover Oracle VM Servers" and "refresh-all on Server Pools",
because occasionally NFS repositories can not be re-discovered, and the regeneration does not recover iSCSI storage.

d. if one need more VNICS, Run VNIC Manager to recreate a range of MAC addresses, because only the MAC addresses in use will have been rediscovered

6.  Restore the simple names
This Database will be populated, but you will be missing items such as friendly disk names, display names for Vdisk, Vnics etc. (meta data)

Please refer to KM article: Restore OVM Manager "Simple Names" After a Rebuild/Reinstall (Doc ID 2129616.1)   to restore the friendly names. 

After the friendly names have been restored,  
Logout, and close the browser.
Open a browser, and login.

The data base should be up and working with the friendly names (meta data) 


Configure Secure TCP for Oracle VM Manager




The configuration of the TCPS service requires a certain amount of understanding about keystores and certificates. It is similar to the HTTPS configuration of Weblogic, so if you are involved in setting up overall Oracle VM security, this will be straightforward.

It's preferred to use the bundled scripts to create keystore and enable TCPS service for Oracle VM Manager.

Using Bundled Scripts
When you perform a fresh install of Oracle VM Manager 3.1.1, 3.2.x or 3.3.x, scripts are provided under /u01/app/oracle/ovm-manager-3/bin of the Oracle VM Manager server
·         secureOvmmTcpGenKeyStore.sh: create the keystore
·         secureOvmmTcp.sh: use the generated keystore to enable the TCPS service for Oracle VM Manager

For Oracle VM Manager 3.2.x and 3.3.x, the scripts are included as part of the default installation.
For detailed instructions how to use the scripts, please refer to the documentation:
After you follow the instructions to create keystore and enable TCPS service for Oracle VM Manager. Once Oracle VM Manager is restarted, you can verify the status to confirm that Oracle VM Manager is now listening for TCPS requests on port 54322 by default.

# netstat -a | grep  54322
tcp       0     0*:54322                    *:*                         LISTEN

Additional Resources
For more information, see the following links:



How to Create Virtual Disk without Oracle VM Manager




In some situations, it may be necessary to know how to create a Virtual Disk on OVM 2.2 without using OVM Manager, and attach it to a Virtual Machine.

This can be done in OVM 2.2 via the following process:

1. Log into the Oracle VM server where the VM is running.

2. Change the directory at which the repository is mounted, e.g.:
# cd /to/path/to/repo

3. Create the raw format .img disk image, e.g. initiating 4 GB Virtual Disk:
# dd if=/dev/zero of=newdisk.img bs=1M count=4096

4. Then add new disk image to disk = [ ] section of vm.cfg file of a Virtual Machine. Format:
disk = [ 'file:/mnt/el4u5_64_hvm//system.img,hda,w' ]

Note: Making any change to vm.cfg file effective requires a domain re-creation which is Virtual Machine shutdown then start (NOT restart.)

5. If an outage on the Virtual Machine is not possible, then hot plug read/write as /dev/xvdX by:
# xm block-attach [domain ID] /path/to/image /dev/xvdX w


To increase Virtual Machine Memory in the OVM Manager GUI ?




To increase Virtual Machine Memory in the OVM Manager GUI, Please follow the following steps 


1. Using Oracle VM Manager GUI:

2. Login to Oracle VM Manager (GUI).

3. Select the VM and click on edit.

4. Check the assigned "Max. Memory (MB):" and "Memory (MB):".

5. If the "Max. Memory (MB):" is the same as "Memory (MB):", then you have to shut down the VM to increase the "Max. Memory (MB):" and "Memory (MB):".

6. If the "Max. Memory (MB):" is higher than the "Memory (MB):", then you can increase the "Memory (MB):" till "Max. Memory (MB):".

7. Ensure the "Memory (MB):" should not be higher than "Max. Memory (MB):"

8. Click on Save.

Login to the VM and verify allocated memory. 

Memory allocated to the VM can be check by Oracle VM Manager either by going to the Server and 
VM tab or by going to Health tab in GUI  then selecting Server and VM statistics. 

How to Inject ESX 5.2.1 Host Drivers into VMware ESXi 5.0U1 Media


The procedure for PXE Booting or SAN Booting an ESXi 5.0U1 host is the same as for an ESXi 4.0 host, with the exception of creating the injecting the host drivers into the ESXi 5.0U1 bundle. The following text documents how to inject the host drivers. Use the following text instead of the text for the remaster-iso script in the XgOS Remote Booting Guide.
After completing the following procedure, you can use the SAN Boot procedure for ESXi 4.0 hosts document to configure the ESXi 5.0U1 host for SAN Booting.
 
Considerations:
Be aware of the following:
• Creating the custom ISO is accomplished through Microsoft Windows PowerShell—and specifically the VMware vSphere PowerCLI plug-in for PowerShell. The Windows server will need this tool installed
• Creating the custom ISO is supported on a Windows host server only. The server requirements are determined by the PowerShell application
• You use a pre-configured ESXi bundle as a baseline, then inject the Xsigo/Oracle bits into it. The OS file is available on the VMware website: update-from-esxi5.0-5.0_update01.zip
• You will need full administrative rights on the Windows server where you will be creating the custom ISO

Manually Injecting the Host Drivers into the ESXi 5.0U1 Bundle.

The following procedure assumes the working directory is: \images\New for the user “adminA”.
 
To inject the host drivers into the ESXi 5.0U1 bundle, follow this procedure:

Step 1 Install PowerShell on the Windows server if you have not done so already.

Step 2 Install the PowerCLI plug-in if you have not done so already.

Step 3 Download the update-from-esxi5.0-5.0_update01.zip file to the Windows server.

Step 4 Start PowerCLI.

Step 5 In PowerCLI, run the following commands to import the ESXi 5.0 bundle and the host drivers into PowerCLI:
 
Add-EsxSoftwareDepot -DepotUrl C:\<file directory>\update-from-esxi5.0-5.0_update01.zip
Add-EsxSoftwareDepot -DepotUrl C:\<file directory>\xsigo_5.2.1.ESX.1-1vmw.500.0.0.472560.zip


Step 6 Run the following command to specify the profile that you want to use when creating the output ISO:

New-EsxImageProfile -CloneProfile ESXi-5.0.0-20120302001-standard -Name ESXi-5.0.0-20120302001-standard-xsigo
Step 7 Run the following commands to add the IB stack and other dependencies to the depot:

Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-ib-core
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-mlx4-core
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-ib-mad
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-ib-sa
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-mlx4-ib
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-xscore
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-xsvnic
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage net-xve
Add-EsxSoftwarePackage -ImageProfile <profile name> -SoftwarePackage scsi-xsvhba

Step 8 Run the following commands to create single output ISO containing all required files from the depot. The following example assumes unsigned drivers to provide the most complete example:
 
Export-EsxImageProfile -ImageProfile ESXi-5.0.0-20120302001-standard-xsigo -ExportToIso -FilePath C:\<file directory>\ESXi-5.0U1-623860.xsigo-5.2.1.iso

NoSignatureCheck
Supported Host Drivers

This section documents information about the supported ESX host drivers and how to obtain them.
 
Downloading Supported Drivers

You need access to the support site to download the drivers. To get the drivers:
Step 1 Log in to the download portal (http://www.oracle.com/technetwork/server-storage/xsigo-1870185.html).
Step 2 Navigate to the binaries and download them.
VMware ESXi 5.0 Host Drivers

For this release, host drivers for VMware ESXi Server 5.0U1 are: update-from-esxi5.0-5.0_update01.zip
 
Both the InfiniBand and host drivers are contained in this bundle, which is a new packaging method for distributing Xsigo/Oracle host drivers. Due to this new packaging method, the method for installing the host drivers has changed. See: Installing 5.0.0-ESX Host Drivers Directly from the ESXi 5.0 Bundle


How to Collect Diagnostic Data From VMware ESX/ESXi and VirtualCenter Server


There are a couple of methods for collecting diagnostic data from VMware ESX/ESXi Servers / VirtualCenter Server.


A) One method is to login as root to the ESX/ESXi Server Service Console command line as user 'root'. In the /root directory run the command vm-support. This will generate a tarball named something similar to:

esx-2008-month-day--hour.min.<PID>.tgz.

There are other flags and switches you may use with the vm-support command to generate:

1) Performance snapshots
2) Gather Virtual Machine specific debugging
3) Suspend Virtual Machine to generate VM core files and include VM memory state with vm-support output.

For complete information on the command line options you can run with vm-support see the manpage for vm-support on your ESX/ESXi Server.

B) Second method is from within the VI Client connecting directly to the host go to File - Export - Export Diagnostic Data.

C) Third method using the VI Client to connect directly to the VirtualCenter Server managing multiple ESX Server hosts - go to the Administration pull down menu - Export Diagnostic Data - Select ESX hosts and make sure box is checked to "Include information from VirtualCenter Server and VI Client".

Choose where on the Windows Server hosting your VirtualCenter Server to store the diagnostic data. This method not only collects VirtualCenter Server specific information but also generates and collects the vm-support output for the ESX Server hosts you select.

You want to use the VirtualCenter method to generate and collect diagnostic data if:

1) Problem is VMotion, Migration related
2) Problem is related to creating or deploying templates or clones
3) Problem affects more than one ESX host
4) Problem is VirtualCenter Server related, for example VC Server performance reporting
5) Problem is related to VirtualCenter Server Plugins / Addons such as HA, DRS, VCB, Update Manager, Capacity Planner, VMware Converter etc...
6) Problems using the Snapshot Manager

How to Find ESXi 5.x Host Driver Version Installed


There are multiple ways to accomplish this. 

First is by logging into the Fabric Director as user 'admin' and running the 'show physical-servers' command:
perf01  2c9030005f7d4  cslab-rum01:ServerPort19  VMware/ESX5.2.0.EAX1C.1/x86_64   2.7.0/3.0.0  perf01-rum

Another way is to login to the ESXi 5.0 host as user 'root' and executing this command:

# esxcli software vib list |grep xsvnic, xsigo, xsvhba or xscore

In the ESXi 5.x vm-support or xsigo-support logs go to the 'commands' folder:

-bash-3.2$ ls
action.log  bootbank  commands  error.log  errors-ignored.log  etc  json  proc  README  reconstruction  reconstruct.sh  usr  var  vmfs

In the 'commands' directory grep the 'localcli_software-vib-get.txt' file for xsvnic or xsvhba:

-bash-3.2$ grep -i xsvnic localcli_software-vib-get.txt
VMware_bootbank_net-xsvnic_5.0.2.ESX.1-1vmw.500.0.0.406165:
   Name: net-xsvnic
   Summary: xsvnic: net driver for VMware ESX
   Provides: com.xsigo.xsvnic-9.2.0.0

Question 8 Explanation

Compartments are the primary building blocks you use to organize your cloud resources. You use compartments to organize and isolate your res...