How do I use MAAS to create a Debian Image?
How do I create a Debian image in MAAS? All I found were some ubuntu releases and CentOS, is there any way to create a debian image ? if so how do I do it
maas
add a comment |
How do I create a Debian image in MAAS? All I found were some ubuntu releases and CentOS, is there any way to create a debian image ? if so how do I do it
maas
add a comment |
How do I create a Debian image in MAAS? All I found were some ubuntu releases and CentOS, is there any way to create a debian image ? if so how do I do it
maas
How do I create a Debian image in MAAS? All I found were some ubuntu releases and CentOS, is there any way to create a debian image ? if so how do I do it
maas
maas
asked Feb 13 '17 at 13:32
Sarah HSarah H
268
268
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
More complete answer:
Download a debian cloud image in raw format.
Mount the image
sudo mkdir /mnt/loop
sudo mount -o ro,loop,offset=1048576 <nameofdebianimage.raw> /mnt/loop
Convert to a gzipped tarball
cd /mnt/loop
sudo tar czvf ~/debian.tgz .
sudo umount /mnt/loop
Upload this to maas
cd ~
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian" architecture=amd64/generic content@=debian.tgz
Edit /etc/maas/preseeds/curtin_userdata_custom and add the following at the top after the comment line and before debconf_selections to override the kernel to install:
kernel:
fallback-package: linux-image-amd64
package: linux-image-amd64
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
add a comment |
Okay so this is how you do it, for all those who are stuck just the way I was.
wget http://cdimage.debian.org/cdimage/openstack/8.7.1-20170215/debian-8.7.1-20170215-openstack-amd64.raw
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian-8.7.1" architecture=amd64/generic content@=debian-8.7.1-20170215-openstack-amd64.raw
add a comment |
Based on the previous answers and on my own research I've made a short guide to make Debian 9 run on MaaS with the UEFI SecureBoot. There are some changes to be made to the source code as well in order to be able to complete the deploy successfully. I will summarize the contents in the following lines.
If you want to boot using UEFI and SecureBoot, the main step is to include the buster debian repos to the image so curtin will be able to install the packages grub-efi-amd64-signed and shim-signed (that are not present on stretch repos).
root@maas:~/custom-oses# mkdir /mnt/custom-os-loop
root@maas:~/custom-oses# mount -o rw,loop,offset=1048576,sync debian-9.7.0-openstack-amd64.raw /mnt/custom-os-loop
root@maas:~/custom-oses# chroot /mnt/custom-os-loop
root@maas:/# echo "deb http://ftp.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list
root@maas:/# apt update
root@maas:/# exit
root@maas:~/custom-oses# umount /mnt/custom-os-loop
Don't worry about breaking the system, as cloud-init will replace the sources.list file on the first boot.
Beside this in order to not override the sources that the image contains, the behavior of MaaS must be changed. Inspecting the code you will see that it's not possible to modify the value of the cloud-init's directive preserve_sources_list, it's going to be False always. The solution is to modify the function get_archive_config in the file compose_preseed.py.
archives['apt']['preserve_sources_list'] = True if node.osystem == 'custom' else preserve_sources
At this point the Debian OS will be installed successfully, but it will not be able to boot automatically. MaaS doesn't support Debian, so when providing the EFI directives to boot there is something missing. Locate the file config.local.amd64.template under the uefi directory, and add the following lines under the ubuntu ones.
debian/shimx64.efi
debian/grubx64.efi
And that's it!
Remember that if you edit the python files that are being run, you must remove the pycache and restart the services before seeing the changes
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f882911%2fhow-do-i-use-maas-to-create-a-debian-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
More complete answer:
Download a debian cloud image in raw format.
Mount the image
sudo mkdir /mnt/loop
sudo mount -o ro,loop,offset=1048576 <nameofdebianimage.raw> /mnt/loop
Convert to a gzipped tarball
cd /mnt/loop
sudo tar czvf ~/debian.tgz .
sudo umount /mnt/loop
Upload this to maas
cd ~
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian" architecture=amd64/generic content@=debian.tgz
Edit /etc/maas/preseeds/curtin_userdata_custom and add the following at the top after the comment line and before debconf_selections to override the kernel to install:
kernel:
fallback-package: linux-image-amd64
package: linux-image-amd64
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
add a comment |
More complete answer:
Download a debian cloud image in raw format.
Mount the image
sudo mkdir /mnt/loop
sudo mount -o ro,loop,offset=1048576 <nameofdebianimage.raw> /mnt/loop
Convert to a gzipped tarball
cd /mnt/loop
sudo tar czvf ~/debian.tgz .
sudo umount /mnt/loop
Upload this to maas
cd ~
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian" architecture=amd64/generic content@=debian.tgz
Edit /etc/maas/preseeds/curtin_userdata_custom and add the following at the top after the comment line and before debconf_selections to override the kernel to install:
kernel:
fallback-package: linux-image-amd64
package: linux-image-amd64
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
add a comment |
More complete answer:
Download a debian cloud image in raw format.
Mount the image
sudo mkdir /mnt/loop
sudo mount -o ro,loop,offset=1048576 <nameofdebianimage.raw> /mnt/loop
Convert to a gzipped tarball
cd /mnt/loop
sudo tar czvf ~/debian.tgz .
sudo umount /mnt/loop
Upload this to maas
cd ~
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian" architecture=amd64/generic content@=debian.tgz
Edit /etc/maas/preseeds/curtin_userdata_custom and add the following at the top after the comment line and before debconf_selections to override the kernel to install:
kernel:
fallback-package: linux-image-amd64
package: linux-image-amd64
More complete answer:
Download a debian cloud image in raw format.
Mount the image
sudo mkdir /mnt/loop
sudo mount -o ro,loop,offset=1048576 <nameofdebianimage.raw> /mnt/loop
Convert to a gzipped tarball
cd /mnt/loop
sudo tar czvf ~/debian.tgz .
sudo umount /mnt/loop
Upload this to maas
cd ~
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian" architecture=amd64/generic content@=debian.tgz
Edit /etc/maas/preseeds/curtin_userdata_custom and add the following at the top after the comment line and before debconf_selections to override the kernel to install:
kernel:
fallback-package: linux-image-amd64
package: linux-image-amd64
answered Nov 5 '17 at 16:36
ShawnShawn
112
112
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
add a comment |
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
Ran into this issue after following those instructions bugs.launchpad.net/maas/+bug/1673655
– kryo
Jan 27 at 3:00
add a comment |
Okay so this is how you do it, for all those who are stuck just the way I was.
wget http://cdimage.debian.org/cdimage/openstack/8.7.1-20170215/debian-8.7.1-20170215-openstack-amd64.raw
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian-8.7.1" architecture=amd64/generic content@=debian-8.7.1-20170215-openstack-amd64.raw
add a comment |
Okay so this is how you do it, for all those who are stuck just the way I was.
wget http://cdimage.debian.org/cdimage/openstack/8.7.1-20170215/debian-8.7.1-20170215-openstack-amd64.raw
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian-8.7.1" architecture=amd64/generic content@=debian-8.7.1-20170215-openstack-amd64.raw
add a comment |
Okay so this is how you do it, for all those who are stuck just the way I was.
wget http://cdimage.debian.org/cdimage/openstack/8.7.1-20170215/debian-8.7.1-20170215-openstack-amd64.raw
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian-8.7.1" architecture=amd64/generic content@=debian-8.7.1-20170215-openstack-amd64.raw
Okay so this is how you do it, for all those who are stuck just the way I was.
wget http://cdimage.debian.org/cdimage/openstack/8.7.1-20170215/debian-8.7.1-20170215-openstack-amd64.raw
maas login your.user http://<maasserver>:5240/MAAS 'user:credentials'
maas your.user boot-resources create name=custom/debian title="debian-8.7.1" architecture=amd64/generic content@=debian-8.7.1-20170215-openstack-amd64.raw
edited Feb 23 '17 at 13:39
user589808
answered Feb 18 '17 at 13:43
Sarah HSarah H
268
268
add a comment |
add a comment |
Based on the previous answers and on my own research I've made a short guide to make Debian 9 run on MaaS with the UEFI SecureBoot. There are some changes to be made to the source code as well in order to be able to complete the deploy successfully. I will summarize the contents in the following lines.
If you want to boot using UEFI and SecureBoot, the main step is to include the buster debian repos to the image so curtin will be able to install the packages grub-efi-amd64-signed and shim-signed (that are not present on stretch repos).
root@maas:~/custom-oses# mkdir /mnt/custom-os-loop
root@maas:~/custom-oses# mount -o rw,loop,offset=1048576,sync debian-9.7.0-openstack-amd64.raw /mnt/custom-os-loop
root@maas:~/custom-oses# chroot /mnt/custom-os-loop
root@maas:/# echo "deb http://ftp.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list
root@maas:/# apt update
root@maas:/# exit
root@maas:~/custom-oses# umount /mnt/custom-os-loop
Don't worry about breaking the system, as cloud-init will replace the sources.list file on the first boot.
Beside this in order to not override the sources that the image contains, the behavior of MaaS must be changed. Inspecting the code you will see that it's not possible to modify the value of the cloud-init's directive preserve_sources_list, it's going to be False always. The solution is to modify the function get_archive_config in the file compose_preseed.py.
archives['apt']['preserve_sources_list'] = True if node.osystem == 'custom' else preserve_sources
At this point the Debian OS will be installed successfully, but it will not be able to boot automatically. MaaS doesn't support Debian, so when providing the EFI directives to boot there is something missing. Locate the file config.local.amd64.template under the uefi directory, and add the following lines under the ubuntu ones.
debian/shimx64.efi
debian/grubx64.efi
And that's it!
Remember that if you edit the python files that are being run, you must remove the pycache and restart the services before seeing the changes
add a comment |
Based on the previous answers and on my own research I've made a short guide to make Debian 9 run on MaaS with the UEFI SecureBoot. There are some changes to be made to the source code as well in order to be able to complete the deploy successfully. I will summarize the contents in the following lines.
If you want to boot using UEFI and SecureBoot, the main step is to include the buster debian repos to the image so curtin will be able to install the packages grub-efi-amd64-signed and shim-signed (that are not present on stretch repos).
root@maas:~/custom-oses# mkdir /mnt/custom-os-loop
root@maas:~/custom-oses# mount -o rw,loop,offset=1048576,sync debian-9.7.0-openstack-amd64.raw /mnt/custom-os-loop
root@maas:~/custom-oses# chroot /mnt/custom-os-loop
root@maas:/# echo "deb http://ftp.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list
root@maas:/# apt update
root@maas:/# exit
root@maas:~/custom-oses# umount /mnt/custom-os-loop
Don't worry about breaking the system, as cloud-init will replace the sources.list file on the first boot.
Beside this in order to not override the sources that the image contains, the behavior of MaaS must be changed. Inspecting the code you will see that it's not possible to modify the value of the cloud-init's directive preserve_sources_list, it's going to be False always. The solution is to modify the function get_archive_config in the file compose_preseed.py.
archives['apt']['preserve_sources_list'] = True if node.osystem == 'custom' else preserve_sources
At this point the Debian OS will be installed successfully, but it will not be able to boot automatically. MaaS doesn't support Debian, so when providing the EFI directives to boot there is something missing. Locate the file config.local.amd64.template under the uefi directory, and add the following lines under the ubuntu ones.
debian/shimx64.efi
debian/grubx64.efi
And that's it!
Remember that if you edit the python files that are being run, you must remove the pycache and restart the services before seeing the changes
add a comment |
Based on the previous answers and on my own research I've made a short guide to make Debian 9 run on MaaS with the UEFI SecureBoot. There are some changes to be made to the source code as well in order to be able to complete the deploy successfully. I will summarize the contents in the following lines.
If you want to boot using UEFI and SecureBoot, the main step is to include the buster debian repos to the image so curtin will be able to install the packages grub-efi-amd64-signed and shim-signed (that are not present on stretch repos).
root@maas:~/custom-oses# mkdir /mnt/custom-os-loop
root@maas:~/custom-oses# mount -o rw,loop,offset=1048576,sync debian-9.7.0-openstack-amd64.raw /mnt/custom-os-loop
root@maas:~/custom-oses# chroot /mnt/custom-os-loop
root@maas:/# echo "deb http://ftp.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list
root@maas:/# apt update
root@maas:/# exit
root@maas:~/custom-oses# umount /mnt/custom-os-loop
Don't worry about breaking the system, as cloud-init will replace the sources.list file on the first boot.
Beside this in order to not override the sources that the image contains, the behavior of MaaS must be changed. Inspecting the code you will see that it's not possible to modify the value of the cloud-init's directive preserve_sources_list, it's going to be False always. The solution is to modify the function get_archive_config in the file compose_preseed.py.
archives['apt']['preserve_sources_list'] = True if node.osystem == 'custom' else preserve_sources
At this point the Debian OS will be installed successfully, but it will not be able to boot automatically. MaaS doesn't support Debian, so when providing the EFI directives to boot there is something missing. Locate the file config.local.amd64.template under the uefi directory, and add the following lines under the ubuntu ones.
debian/shimx64.efi
debian/grubx64.efi
And that's it!
Remember that if you edit the python files that are being run, you must remove the pycache and restart the services before seeing the changes
Based on the previous answers and on my own research I've made a short guide to make Debian 9 run on MaaS with the UEFI SecureBoot. There are some changes to be made to the source code as well in order to be able to complete the deploy successfully. I will summarize the contents in the following lines.
If you want to boot using UEFI and SecureBoot, the main step is to include the buster debian repos to the image so curtin will be able to install the packages grub-efi-amd64-signed and shim-signed (that are not present on stretch repos).
root@maas:~/custom-oses# mkdir /mnt/custom-os-loop
root@maas:~/custom-oses# mount -o rw,loop,offset=1048576,sync debian-9.7.0-openstack-amd64.raw /mnt/custom-os-loop
root@maas:~/custom-oses# chroot /mnt/custom-os-loop
root@maas:/# echo "deb http://ftp.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list
root@maas:/# apt update
root@maas:/# exit
root@maas:~/custom-oses# umount /mnt/custom-os-loop
Don't worry about breaking the system, as cloud-init will replace the sources.list file on the first boot.
Beside this in order to not override the sources that the image contains, the behavior of MaaS must be changed. Inspecting the code you will see that it's not possible to modify the value of the cloud-init's directive preserve_sources_list, it's going to be False always. The solution is to modify the function get_archive_config in the file compose_preseed.py.
archives['apt']['preserve_sources_list'] = True if node.osystem == 'custom' else preserve_sources
At this point the Debian OS will be installed successfully, but it will not be able to boot automatically. MaaS doesn't support Debian, so when providing the EFI directives to boot there is something missing. Locate the file config.local.amd64.template under the uefi directory, and add the following lines under the ubuntu ones.
debian/shimx64.efi
debian/grubx64.efi
And that's it!
Remember that if you edit the python files that are being run, you must remove the pycache and restart the services before seeing the changes
answered Feb 18 at 17:14
Juan VelaJuan Vela
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f882911%2fhow-do-i-use-maas-to-create-a-debian-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown