Thursday, 2 January 2014

ORACLE VMSERVER 3.X BASICS

1)How to Enable the Logical Domains Manager Daemon
# svcadm enable ldmd
# /opt/SUNWldm/bin/ldm list

2)Upgrading a System That Is Already Using Oracle VM Server for SPARC
  1)Upgrade the system with the required system firmware.
   2)Apply the required Oracle Solaris 10 OS patches or Oracle Solaris 11 OS SRU.
  3)Save the configurations to the SP

3)Saving and Restoring Autosave Configuration Directories
1) Save the autosave directories
# cd /
# tar -cvpf autosave.tar var/opt/SUNWldm/autosave-*
2)to restore
/var/opt/SUNWldm
# tar -xvpf autosave.tar
4)Saving and Restoring the Logical Domains Constraints Database File
Whenever you upgrade the operating system on the control domain, you must save and restore the /var/opt/SUNWldm/ldom-db.xml Logical Domains constraints database file.
5)Upgrading the Logical Domains Manager and the System Firmware
1)Stop all domains
primary# ldm stop-domain -a
2) Issue the unbind-domain subcommand from the control domain for each domain.
primary# ldm unbind-domain ldom
6)How to Upgrade to the Oracle VM Server for SPARC 3.1 Software (Oracle Solaris 11)
Save your configuration to the SP.
# ldm add-config config-name
Create a snapshot of your existing BE
# beadm create snapshot-name
Create a backup BE based on the snapshot.
# beadm create -e snapshot-name BE-name
Install the Oracle VM Server for SPARC 3.1 version of the ldomsmanager package from the online software repository as part of an update to the latest SRU
# pkg update
Verify that the package is installed.
# pkg info ldomsmanager
Restart the ldmd service.
#svcadm restart ldmd
Verify that you are running the correct ldm version.
# ldm -V
Save your configuration to the SP
#ldm add-config ldoms-3.1-config
7)How to Remove All Guest Domains
Stop all domains
primary# ldm stop-domain -a
Unbind all domains except for the primary domain.
primary# ldm unbind-domain ldom
8)Destroy all domains except for the primary domain.
#ldm remove-domain -a
9)How to Restore the Factory Default Configuration
primary# ldm set-config factory-default
primary# shutdown -i5 -g0 -y
-> stop /SYS
-> start /SYS

10)How to Disable the Logical Domains Manager
primary# svcadm disable ldmd
11)How to Remove the Logical Domains Manager
primary# pkgrm SUNWldm SUNWldmp2v (SOLARIS 10)
primary# pkg uninstall ldomsmanager (SOLARIS11)
12)How to Restore the Factory Default Configuration From the Service Processor
-> set /HOST/bootmode config=factory-default
-> reset /SYS
13)Log information Stores:-
/var/log/vntsd/<<domainname>>/console-log
14)How to Enable or Disable Console Logging
primary# ldm list -o console domain
primary# ldm stop domain
primary# ldm unbind domain
primary# ldm set-vcons log=on domain
primary# ldm set-vcons log=off domain
15)Creating Default Services:-
vcc – Virtual console concentrator service
vds – Virtual disk server
vsw – Virtual switch service
primary# ldm add-vcc port-range=5000-5100 primary-vcc0 primary
primary# ldm add-vds primary-vds0 primary
in solaris 10:-
primary# ldm add-vsw net-dev=nxge0 primary-vsw0 primary
(in solaris 10 we can assign only vsw switch to guest domain)
in solaris 11:-
primary# ldm add-vsw net-dev=net0 primary-vsw0 primary
(in solaris 11 we can assign vsw switch to guest domain is optional)
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

16)How to setup Control domain:-
only UltraSPARC T2, UltraSPARC T2 Plus, and SPARC T3 platforms have cryptographic devices (MAUs).
primary# ldm list -o crypto primary
primary# ldm set-mau 1 primary
newer platforms such as SPARC T4 systems and Fujitsu M10 systems do not have separate cryptographic units
primary# ldm set-vcpu 8 primary
primary# ldm start-reconf primary
primary# ldm set-memory 4G primary
primary# ldm add-config initial
primary# ldm list-config
factory-default
initial [current]

