Go to main content

Using Oracle® Compute Cloud Service - Dedicated Compute Capacity - SPARC Model 300

Exit Print View

Updated: April 2018
 
 

Attach a Volume to an Instance

Complete these steps to attach a volume to an instance:

  1. Log into the compute instance with root privileges.
  2. Configure 'Send target' iSCSI discovery.

    You only need to do this once on the instance.

    root@opc-192-168-50-6:~# iscsiadm list discovery
    Discovery:
    Static: enabled
    Send Targets: disabled
    iSNS: disabled
    root@opc-192-168-50-6:~# iscsiadm modify discovery -t enable  
  3. Configure the IP address (192.168.50.36, in this example) of the ZFSSA head that is exporting the iSCSI LUNs.

    Remember that this address was noted in the Configurations tab during Create a Volume.


    image:Figure that shows IP in example.

    You only need to do this once on the instance.

    root@opc-192-168-50-6:~# iscsiadm add discovery-address 192.168.50.36
    Jul 31 12:12:58 opc-192-168-50-6 cmlb: WARNING: 
    /scsi_vhci/ssd@g600144f0e196e8460000579dd8ce0003 (ssd0):
    Jul 31 12:12:58 opc-192-168-50-6 Corrupt label; wrong magic number
    root@opc-192-168-50-6:~#  

    Note -  The LUN should appear almost immediately upon its creation. You might receive warning messages on the instance console (for example, Corrupt label; wrong magic number, as shown in the preceding example). This simply indicates that the LUN is not yet formatted, and is expected behavior.
  4. To remove these warning messages, use the format command on the new disk.

    The format command will list all available disks in the compute instance and will offer to label any disks that appear to be missing labels, such as the newly created volume (LUN). For example,

    root@opc-192-168-50-6:~# format
    Searching for disks...
    Jul 31 12:16:28 opc-192-168-50-6 cmlb: WARNING: /scsi_vhci/ssd@g600144f0e196e8460000579dd8ce0003 (ssd0): 
    Jul 31 12:16:28 opc-192-168-50-6 Corrupt label; wrong magic number 
    Jul 31 12:16:28 opc-192-168-50-6 cmlb: WARNING: /scsi_vhci/ssd@g600144f0e196e8460000579dd8ce0003 (ssd0):
    Jul 31 12:16:28 opc-192-168-50-6 Corrupt label; wrong magic number done 
    c0t600144F0E196E8460000579DD8CE0003d0: configured with capacity of 9.94GB
    
    AVAILABLE DISK SELECTIONS:
    0. c0t600144F0E196E8460000579DD8CE0003d0 <SUN-ZFS Storage 7330-1.0 cyl 323 alt 2 hd 254 sec 254>
    /scsi_vhci/ssd@g600144f0e196e8460000579dd8ce0003
    1. c1d0 <SUN-DiskImage-20GB cyl 27902 alt 2 hd 96 sec 768> /virtual-devices@100/channel-devices@200/disk@0 
    Specify disk (enter its number): 0
    selecting c0t600144F0E196E8460000579DD8CE0003d0 [disk formatted] 
    Jul 31 12:24:05 opc-192-168-50-6 cmlb: WARNING: /scsi_vhci/ssd@g600144f0e196e8460000579dd8ce0003 (ssd0): 
    Jul 31 12:24:05 opc-192-168-50-6 Corrupt label; wrong magic number Disk not labeled.
    Label it now? y
    Jul 31 12:24:08 opc-192-168-50-6 cmlb: WARNING: /scsi_vhci/ssd@g600144f0e196e8460000579dd8ce0003 (ssd0): 
    Jul 31 12:24:08 opc-192-168-50-6 Corrupt label; wrong magic number
    
    FORMAT MENU:
    disk - select a disk
    type - select (define) a disk type
    partition - select (define) a partition table
    current - describe the current disk
    format - format and analyze the disk
    repair - repair a defective sector
    label - write label to the disk
    analyze - surface analysis
    defect - defect list management
    backup - search for backup labels
    verify - read and display labels
    save - save new disk/partition definitions
    inquiry - show disk ID
    volname - set 8-character volume name
    !<cmd> - execute <cmd>, then return
    quit
    format> quit
    root@opc-192-168-50-6:~#