반응형
작성일: 2026년 1월 28일

 

Nested Virtualization이 필요해서 Amazon Cloud에서 Baremetal Machine을 요청해봤다.

그런데, Instance 생성 버튼을 누르자 아래와 같이 Error 메시지가 출력되었다.

 

You have requested more vCPU capacity than your current vCPU limit of 32 allows 
for the instance bucket that the specified instance type belongs to. 
Please visit http://aws.amazon.com/contact-us/ec2-request 
to request an adjustment to this limit.

 

 

그래서 [ Service Quotas ] 페이지에서 [ Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances
] 증설을 요청했다.

 

참고:
"Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances"는 아래와 같은 의미임.
--->
Maximum number of vCPUs assigned to the Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances.

 

 

최대로 할당받을 수 있는 vCPU 개수의 초기값은 32로 되어 있었고, 넉넉하게 vCPU 192 core를 요청했다.

그런데, 이 요청이 바로 처리되는게 아니다.

요청에 대한 처리 상태가 "Case Opened"로 표시되고 상당 시간이 있어야 내가 요청한 vCPU를 사용할 수 있는 것 같다.

내 경우는 Region별로 4개의 Request를 보냈는데, 평균적으로 1시간 정도 시간이 소요되었다. 

참고로, 내가 요청한 내용에 대해서 1차 회신이 왔는데 아래와 같다. (안내 메일은 수분 내로 받은 것 같다)

 

Hello there,

Thank you for contacting us.

I understand that you would like a Quota increase as per the following specifics:
[US East (Northern Virginia)]: EC2 Spot Instances / All Standard (A, C, D, H, I, M, R, T, Z) Spot Instance Requests, New Limit = 192

Addressing this request requires a collaboration with our internal teams and I have initiated this already.

I am working towards getting you a resolution and I will notify you as soon as I have an update.

I appreciate your patience and understanding during this process.

Best regards,
Amazon Web Services

 

vCPU 증설 요청한 내용이 Amazon Cloud 측에서 Accept하기 까지는 1시간 정도 시간이 소요되니까,

큰 용량의 Instance를 생성할 때는 반나절 정도의 시간적 여유를 두는 것이 좋다.

급할 때는 이것 때문에 "심장이 쫄리는" 것 같다.

 

반응형
작성일: 2025년 9월 4일

 

 

 

EC2 Instance를 운용하다보면, EC2 내부에서 실행중인 프로세스가 Amazon Cloud Infra의 Provision 정보 또는 Meta data를 조회해야 하는 경우가 있다.

(예를 들어, Instance를 여러 개 묶어서 HA 또는 Cluster를 구성하거나 EMS/NMS 시스템에게 정보를 전달하기 위해)

 

아래와 같이 Rest API를 이용해서 EC2 Instance 내부의 프로세스가 Instance 자체의 Meta data를 조회하는 것이 가능한다.

 

EC2 Instance 내부에 SSH 접속하여 아래와 같은 Shell command를 수행한다.

 

$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
$ curl -H "X-aws-ec2-metadata-token: $TOKEN"  http://169.254.169.254/latest/meta-data

ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
events/
hostname
identity-credentials/
instance-action
instance-id
instance-life-cycle
instance-type
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-hostname
public-ipv4
public-keys/
reservation-id
security-groups
services/

$

 

 

 

예를 들어서, 내가 SSH 접속한 EC2 Instance가 어느 Availability Zone에서 운영되고 있는지 확인하고 싶다면 아래와 같이 HTTP Get을 한다.

 

$ curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone

ap-northeast-2c

 

 

Amazon Cloud Infra가 해당 EC2 Instance에서 할당한 Public IP addressInternet domain name을 조회하고 싶다면 아래와 같이 HTTP Get을 한다.

 

$ curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-ipv4

52.77.178.215

$ curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-hostname

ec2-52-77-178-215.ap-northeast-2.compute.amazonaws.com

 

 

 

 

반응형
작성일: 2024년 3월 28일

 

Oracle Cloud Infra(OCI)에서 VM instance를 생성하는 것은 Web Console에서 권고값을 따라

"다음", "OK" 같은 버튼만 누르면 쉽게 처리할 수 있다.

 

그런데 이렇게 생성한 VM instance에 SSH 접속하려고 하면, Oracle 매뉴얼처럼 수행했을 때 잘 안 된다.

SSH 접속이 안 되는 원인이 OS Image 마다 조금 달랐다.

 

참고: VM instance에 기본 로그인 계정 설정하기

    Oracle OCI Web Console에서 VM instance에 console 화면에 접근하려면,
    VM instance를 생성하는 시점에 cloud-init 스크립트에 Login 계정을 설정해야 한다. (ID, Password 등)
    아래 블로그에 자세한 방법과 예제가 있다. 예제를 보고 따라하면 된다.

    https://andrewpage.tistory.com/171

 

 

Case: "Oracle Linux 8 Image"를 이용하여 VM Instance를 만든 경우

 방화벽이 활성화되어 있어서 Source IP address가 동일 Subnet이 아닌 경우 SSH 접속이 막고 있다.

아래 명령을 수행해서 방화벽을 끄면 된다.

$ systemctl stop firewalld

$ systemctl disable firwalld

 

초기 작업을 위해 위와 같이 방화벽을 우선 끄고 SSH 접속하고, 어느 정도 Network과 관련한 설정을 변경하고 나면 

다시 firewalld 서비스를 활성화해야 한다. (보안을 위해서 꼭 잊지 말고 해야 한다)

 

 

Case: "Ubuntu 22.04 Image"를 이용하여 VM Instance를 만든 경우

Ubuntu 22.04 VM instance는 다행히 Ubuntu Firewall 서비스가 꺼져 있다.

그런데 Netfilter가 특정 몇개 Port를 제외하고 모두 Reject 하도록 설정되어 있다.

그러므로 Netfilter의 Rule을 조정할 필요가 있다. (아래 명령을 참고)

$ iptables -F

 

그리고 아래와 같이 iptables rule을 다시 구성했다. 

아래 스크립트 중에서 "FIXME" 라고 코멘트 추가한 부분을 참고하면 된다.

$ cat /etc/iptables/rules.v4

# CLOUD_IMG: This file was created/modified by the Cloud Image build process
# iptables configuration for Oracle Cloud Infrastructure

# See the Oracle-Provided Images section in the Oracle Cloud Infrastructure
# documentation for security impact of modifying or removing these rule

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [463:49013]
:InstanceServices - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp --sport 123 -j ACCEPT

## FIXME: Domain Name Server 접근을 허용하는 Rule 추가
-I INPUT -p udp -m udp --dport 53 -j ACCEPT

## FIXME: SSH 접속할 포트를 변경
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2022 -j ACCEPT 

-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

... 이하 생략 ...

 

위와 같이 /etc/iptables/rules.v4 를 수정하고, 깔끔하게 VM instance를 Restart하고 SSH를 접속해보자~

잘 접속될 것이다. ^^

 


 

반응형

 

작성일: 2024년 2월 16일

 

 

Openstack에서 VM Instance를 새로 생성할 때, OS에 설정할 내용이 있다면 User Data를 입력하면 편하다.

(VM instance의 user datainit-cloud, cloud-init 스크립트라는 용어로 불리는 경우도 있다)

아래와 같이 예제를 보고, 필요한 부문만 조금씩 바꾸어 사용하는 것을 추천~

 

#cloud-config

ssh_pwauth: True

ssh_authorized_keys:
  - ssh-rsa AAA...SDvz sejong@xx.yy.com
  - ssh-rsa AAB...QTuo alphaa@aa.bb.com

chpasswd:
  list: |
     root:myxxyyzzroot
     ubuntu:myubuntuxxyyzz
     cloud-user:myxxyyzz
  expire: False
    
locale: en_US.UTF-8

# timezone: America/New_York
timezone: Asia/Seoul

bootcmd:
 - echo "My command at system booting" >> /var/my-cmd.txt

runcmd:
 - echo "My command example" >> /var/my-cmd.txt
 - apt install locales
 - locale-gen en_US.UTF-8
 - locale-gen ko_KR.UTF-8

 

위 예제는 root, ubuntu, cloud-user 등 3개 계정의 Password를 변경하고, timezone을 서울로 설정하고, Locale(언어)를 English로 설정하는 예제이다.

 

 


 

 

더 자세한 내용은 아래 Web Docs를 참고하자 !!!

 

Red Hat 문서

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_cloud-init_for_rhel_8/configuring-cloud-init_cloud-content

 

다양한 cloud-init 설정 예제 문서

https://ko.linux-console.net/?p=8814

 

'CentOS' 카테고리의 다른 글

Hugepage 설정 절차  (0) 2022.08.02
YUM 또는 DNF Repository 추가 방법  (0) 2022.06.22
Install Ansible AWX (version 17.1.0)  (0) 2021.11.16
How to use Ansible and Playbook  (0) 2021.11.12
Install OS with PXE and kickstart  (0) 2021.11.12

+ Recent posts