17)How to Enable the Virtual Network Terminal Server Daemon
primary# svcadm enable vntsd
primary# svcs vntsd
STATE          STIME    FMRI
online         Oct_08   svc:/ldoms/vntsd:default
18)How to Create and Start a Guest Domain:-
primary# ldm add-domain ldg1
primary# ldm add-vcpu 8 ldg1
[ OR ]
primary# ldm add-core 2 ldg1
primary# ldm add-memory 2G ldg1
primary# ldm add-vnet vnet1 primary-vsw0 ldg1
primary# ldm add-vdsdev /dev/dsk/c2t1d0s2 vol1@primary-vds0
primary# ldm add-vdisk vdisk1 vol1@primary-vds0 ldg1
primary# ldm set-var auto-boot\?=true ldg1
primary# ldm set-var boot-device=vdisk1 ldg1
primary# ldm bind-domain ldg1
primary# ldm list-domain ldg1
NAME          STATE    FLAGS  CONS   VCPU MEMORY   UTIL  UPTIME
ldg1          bound    -----  5000   8    2G
primary# ldm set-var boot-device=vdisk1 ldg1
primary# ldm bind-domain ldg1
primary# ldm list-domain ldg1
NAME          STATE    FLAGS  CONS   VCPU MEMORY   UTIL  UPTIME
ldg1          bound    -----  5000   8    2G
#ldm start-domain ldg1
#telnet localhost 5000
19) How to Install the Oracle Solaris OS on a Guest Domain From a DVD:-
primary# svcadm disable volfs
primary# ldm stop ldg1
primary# ldm unbind ldg1
primary# ldm add-vdsdev options=ro /dev/dsk/c0t0d0s2 dvd_vol@primary-vds0
primary# ldm add-vdisk vdisk_cd_media dvd_vol@primary-vds0 ldg1
primary# ldm bind ldg1
primary# ldm start ldg1
20)How to Install the Oracle Solaris OS on a Guest Domain From an Oracle Solaris ISO File
primary# ldm stop ldg1
primary# ldm unbind ldg1
primary# ldm add-vdsdev /export/solarisdvd.iso  iso_vol@primary-vds0
primary# ldm add-vdisk vdisk_iso iso_vol@primary-vds0 ldg1
primary# ldm bind ldg1
primary# ldm start ldg1
primary# telnet localhost 5000
21)How to Create an I/O Domain by Assigning a PCIe Bus
primary# ldm list-io
NAME                                      TYPE   BUS      DOMAIN   STATUS
----                                      ----   ---      ------   ------
pci_0                                     BUS    pci_0    primary
pci_1                                     BUS    pci_1    primary
pci_2                                     BUS    pci_2    primary
pci_3                                     BUS    pci_3    primary
/SYS/MB/PCIE1                             PCIE   pci_0    primary  EMP
/SYS/MB/SASHBA0                           PCIE   pci_0    primary  OCC
/SYS/MB/NET0                              PCIE   pci_0    primary  OCC
/SYS/MB/PCIE5                             PCIE   pci_1    primary  EMP
/SYS/MB/PCIE6                             PCIE   pci_1    primary  EMP
/SYS/MB/PCIE7                             PCIE   pci_1    primary  EMP
/SYS/MB/PCIE2                             PCIE   pci_2    primary  EMP
/SYS/MB/PCIE3                             PCIE   pci_2    primary  EMP
/SYS/MB/PCIE4                             PCIE   pci_2    primary  EMP
/SYS/MB/PCIE8                             PCIE   pci_3    primary  EMP
/SYS/MB/SASHBA1                           PCIE   pci_3    primary  OCC
/SYS/MB/NET2                              PCIE   pci_3    primary  OCC
/SYS/MB/NET0/IOVNET.PF0                   PF     pci_0    primary
/SYS/MB/NET0/IOVNET.PF1                   PF     pci_0    primary
/SYS/MB/NET2/IOVNET.PF0                   PF     pci_3    primary
/SYS/MB/NET2/IOVNET.PF1                   PF     pci_3    primary
primary# ldm start-reconf primary
primary# ldm remove-io pci_2 primary
primary# ldm add-config io-domain
primary# ldm stop ldg1
primary# ldm add-io pci_2 ldg1
primary# ldm start ldg1
primary# ldm list-io
NAME                                      TYPE   BUS      DOMAIN   STATUS
----                                      ----   ---      ------   ------
pci_0                                     BUS    pci_0    primary
pci_1                                     BUS    pci_1    primary
pci_2                                     BUS    pci_2    ldg1
pci_3                                     BUS    pci_3    primary
/SYS/MB/PCIE1                             PCIE   pci_0    primary  EMP
/SYS/MB/SASHBA0                           PCIE   pci_0    primary  OCC
/SYS/MB/NET0                              PCIE   pci_0    primary  OCC
/SYS/MB/PCIE5                             PCIE   pci_1    primary  EMP
/SYS/MB/PCIE6                             PCIE   pci_1    primary  EMP
/SYS/MB/PCIE7                             PCIE   pci_1    primary  EMP
/SYS/MB/PCIE2                             PCIE   pci_2    ldg1     EMP
/SYS/MB/PCIE3                             PCIE   pci_2    ldg1     EMP
/SYS/MB/PCIE4                             PCIE   pci_2    ldg1     EMP
/SYS/MB/PCIE8                             PCIE   pci_3    primary  EMP
/SYS/MB/SASHBA1                           PCIE   pci_3    primary  OCC
/SYS/MB/NET2                              PCIE   pci_3    primary  OCC
/SYS/MB/NET0/IOVNET.PF0                   PF     pci_0    primary
/SYS/MB/NET0/IOVNET.PF1                   PF     pci_0    primary
/SYS/MB/NET2/IOVNET.PF0                   PF     pci_3    primary /SYS/MB/NET2/IOVNET.PF1                   PF     pci_3    primary
22)How to Create an I/O Domain by Assigning a PCIe Endpoint Device :-
Identify and archive the devices that are currently installed on the system
# ldm list-io -l
# ldm start-reconf primary
primary# ldm remove-io /SYS/MB/PCIE1 primary
primary# ldm remove-io /SYS/MB/PCIE3 primary
primary# ldm remove-io /SYS/MB/PCIE5 primary
# ldm add-config dio
# shutdown -i6 -g0 -y
# ldm list-io
# ldm add-io /SYS/MB/PCIE3  ldg1
# ldm bind ldg1
# ldm start ldg1
LDom ldg1 started
# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             unknown    0      unknown   nxge0
net1              Ethernet             unknown    0      unknown   nxge1
net2              Ethernet             unknown    0      unknown   nxge2
net3              Ethernet             unknown    0      unknown   nxge3


