Skip to content

Commit

Permalink
[Compute] Update from CoreOS to Flatcar (#18644)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoxing-ms authored Jul 2, 2021
1 parent c67a069 commit 99937aa
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 43 deletions.
6 changes: 3 additions & 3 deletions doc/install_linux_prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The commands to run to install the dependencies for some common distributions ar
* [6.7](#redhat-rhel-67)
* [7.2](#redhat-rhel-72)
* [SUSE](#suse-opensuse-132)
* [CoreOS](#coreos-stable-899150--beta-101010--alpha-101010)
* [Flatcar](#flatcar)

### Ubuntu 12.04 LTS
Python 2.7.3 should be already on the machine. Install Python 3.6+ if needed.
Expand Down Expand Up @@ -93,6 +93,6 @@ Python 2.7.8 should be already on the machine. Install Python 3.6+ if needed.
sudo zypper refresh && sudo zypper --non-interactive install gcc libffi-devel python-devel openssl-devel
```

### CoreOS Stable-899.15.0 / Beta-1010.1.0 / Alpha-1010.1.0
### Flatcar

Python is not installed by default.
Python is installed in the Azure-specific distribution of Flatcar, but is installed into the non-standard location `/usr/share/oem/python/bin/python`.
12 changes: 6 additions & 6 deletions src/azure-cli/azure/cli/command_modules/vm/_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
"sku": "7.5",
"version": "latest"
},
"CoreOS": {
"publisher": "CoreOS",
"offer": "CoreOS",
"sku": "Stable",
"version": "latest"
},
"Debian": {
"publisher": "Debian",
"offer": "debian-10",
"sku": "10",
"version": "latest"
},
"Flatcar": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable",
"version": "latest"
},
"openSUSE-Leap": {
"publisher": "SUSE",
"offer": "openSUSE-Leap",
Expand Down
11 changes: 9 additions & 2 deletions src/azure-cli/azure/cli/command_modules/vm/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,15 +787,22 @@ def _validate_vm_vmss_accelerated_networking(cli_ctx, namespace):
return

# VMs need to be a supported image in the marketplace
# Ubuntu 16.04 | 18.04, SLES 12 SP3, RHEL 7.4, CentOS 7.4, CoreOS Linux, Debian "Stretch" with backports kernel
# Ubuntu 16.04 | 18.04, SLES 12 SP3, RHEL 7.4, CentOS 7.4, Flatcar, Debian "Stretch" with backports kernel
# Oracle Linux 7.4, Windows Server 2016, Windows Server 2012R2
publisher, offer, sku = namespace.os_publisher, namespace.os_offer, namespace.os_sku
if not publisher:
return
publisher, offer, sku = publisher.lower(), offer.lower(), sku.lower()

if publisher == 'coreos' or offer == 'coreos':
from azure.cli.core.parser import InvalidArgumentValueError
raise InvalidArgumentValueError("As CoreOS is deprecated and there is no image in the marketplace any more,"
" please use Flatcar Container Linux instead.")

distros = [('canonical', 'UbuntuServer', '^16.04|^18.04'),
('suse', 'sles', '^12-sp3'), ('redhat', 'rhel', '^7.4'),
('openlogic', 'centos', '^7.4'), ('coreos', 'coreos', None), ('credativ', 'debian', '-backports'),
('openlogic', 'centos', '^7.4'), ('kinvolk', 'flatcar-container-linux-free', None),
('kinvolk', 'flatcar-container-linux', None), ('credativ', 'debian', '-backports'),
('oracle', 'oracle-linux', '^7.4'), ('MicrosoftWindowsServer', 'WindowsServer', '^2016'),
('MicrosoftWindowsServer', 'WindowsServer', '^2012-R2')]
import re
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"sku":"7.2",
"version":"latest"
},
"CoreOS":{
"publisher":"CoreOS",
"offer":"CoreOS",
"sku":"Stable",
"version":"latest"
},
"Debian":{
"publisher":"credativ",
"offer":"Debian",
"sku":"8",
"version":"latest"
},
"Flatcar": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable",
"version": "latest"
},
"openSUSE":{
"publisher":"SUSE",
"offer":"openSUSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,15 @@ def test_validate_vm_vmss_accelerated_networking(self, client_factory_mock):
np = mock.MagicMock()
np.size = 'Standard_DS4_v2'
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
size_mock.number_of_cores, size_mock.name = 8, 'Standard_DS4_v2'
_validate_vm_vmss_accelerated_networking(mock.MagicMock(), np)
self.assertTrue(np.accelerated_networking)

np = mock.MagicMock()
np.size = 'Standard_D3_v2' # known supported 4 core size
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
_validate_vm_vmss_accelerated_networking(None, np)
self.assertTrue(np.accelerated_networking)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"sku":"7.2",
"version":"latest"
},
"CoreOS":{
"publisher":"CoreOS",
"offer":"CoreOS",
"sku":"Stable",
"version":"latest"
},
"Debian":{
"publisher":"credativ",
"offer":"Debian",
"sku":"8",
"version":"latest"
},
"Flatcar": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable",
"version": "latest"
},
"openSUSE":{
"publisher":"SUSE",
"offer":"openSUSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,15 @@ def test_validate_vm_vmss_accelerated_networking(self, client_factory_mock):
np = mock.MagicMock()
np.size = 'Standard_DS4_v2'
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
size_mock.number_of_cores, size_mock.name = 8, 'Standard_DS4_v2'
_validate_vm_vmss_accelerated_networking(mock.MagicMock(), np)
self.assertTrue(np.accelerated_networking)

np = mock.MagicMock()
np.size = 'Standard_D3_v2' # known supported 4 core size
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
_validate_vm_vmss_accelerated_networking(None, np)
self.assertTrue(np.accelerated_networking)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"sku":"7.2",
"version":"latest"
},
"CoreOS":{
"publisher":"CoreOS",
"offer":"CoreOS",
"sku":"Stable",
"version":"latest"
},
"Debian":{
"publisher":"credativ",
"offer":"Debian",
"sku":"8",
"version":"latest"
},
"Flatcar": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable",
"version": "latest"
},
"openSUSE":{
"publisher":"SUSE",
"offer":"openSUSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,15 @@ def test_validate_vm_vmss_accelerated_networking(self, client_factory_mock):
np = mock.MagicMock()
np.size = 'Standard_DS4_v2'
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
size_mock.number_of_cores, size_mock.name = 8, 'Standard_DS4_v2'
_validate_vm_vmss_accelerated_networking(mock.MagicMock(), np)
self.assertTrue(np.accelerated_networking)

np = mock.MagicMock()
np.size = 'Standard_D3_v2' # known supported 4 core size
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
_validate_vm_vmss_accelerated_networking(None, np)
self.assertTrue(np.accelerated_networking)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"sku":"7.2",
"version":"latest"
},
"CoreOS":{
"publisher":"CoreOS",
"offer":"CoreOS",
"sku":"Stable",
"version":"latest"
},
"Debian":{
"publisher":"credativ",
"offer":"Debian",
"sku":"8",
"version":"latest"
},
"Flatcar": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable",
"version": "latest"
},
"openSUSE":{
"publisher":"SUSE",
"offer":"openSUSE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,15 @@ def test_validate_vm_vmss_accelerated_networking(self, client_factory_mock):
np = mock.MagicMock()
np.size = 'Standard_DS4_v2'
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
size_mock.number_of_cores, size_mock.name = 8, 'Standard_DS4_v2'
_validate_vm_vmss_accelerated_networking(mock.MagicMock(), np)
self.assertTrue(np.accelerated_networking)

np = mock.MagicMock()
np.size = 'Standard_D3_v2' # known supported 4 core size
np.accelerated_networking = None
np.os_publisher, np.os_offer, np.os_sku = 'coreos', 'coreos', 'alpha'
np.os_publisher, np.os_offer, np.os_sku = 'kinvolk', 'flatcar-container-linux-free', 'alpha'
_validate_vm_vmss_accelerated_networking(None, np)
self.assertTrue(np.accelerated_networking)

Expand Down

0 comments on commit 99937aa

Please sign in to comment.