Wednesday, June 3, 2020

Creating virtual device services to use in the control domain as a service domain

The following virtual device services must be created to use the control domain as a service domain and to create virtual devices for other domains:

  • vcc – Virtual console concentrator service

  • vds – Virtual disk server

  • vsw – Virtual switch service

How to Create Default Services

  1. Create a virtual console concentrator (vcc) service for use by the virtual network terminal server daemon (vntsd) and as a concentrator for all logical domain consoles.

    For example, the following command would add a virtual console concentrator service (primary-vcc0) with a port range from 5000 to 5100 to the control domain (primary).

    primary# ldm add-vcc port-range=5000-5100 primary-vcc0 primary
  2. Create a virtual disk server (vds) to allow importing virtual disks into a logical domain.

    For example, the following command adds a virtual disk server (primary-vds0) to the control domain (primary).

    primary# ldm add-vds primary-vds0 primary
  3. Create a virtual switch service (vsw) to enable networking between virtual network (vnet) devices in logical domains.

    Assign a GLDv3-compliant network adapter to the virtual switch if each logical domain must communicate outside the box through the virtual switch.

    • In Oracle Solaris 10, add a virtual switch service on network adapter driver to the control domain.

      primary# ldm add-vsw net-dev=net-driver vsw-service primary

      For example, the following command adds a virtual switch service (primary-vsw0) on network adapter driver nxge0 to the control domain (primary):

      primary# ldm add-vsw net-dev=nxge0 primary-vsw0 primary
    • In Oracle Solaris 11, add a virtual switch service (primary-vsw0) on network adapter driver net0 to the control domain (primary):

      primary# ldm add-vsw net-dev=net-driver vsw-service primary

      For example, the following command adds a virtual switch service (primary-vsw0) on network adapter driver net0 to the control domain (primary):

      primary# ldm add-vsw net-dev=net0 primary-vsw0 primary
    • The following applies to the Oracle Solaris 10 OS only and should not be performed on an Oracle Solaris 11 system.

      This command automatically allocates a MAC address to the virtual switch. You can specify your own MAC address as an option to the ldm add-vsw command. However, in that case, it is your responsibility to ensure that the MAC address specified does not conflict with an already existing MAC address.

      If the virtual switch being added replaces the underlying physical adapter as the primary network interface, it must be assigned the MAC address of the physical adapter, so that the Dynamic Host Configuration Protocol (DHCP) server assigns the domain the same IP address. See Enabling Networking Between the Control/Service Domain and Other Domains.

      primary# ldm add-vsw mac-addr=2:04:4f:fb:9f:0d net-dev=nxge0 primary-vsw0 primary
  4. Verify the services have been created by using the list-services subcommand.

    Your output should look similar to the following:

    primary# ldm list-services primary
    VDS
        NAME VOLUME OPTIONS DEVICE
        primary-vds0
     
    VCC
        NAME PORT-RANGE
        primary-vcc0 5000-5100
     
    VSW
        NAME MAC NET-DEV DEVICE MODE
        primary-vsw0 02:04:4f:fb:9f:0d nxge0 switch@0 prog,promisc

How to Restore the Factory Default Configuration From the Service Processor

If you remove the Logical Domains Manager before restoring the factory default configuration, you can restore the factory default configuration from the service processor.

  1. Restore the factory default configuration from the service processor.
    -> set /HOST/bootmode config=factory-default
  2. Perform a power cycle of the system to load the factory default configuration.
    -> reset /SYS



How to Remove the Logical Domains Manager

After restoring the factory default configuration and disabling the Logical Domains Manager, you can remove the Logical Domains Manager software.


Note - If you remove the Logical Domains Manager before restoring the factory default configuration, you can restore the factory default configuration from the service processor as shown in the following procedure.


  • Remove the Logical Domains Manager software.
    • Remove the Oracle Solaris 10 SUNWldm and SUNWldmp2v packages.
      primary# pkgrm SUNWldm SUNWldmp2v
    • Remove the Oracle Solaris 11 ldomsmanager package.
      primary# pkg uninstall ldomsmanager

Factory Default Configuration and Disabling Logical Domains

How to Remove All Guest Domains

  1. Stop all domains by using the -a option.
    primary# ldm stop-domain -a
  2. Unbind all domains except for the primary domain.
    primary# ldm unbind-domain ldom

    Note - You might be unable to unbind an I/O domain if it is providing services required by the control domain. In this situation, skip this step.


  3. Destroy all domains except for the primary domain.
    primary# ldm remove-domain -a

How to Remove All Logical Domains Configurations

  1. List all the logical domain configurations that are stored on the service processor (SP).
    primary# ldm list-config
  2. Remove all configurations (config-name) previously saved to the SP except for the factory-default configuration.

    Use the following command for each such configuration:

    primary# ldm rm-config config-name

    After you remove all the configurations previously saved to the SP, the factory-default domain is the next domain to use when the control domain (primary) is rebooted.

How to Restore the Factory Default Configuration

  1. Select the factory default configuration.
    primary# ldm set-config factory-default
  2. Stop the control domain.
    primary# shutdown -i1 -g0 -y
  3. Perform a power cycle of the system to load the factory default configuration.
    -> stop /SYS
    -> start /SYS

How to Disable the Logical Domains Manager

  • Disable the Logical Domains Manager from the control domain.
    primary# svcadm disable ldmd

    Note - Disabling the Logical Domains Manager does not stop any running domains, but does disable the ability to create a new domains, change the configuration of existing domains, or monitor the state of the domains.


