Wednesday, June 3, 2020

Rebooting to Use Logical Domains

You must reboot the control domain for the configuration changes to take effect and for the resources to be released for other logical domains to use.

How to Reboot

  • Shut down and reboot the control domain.
    primary# shutdown -y -g0 -i6

    Note - Either a reboot or power cycle instantiates the new configuration. Only a power cycle actually boots the configuration saved to the service processor (SP), which is then reflected in the list-config output.


How to Set Up the Control Domain


Note - This procedure contains examples of resources to set for your control domain. These numbers are examples only, and the values used might not be appropriate for your control domain.


  1. Determine whether you have cryptographic devices in the control domain.

    Note that only UltraSPARC T2, UltraSPARC T2 Plus, and SPARC T3 platforms have cryptographic devices (MAUs). Because newer platforms, such as SPARC T4 systems and Fujitsu M10 systems, do not have separate cryptographic units, there is no need to assign a cryptographic accelerator on these platforms.

    primary# ldm list -o crypto primary
  2. Assign cryptographic resources to the control domain, if applicable.

    The following example would assign one cryptographic resource to the control domain, primary. This leaves the remainder of the cryptographic resources available to a guest domain.

    primary# ldm set-mau 1 primary
  3. Assign virtual CPUs to the control domain.

    For example, the following command would assign 8 virtual CPUs to the control domain, primary. This leaves the remainder of the virtual CPUs available to a guest domain.

    primary# ldm set-vcpu 8 primary
  4.  

    Initiate a delayed reconfiguration on the control domain.

    primary# ldm start-reconf primary
  5. Assign memory to the control domain.

    For example, the following command would assign 4 gigabytes of memory to the control domain, primary. This leaves the remainder of the memory available to a guest domain.

    primary# ldm set-memory 4G primary
  6. Add a logical domain machine configuration to the service processor (SP).

    For example, the following command would add a configuration called initial.

    primary# ldm add-config initial
  7. Verify that the configuration is ready to be used at the next reboot.
    primary# ldm list-config
    factory-default
    initial [current]

    This ldm list-config command shows that the initial configuration set will be used after you perform a power cycle.

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

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