Friday, October 16, 2020

How to Add Drive In Windows server running on Oracle Cloud Infrastructure

Well, few days back, i got a requirement to create a new drive for one of the customer who were running their windows instance in Oracle Cloud Infrastructure. They had an existing C:/ drive and i had to add a new drive say D:/. For complete overview of Block Volume in Oracle Cloud Infrastructure, the best pace to look is Oracle Documentations https://docs.cloud.oracle.com/en-us/iaas/Content/Block/Concepts/overview.htm#Overview_of_Block_Volume. Well, the process remains the same on how we add a block storage in Oracle Cloud Infrastructure but when it comes to Oracle Cloud windows server, there are some extra steps which we need to perform.


Go to the  Oracle cloud infrastructure console login page

 

1.      Create a block volume of desired size

 

I created it for size 256 GB

 



 

       2.      Attach the block volume to the windows instance

  


 

 

                 

 Once the volume is attached to the instance, we need to connect to the volume in the windows server.

3. Connecting to Your Windows Instance from a Remote Desktop Client

 

Open the Remote Desktop client.

In the Computer field, enter the public IP address that we retrieved from the Console.

 The User name is opc. Depending on the Remote Desktop client you are using, you might have to connect to the instance before you can enter this credential.


Click Connect to start the session.

 Accept the certificate if you are prompted to do so.

 Enter the initial password that you retrieved from the Console. You will be prompted to   change the password as soon as you log in.

 Your new password must be at least 12 characters long and must comply with Microsoft's password policy.

 Press Enter.

 

 

 



 

 

 

 



 

 On your Windows instance, open the iSCSI Initiator.

 For example: Open Server Manager, click Tools, and select iSCSI Initiator

 



 


 


 

 In the iSCSI Initiator Properties dialog box, click the Discovery tab.

 Click Discover Portal.

n 

 


 

1 

Note:-Block volume IP address and port, we can get it from the cloud console. Click the Actions icon (three dots) next to the volume you just attached and then click iSCSI Commands and Information.


The iSCSI Commands and Information dialog box opens. Notice that the dialog box displays specific identifying information about your volume (such as IP address and port) as well as the iSCSI commands that you can use.

 

1.     

 

 

 In the Discovered Targets region, select the volume IQN.

Click Connect and then click OK to close the dialog.

You are now ready to format (if needed) and mount the volume. To get a list of mountable iSCSI devices on the instance, in Server Manager, click File and Storage Services and then click Disks.

The 256 GB disk is displayed in the list.

1.     

 










 Click on File and storage Services

 






This completes the addition of one new disk drive to windows server which is running in Oracle Infrastructure Cloud.  Again, to know more about the fundamentals, it is always a good practice to visit Oracle Cloud documentation https://docs.cloud.oracle.com/en-us/iaas/Content/GSG/Tasks/addingstorageForWindows.htm  which keeps on updating.


I hope this will help someone. Keep learning Cloud as it is the future.

 


 

 

 

 

Sunday, August 30, 2020

Sending emails in Oracle Cloud using Email Delivery

 Few days back, i had a task to send emails from Oracle Cloud. My first pitstop was the Oracle Documentation oracle Notes which is very precise. 


1. The first step would be create a new non federated user. As a best practice, we should not use the user using which we do the console administration.


2. Create SMTP credentials for user



                                     






  Copy the password and keep it safe.


3.  Setup permissions and policy

The new user must be assigned to a group with permissions to manage approved-senders and suppressions


 





    4. Create an approved sender

     



     This user will be needed to send emails.

   








5.  Configure SPF on the approved sender domain






6. Configure the SMTP connection

 

Update the Postfix main.cf file.

 

To open the main.cf file, run the following command:

 

sudo vi /etc/postfix/main.cf

 

 

 

Add the following information to the end of the file:

 

smtp_tls_security_level = may

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

smtp_sasl_security_options =

 

If the following line is present, either remove the line or turn it off:

smtpd_use_tls = yes

 

 

Update relayhost to include your SMTP connection endpoint and port.

relayhost = smtp.us-ashburn-1.oraclecloud.com:587

 

 

 

 

Create the sasl_passwd file in the same directory as main.cf

 

 

 

sudo vi /etc/postfix/sasl_passwd

 

 

add the content

smtp.us-ashburn-1.oraclecloud.com:587 ocid1.user.oc1..aaaaaaaacnikk6yarhsyxhjre7wdlzpt6jyj43i473m2uley4tup27snvyaa@***********..aaaaaaaaposae6cowatr3hfig5t46rhds6eapjn5a2rmovousqs76cyo43ta.ov.com:E1##48;8EnY}rSxA;(9J

 

 

Run the following command:

 

sudo chown root:root /etc/postfix/sasl_passwd

sudo chmod 600 /etc/postfix/sasl_passwd

 

 

Generate the password hash.

 

Run the following command:

 

sudo postmap hash:/etc/postfix/sasl_passwd

 

7. At this moment, we have completed the email delivery configuration. Now we need a relay server through which we can send the emails. Postfix is one of them and we are using it here.

1.      Start Postfix using root user

postfix start



8. Test email outbound


1.      Test email( using root user)

echo "This is a test message for postfix" | mail -s "Test Email-Delivery in OCI using Postfix from Samrat" -r samsin16@in.***com samratsinha05@gmail.com 


Ahh!!.. thats it. it wasn't complicated at all. The main objective is to get the right documentations and follow the steps one by one. 

Note: In Oracle EBS, we can also use this setup to configure our outbound mail server.


Hope, this helps someone


Issue:-

When Setting Up Email Delivery Service In OCI Error: "Email Is Not Available With Your Current Permissions. Contact Support in OCI instance" (Doc ID 2478986.1)

 

References:- https://docs.cloud.oracle.com/en-us/iaas/Content/Email/Reference/gettingstarted.htm

 

https://www.cyberciti.biz/faq/linux-unix-start-stop-restart-postfix/