Wednesday, 6 March 2019

Resize Memory and CPU of Exadata Virtual Machines

1. Stop oracle service in VM
./crsctl stop crs

2. Login to compute node as root user and edit vm.cfg  file with required memory size and cpu count
cd /EXAVMIMAGES/GuestImages/dbm0dm01-vm01.exadata.com
# vi vm.cfg
acpi = 1
apic = 1
pae = 1
builder = 'hvm'
kernel = '/usr/lib/xen/boot/hvmloader'
device_model = '/usr/lib/xen/bin/qemu-dm'
# To make VMs with more than 12 vCPUs work on exadata server
#   1: Processor Info and Feature Bits
#   This returns the CPU's stepping, model, and family information in EAX (also called the signature of a CPU),
#   feature flags in EDX and ECX, and additional feature info in EBX.
#   The format of the information in EAX is as follows:
#     3:0   - Stepping
#     7:4   - Model
#     11:8  - Family
#     13:12 - Processor Type
#     19:16 - Extended Model
#     27:20 - Extended Family
# Each register has 32 bits with 31st bit in the left end and 0 bit in the right end.
#   edx register:
#     12 bit - Memory Type Range Registers. Force to 0 set uncached access mode to memory ranges.
# Each successive character represent a lesser-significant bit:
#     '1' -> force the corresponding bit to 1
#     '0' -> force to 0
#     'x' -> Get a safe value (pass through and mask with the default policy)
#     'k' -> pass through the host bit value
#     's' -> as 'k' but preserve across save/restore and migration
#               33222222222211111111110000000000
#               10987654321098765439898876543210
cpuid = ['1:edx=xxxxxxxxxxxxxxxxxxx0xxxxxxxxxxxx']
disk = ['file:/OVS/Repositories/0fc1764c4bfa/VirtualDisks/.img,xvda,w','file:/OVS/Repositories/0fc1f6df276c4bfa/VirtualDisks/.img,xvdb,w','file:/OVS/Repositories//VirtualDisks/7cb40e424dc57b.img,xvdc,w','file:/OVS/Repositories/0fc1f6df727c4c4bfa/VirtualDisks/d9f52aa93907fe1cdcb5.img,xvdd,w']
memory = '737280'
maxmem = '737280'
OVM_simple_name = 'poc-1node-2'
name = 'dbm0dm01-vm01.exadata.com'
OVM_os_type = 'Oracle Linux 7'
vcpus = 64
maxvcpus = 64
uuid = '0fc1f6f37634c4fa'
on_crash = 'restart'
on_reboot = 'restart'
serial = 'pty'
keymap = 'en-us'
vif = ['type=netfront,mac=00:15:3e:d3:f9:00,bridge=vmbondeth0','type=netfront,mac=00:16:5e:27:c7:79,bridge=vmeth0']
timer_mode = 2
ib_pfs = ['3b:00.0']
ib_pkeys = [{'pf':'3b:00.0','port':'1','pkey':['0xffff',]},{'pf':'3b:00.0','port':'2','pkey':['0xffff',]},]
#
3. Restart VM to reflect changes
#xm list
Name                     ID Mem  VCPUs State   Time(s)
Domain-0                  0 8101   4   r----- 1443464.2
dbm0dm01-vm01.exadata.com 4 344067 48  r----- 2538904.4 (before change)

Stopping VM:
# xm shutdown -w dbm0dm01-vm01.exadata.com
Domain dbm0dm01-vm01.exadata.com terminated
All domains terminated

# xm list ( VM is down now )
Name             ID   Mem VCPUs      State   Time(s)
Domain-0          0  8101     4     r----- 1443529.3

Starting VM (here create mean starting VM):
# xm create /EXAVMIMAGES/GuestImages/dbm0dm01-vm01.exadata.com/
Using config file
"/EXAVMIMAGES/GuestImages/dbm0dm01-vm01.exadata.com/vm.cfg".
Started domain dbm0dm01-vm01.exadata.com (id=5)

# xm list (VM is up and it reflects changed memory and cpu )
Name                       ID Mem VCPUs      State   Time(s)
Domain-0                   0  8101     4     r----- 1443652.2
dbm0dm01-vm01.exadata.com  5 737283    64     -b----     56.1

No comments:

Post a Comment