How to Enable the Logical Domains Manager Daemon

Use this procedure to enable the ldmd daemon if it has been disabled.

  1. Use the svcadm command to enable the Logical Domains Manager daemon, ldmd.

    For more information about the svcadm command, see the svcadm(1M) man page.

    # svcadm enable ldmd
  2. Use the ldm list command to verify that the Logical Domains Manager is running.

    The ldm list command should list all domains that are currently defined on the system. In particular, the primary domain should be listed and be in the active state. The following sample output shows that only the primary domain is defined on the system.

    # /opt/SUNWldm/bin/ldm list
    NAME             STATE    FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
    primary          active   ---c-   SP      64    3264M    0.3%  19d 9m

Installing Oracle VM Server for SPARC Software on a New System

SPARC platforms that support the Oracle VM Server for SPARC software come preinstalled with the Oracle Solaris 10 OS or the Oracle Solaris 11 OS. Initially, the platform appears as a single system hosting only one operating system. After the Oracle Solaris OS, system firmware, and Logical Domains Manager have been installed, the original system and instance of the Oracle Solaris OS become the control domain. That first domain of the platform is named primary, and you cannot change that name or destroy that domain. From there, the platform can be reconfigured to have multiple domains hosting different instances of the Oracle Solaris OS.

Downloading the Logical Domains Manager

You can obtain the latest packages for both the Oracle Solaris 10 OS and the Oracle Solaris 11 OS. Note that the Oracle VM Server for SPARC software is included by default with the Oracle Solaris 11 OS.

How to Download the Logical Domains Manager Software (Oracle Solaris 10)

  1. Download the zip file (OVM_Server_SPARC-3_0.zip).

    You can find the software at http://www.oracle.com/virtualization/index.html.

  2. Unzip the zip file.
    $ unzip OVM_Server_SPARC-3_0.zip
Automatically Installing the Logical Domains Manager Software

If you use the install-ldm installation script, you have several choices to specify how you want the script to run. Each choice is described in the procedures that follow.

  • Using the install-ldm script with no options does the following automatically:

    • Checks that the Oracle Solaris OS release is the Oracle Solaris 10 OS

    • Verifies that the package subdirectories SUNWldm/ and SUNWldmp2v/ are present

    • Verifies that the prerequisite Logical Domains driver packages, SUNWldomr and SUNWldomu, are present

    • Verifies that the SUNWldm and SUNWldmp2v packages have not been installed

    • Installs the Oracle VM Server for SPARC 3.0 software

    • Verifies that all packages are installed

    • If the SST (SUNWjass) is already installed, you are prompted to harden the Oracle Solaris OS on the control domain.

    • Determine whether to use the Oracle VM Server for SPARC Configuration Assistant (ldmconfig) to perform the installation.

  • Using the install-ldm script with the -c option automatically runs the Oracle VM Server for SPARC Configuration Assistant after the software is installed.

  • Using the install-ldm script with the -s option skips the running of the Oracle VM Server for SPARC Configuration Assistant.

  • Using the install-ldm script and the following options with the SST software enables you to do the following:

    • install-ldm -d. Allows you to specify a SST driver other than a driver ending with -secure.driver. This option automatically performs all the functions listed in the preceding choice and hardens the Oracle Solaris OS on the control domain with the SST customized driver that you specify; for example, the server-secure-myname.driver.

    • install-ldm -d none. Specifies that you do not want to harden the Oracle Solaris OS running on your control domain by using the SST. This option automatically performs all the functions except hardening listed in the preceding choices. Bypassing the use of the SST is not suggested and should only be done when you intend to harden your control domain using an alternate process.

    • install-ldm -p. Specifies that you only want to perform the post-installation actions of enabling the Logical Domains Manager daemon (ldmd) and running the SST. For example, you would use this option if the SUNWldm and SUNWjass packages are preinstalled on your server.

Manually Installing the Logical Domains Manager Software

The following procedure guides you through manually installing the Oracle VM Server for SPARC 3.0 software on the Oracle Solaris 10 OS.

When you install the Oracle Solaris 11 OS, the Oracle VM Server for SPARC 2.1 software is installed by default. If you want to install the Oracle VM Server for SPARC 3.0 software, see How to Upgrade to the Oracle VM Server for SPARC 3.0 Software (Oracle Solaris 11)

ownload the Oracle VM Server for SPARC 3.0 software (the SUNWldm and SUNWldmp2v packages). For instructions, see How to Download the Logical Domains Manager Software (Oracle Solaris 10).

  1. (Optional) Save your configuration to the service processor (SP), if necessary.

    Perform this step only is you are already running an earlier version of the Oracle VM Server for SPARC software.

    primary# ldm add-config config-name
  2. Install the SUNWldm.v and SUNWldmp2v packages.
    # pkgadd -Gd . SUNWldm.v SUNWldmp2v

    Answer y for yes to all questions in the interactive prompts.

    The -G option installs the package in the global zone only. The -d option specifies the path to the directory that contains the SUNWldm.vand SUNWldmp2v packages.

    For more information about the pkgadd command, see the pkgadd(1M) man page.

  3. Verify that the SUNWldm and SUNWldmp2v packages are installed.

    The following revision (REV) information is an example:

    # pkginfo -l SUNWldm | grep VERSION
    VERSION=3.0,REV=2012.11.01.10.20

    For more information about the pkginfo command, see the pkginfo(1) man page.


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.


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...