23) Virtual Disk Assignment to Guest Domain:-
1)    Form File
2)    From slice
3)    From entire disk
4)    From Zvols (or) SVM vols (or) veritas volumes.
VDISK TYPE
ZFS
Veritas
VTOC
Noof Slices usable
Dynamic Space allocation
File
y
N
y
7
y
slice
y
N
N
1
y
Entire Disk
y
y
y
7
N
Zvols
y
N
y
7
y




24) How to Add a Virtual Disk
1)Export the virtual disk back end from a service domain
# ldm add-vdsdev [-fq] [options={ro,slice,excl}] [mpgroup=mpgroup] \
backend volume-name@service-name

2) Assign the back end to a guest domain
# ldm add-vdisk [timeout=seconds] [id=disk-id] disk-name volume-name@service-name ldom

25) How to Export a Virtual Disk Back End Multiple Times

1)Export the virtual disk back end two times from a service domain.
# ldm add-vdsdev [options={ro,slice}] backend volume1@service-name
# ldm add-vdsdev -f [options={ro,slice}] backend volume2@service-name
Note that the second ldm add-vdsdev command uses the –f option to force the second export of the back end.
Use this option when using the same back-end path for both commands and when the virtual disk servers are located on the same service domain.
2)Assign the exported back end to each guest domain.
The disk-name can be different for ldom1 and ldom2.
# ldm add-vdisk [timeout=seconds] disk-name volume1@service-name ldom1
# ldm add-vdisk [timeout=seconds] disk-name volume2@service-name ldom2

