Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Ubuntu 서버 14.04 LTS의 MAAS 및 Juju에서 태그 사용

Summary: MAAS는 노드의 물리적 속성을 기반으로 태그 시스템을 구현합니다. 태그에 대한 MAAS 설명서에서 이에 대해 설명합니다

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

이 기사는 Canonical Field Engineer 인 Mark Wenning이 작성했습니다.

MAAS 및 Juju 클러스터를 더 세밀하게 제어하기 위한 태그

MAAS는 노드의 물리적 속성을 기반으로 태그 시스템을 구현합니다. 태그에 대한 MAAS 설명서에서는 주로 –constraints에 대한 설명 옵션과 함께 기존 하드웨어 태그를 사용하는 관점에서 이에 대해 설명합니다. 

MAAS 및 Juju 클러스터를 더 쉽게 배포하고 관리할 수 있도록 새 태그를 수동으로 만들 수도 있습니다.    

예를 들어 MAAS 클러스터에서 Juju를 부트스트랩하고 부트스트랩 노드가 특정 머신에 있도록 강제하려는 경우 먼저 노드에 태그를 지정한 다음 태그를 제약 조건으로 사용하여 부트스트랩할 수 있습니다.

$ juju bootstrap --constraints "tags=my-juju-bootstrap-node" –debug

이와 같은 태그 제약 조건을 설정하면 다음 juju 명령은 취소할 때까지 제약 조건을 사용하려고 시도합니다.

$ juju set-constraints "tags="

태그의 또 다른 용도는 동일한 태그로 여러 노드를 표시한 다음 해당 노드에만 배포하는 것입니다.

$ juju deploy mysql –constraints "tags=my-juju-Dell-nodes" --debug

MAAS 명령줄 인터페이스에 로그인

이러한 명령을 사용하려면 먼저 MAAS 리젼 서버에 로그인해야 합니다.