26)How to Change Virtual Disk Options online
# ldm set-vdsdev options=[{ro,slice,excl}] volume-name@service-name
27) How to Change the Timeout Option
# ldm set-vdisk timeout=seconds disk-name ldom
28)How to Remove a Virtual Disk
1.Remove a virtual disk from a guest domain.
# ldm rm-vdisk disk-name ldom
2.Stop exporting the corresponding back end from the service domain.
# ldm rm-vdsdev volume-name@service-name
29)How to Export a Physical Disk Slice as a Virtual Disk
primary# ldm add-vdsdev /dev/dsk/c1t57d0s0 c1t57d0s0@primary-vds0
primary# ldm add-vdisk pslice c1t57d0s0@primary-vds0 ldg1
ldg1# ls -1 /dev/dsk/c0d13s*
/dev/dsk/c0d13s0
/dev/dsk/c0d13s1
/dev/dsk/c0d13s2
/dev/dsk/c0d13s3
/dev/dsk/c0d13s4
/dev/dsk/c0d13s5
/dev/dsk/c0d13s6
/dev/dsk/c0d13s7
Although there are eight devices, because the disk is a single-slice disk, only the first slice (s0) is usable
To export slice 2 (disk c1t57d0s2, for example) you must specify the slice option. Otherwise, the entire disk is exported.
# ldm add-vdsdev options=slice /dev/dsk/c1t57d0s2 c1t57d0s2@primary-vds0



30)How to Export a File as a Full Disk
service# mkfile 100m /ldoms/domain/test/fdisk0
primary# ldm add-vdsdev /ldoms/domain/test/fdisk0 fdisk0@primary-vds0
primary# ldm add-vdisk fdisk fdisk0@primary-vds0 ldg1
ldg1# ls -1 /dev/dsk/c0d5s*
/dev/dsk/c0d5s0
/dev/dsk/c0d5s1
/dev/dsk/c0d5s2
/dev/dsk/c0d5s3
/dev/dsk/c0d5s4
/dev/dsk/c0d5s5
/dev/dsk/c0d5s6
/dev/dsk/c0d5s7
31)How to Export a ZFS Volume as a Full Disk
service# zfs create -V 100m ldoms/domain/test/zdisk0
primary# ldm add-vdsdev /dev/zvol/dsk/ldoms/domain/test/zdisk0 zdisk0@primary-vds0
primary# ldm add-vdisk zdisk0 zdisk0@primary-vds0 ldg1
ldg1# ls -1 /dev/dsk/c0d9s*
/dev/dsk/c0d9s0
/dev/dsk/c0d9s1
/dev/dsk/c0d9s2
/dev/dsk/c0d9s3
/dev/dsk/c0d9s4
/dev/dsk/c0d9s5
/dev/dsk/c0d9s6
/dev/dsk/c0d9s7

31)How to Export a ZFS Volume as a Single-Slice Disk
service# zfs create -V 100m ldoms/domain/test/zdisk0
primary# ldm add-vdsdev options=slice /dev/zvol/dsk/ldoms/domain/test/zdisk0 zdisk0@primary-vds0
primary# ldm add-vdisk zdisk0 zdisk0@primary-vds0 ldg1
ldg1# ls -1 /dev/dsk/c0d9s*
/dev/dsk/c0d9s0
/dev/dsk/c0d9s1
/dev/dsk/c0d9s2
/dev/dsk/c0d9s3
/dev/dsk/c0d9s4
/dev/dsk/c0d9s5
/dev/dsk/c0d9s6
/dev/dsk/c0d9s7
32)Exporting Volumes and Backward Compatibility
Add the following line to the /etc/system file on the service domain
set vds:vd_volume_force_slice = 1
Setting this tunable forces the export of all volumes as single-slice disks, and you cannot export any volume as a full disk


33)How to Configure Virtual Disk Multipathing
# ldm add-vdsdev mpgroup=foo backend-path1 volume@primary-vds0
# ldm add-vdsdev mpgroup=foo backend-path2 volume@alternate-vds0
# ldm add-vdisk disk-name volume@primary-vds0 ldom
After we configure the virtual disk with multipathing and start the guest domain, the virtual disk accesses its back end through one of the service domains it has been associated with.
If this service domain becomes unavailable, the virtual disk attempts to access its back end through another service domain that is part of the same multipathing group.

No comments:

Post a Comment