$ maas login <profile-name> <host-url> <apikey>
  • <profile-name> 은 원하는 모든 것이 될 수 있으며 일반적으로 "MaaS"입니다.
  • <host-url>은 MAAS 지역 컨트롤러의 URL과 API 및 버전(예: https://192.168.0.2/MAAS/api/1.0)입니다.
  • <apikey> 는 MAAS 지역 컨트롤러가 빌드될 때 생성된 MAAS API 또는 oauth 키입니다.

자세한 내용은 https://maas.io/docs/이 하이퍼링크는 Dell Technologies 외부의 웹사이트로 연결됩니다. 참조하십시오.

완료되면 MAAS cli 환경에서 로그아웃하려면 다음을 실행하십시오.

$ maas logout maas

"description" 옵션을 사용하여 태그 생성

태그에 대한 MAAS 문서에서 설명한 대로 노드와 연관된 "lshw" 정보(XML 형식)를 기반으로 XPath 표현식을 사용하여 태그를 작성하고 지정할 수 있습니다.   각 노드 웹페이지 하단에서 "원시 검색 데이터" 아래의 "검색된 세부 정보 표시" 링크를 클릭하여 이 정보에 액세스할 수 있습니다.   내 노드 중 하나에 대한 "lshw"정보의 일부는 다음과 같습니다.

...

<lshw:node id="t410" claimed="true" class="system" handle="DMI:0100">
<lshw:description>System</lshw:description>
<lshw:product>PowerEdge T410 ()</lshw:product>
<lshw:vendor>Dell Inc.</lshw:vendor>
<lshw:serial>RHXT410</lshw:serial>
<lshw:width units="bits">64</lshw:width>
<lshw:configuration>
<lshw:setting id="boot" value="normal"/>
<lshw:setting id="chassis" value="server"/>
<lshw:setting id="uuid" value="44454C4C-4800-1058-8054-D2C04F343130"/>
</lshw:configuration>
<lshw:capabilities>
...

시스템의 노드에 더 많은 설명 태그를 추가하려면 다음을 실행할 수 있습니다.

$ maas maas tags new name="Dell_Machine" definition='//node[@class="system"]/vendor = "Dell Inc."'
$ maas maas tags new name="Intel_Machine" definition='//node[@class="system"]/vendor = "Intel Corp."'
$ maas maas tags new name="Virtual_Machine" definition='//node[@class="system"]/vendor = "QEMU"'
$ maas maas tags new name="Laptop" definition='//node[@class="system"]/description = "Laptop"'
$ maas maas tags new name="Rack_Mount" definition='//node[@class="system"]/description = "Rack Mount Chassis"'
$ maas maas tags new name="Mini_Tower" definition='//node[@class="system"]/description = "Mini Tower Computer"'
$ maas maas tags new name="System" definition='//node[@class="system"]/description = "System"'
$ maas maas tags new name="Desktop" definition='//node[@class="system"]/description = "Desktop Computer"'
$ maas maas tags new name="Blade" definition='//node[@class="system"]/description = "Multi-system"'
$ maas maas tags new name="Intel_CPU" definition='//node[@class="processor"]/vendor = "Intel Corp."'
$ maas maas tags new name="AMD_CPU" definition='//node[@class="processor"]/vendor = "Advanced Micro Devices [AMD]"'
$ maas maas tags new name="64bit" definition='//node[@class="system"]/width="64"'
$ maas maas tags new name="32bit" definition='//node[@class="system"]/width="32"'

이는 Dell_Machine, Intel_Machine, Virtual_Machine, Rack_Mount, 시스템, 데스크탑, 노트북, Rack_Mount, 다중 시스템, 64비트 및/또는 32비트 태그로 호환 노드에 태그를 지정하며 나중에 추가되는 모든 노드에도 적용됩니다.

수동으로 태그 생성

MAAS cli 명령을 사용하여 새 원시 태그가 생성됩니다

$ maas <profile> tag new name="<tag-name>" [comment="<comment>"]
  • <profile> 은 로그인 명령으로 설정된 프로파일 이름으로, 일반적으로 "MaaS"입니다.
  • <tag-name> 은 태그의 이름입니다.
  • <주석> 은 선택 사항이지만 좋은 생각입니다.

여기서는 설명 옵션을 사용하지 않습니다.   그렇게:

$ maas maas tag new name="my-juju-node" comment="my new juju node"

이 태그는 시스템에 있는 하나 이상의 노드에 수동으로 할당할 수 있습니다.

태그 할당

노드에 태그를 할당하려면 다음 명령을 실행합니다.

$ maas <profile> tag update-nodes <raw-tag-name> add="<system-id>"
  • <profile> 은 로그인 중에 설정된 프로필 이름입니다.
  • <raw-tag-name> 은 이전에 만든 태그의 이름입니다.
  • <system-id> 는 노드의 시스템 ID입니다.

<시스템 ID>가 있습니까?  저게 뭐죠?

노드의 시스템 ID는 어떻게 찾습니까?   한 가지 방법은 노드 정보를 나열하고 구조체에서 선택하는 것입니다.  maas cli 명령

$ maas <profile> nodes list
  • <profile> 은 로그인 중에 설정된 프로필 이름입니다.

노드에 대한 모든 정보를 포함하는 JSON 형식의 객체(구조체 목록)를 덤프합니다.  예:

$ maas maas nodes list

[
{
"status": 4,
"macaddress_set": [
{
"resource_uri": "/MAAS/api/1.0/nodes/node-2349c038-d792-11e3-8df4-0c54a5f0ce34/macs/bc%3A30%3A5b%3Ae3%3A21%3A15/",
"mac_address": "bc:30:5b:e3:21:15"
}
],
"hostname": "T110ii.maas",
"zone": {
"resource_uri": "/MAAS/api/1.0/zones/default/",
"name": "default",
"description": ""
},
"routers": [],
"netboot": true,
"cpu_count": 8,
"storage": 239825,
"owner": null,
"system_id": "node-2349c038-d792-11e3-8df4-0c54a5f0ce34",
"architecture": "amd64/generic",
"memory": 8192,
"power_type": "ipmi",
"tag_names": [
"use-fastpath-installer",
"my-juju-boostrap-node"
],
"ip_addresses": [
"192.168.0.53"
],
"resource_uri": "/MAAS/api/1.0/nodes/node-2349c038-d792-11e3-8df4-0c54a5f0ce34/"
},
]

출력 디코딩

목록의 첫 번째 노드에는 "T110ii.maas"의 "hostname" 속성이 있습니다. 이 노드의 system-id 속성에도 관심이 있습니다. "system_id": "node-2349c038-d792-11e3-8df4-0c54a5f0ce34"

이제 이 노드에 새 태그를 할당할 수 있습니다.

$ maas maas tag update-nodes my-juju-bootstap-node add=node-2349c038-d792-11e3-8df4-0c54a5f0ce34

그림 1의 "tag-names" 속성은 새 태그를 포함하여 이 노드에 할당된 모든 태그를 나열합니다.

태그를 추가하는 데 도움이 되는 스크립트

옵션:

  • --login : 노드에 태그를 할당하기 전에 로그인합니다. 이 옵션에는
    • –oauth : 위에 로그인하는 데 사용되는 API / OAuth 키이며 설정에 따라 가능합니다.
    • –host_url : 위에 로그인하는 데 사용되는 호스트 URL
    • –프로필 : 위에 로그인하는 데 사용되는 프로필 이름
  • --remove_tags :이 스크립트에서 이전에 할당 한 태그를 제거합니다.
  • --add_tags: 이름을 기반으로 각 노드에 태그를 추가합니다.

참조

명령줄 인터페이스 MAAS 1.6 문서:

https://maas.io/docs/maas-cli이 하이퍼링크는 Dell Technologies 외부의 웹사이트로 연결됩니다.

Juju 문서(제약 조건) 

https://juju.ubuntu.com/docs/charms-constraints.html이 하이퍼링크는 Dell Technologies 외부의 웹사이트로 연결됩니다.

https://juju.ubuntu.com/docs/reference-constraints.html이 하이퍼링크는 Dell Technologies 외부의 웹사이트로 연결됩니다.

Cause

-

Resolution

-

Article Properties


Affected Product

Ubuntu Server LTS

Last Published Date

23 Jul 2024

Version

4

Article Type

Solution